| 10-27-2009, 07:41 PM | #1 |
I am new to these forums and therefore if I make any mistakes, please point me in the right direction. In my map, I am making a unit slowly rise above the terrain when it casts a spell. I also want it to shoot lightning bolts out at random enemy players. I have triggered this in GUI and it works perfectly. The only problem is that the lightning effect does not follow the units height, instead it just goes to its origin. I am confident that there is some way to do this is JASS but alas, no luck as of yet. If anyone could assist me in this, I would be greatful. NOTE: I'm profficient in GUI but I am not very good at JASS, so please make it as simple as possible! |
| 10-27-2009, 07:52 PM | #2 |
JASS:call MoveLightning(whichLightning,x1,y1,z1,x2,y2,z2) |
| 10-27-2009, 07:57 PM | #3 |
Pretty sure that the one you actually want is MoveLightningEx. |
| 10-27-2009, 07:59 PM | #4 |
As I said, I'm not very good at JASS, so a little more information would be nice. Say my units Global Variables were "Unit1" and "Unit2", can you rewrite that script to incorporate how to get the units location on the axis? |
| 10-27-2009, 08:05 PM | #5 |
JASS:local location l = GetUnitLoc(Unit1) local real z1 = GetLocationZ(l)+GetUnitFlyHeight(Unit1) |
| 10-27-2009, 08:09 PM | #6 |
x1 = GetUnitX(u1) y1 = GetUnitY(u1) z1 = GetUnitFlyHeight(u1) ... right? same for x2,y2,z2 dont know about GetUnitFlyHeight but it should work, cant test right now edit: ok ignore the z stuff, im just noob :) |
| 10-27-2009, 10:52 PM | #7 | |
Quote:
d'oh |
| 11-02-2009, 05:44 PM | #8 |
It is kinda annoying that it requires GetLocationZ, but it ends up looking fine afterwards. notice that some people like me generally hate stuff using GetLocationZ since it can cause desyncs but at least in this case, it wouldn't since a lightning effect's z field wouldn't cause those desyncs |
| 11-02-2009, 05:55 PM | #9 |
Yep, some functions can indeed return different values for different players, so you not use those values with stuff that cant be different for each player. Although, GetLocationZ returns pretty much same values for all players if theres no stuff that can change terrain height, for example spells like war stomp. At least I have used GetLocationZ for stuff like jump spells and thingies without desyncin by simply avoiding that kind of terrain deformation stuff. edit. But yea, lightnings position can be different for players, like Vexorian said, so no reason to worry about any war stomps. |
