trgtrangecondjmp 0x3a - <distance> <labelname> - jumps to a block depending on the distance to the target.
Can anyone explain in more detail how the distance parameter is used. If range is over? or under x units? what unit is used? pixels? same as weapons.dat?
I've been trying out different things and nothing seems to have any effect. I am trying to make the zealot use a range attack if its target is a certain distance away but use its normal melee if the target is closer than that distance. This seemed like the logical opcode for what I'm doing. Any ideas? Thnx for your help.
None.
trgtrangecondjmp 0x3a - <distance> <labelname> - jumps to a block depending on the distance to the target.
Can anyone explain in more detail how the distance parameter is used. If range is over? or under x units? what unit is used? pixels? same as weapons.dat?
I've been trying out different things and nothing seems to have any effect. I am trying to make the zealot use a range attack if its target is a certain distance away but use its normal melee if the target is closer than that distance. This seemed like the logical opcode for what I'm doing. Any ideas? Thnx for your help.
The general iscript unit is the pixel. Say you want your zealot to use it's ranged attack when it's 40 pixels away.
I assume you put the ranged attack in the zealot's air attack slot in unit's.dat and also that you can iscript half decently.
trgtrangecondjmp 40 ZealotAirAttkInit
"ZealotAirAttkInit" will be a new header in your zealot's iscript. The 40 is how many pixels away the targeted unit is. Simply plop this opcode at the start of your zealot's GndAttkInit animation and properly script "ZealotAirAttkInit" and you'll have a zealot that will release a salvo of whatever at a bunch of marines. Don't forget to include a AirAttkRpt and AirAttkToIdle animation.
Post has been edited 1 time(s), last time on Mar 27 2008, 3:03 am by FlyingHat.
None.
Well, FlyingHat, wouldnt that just fire the ranged attack whenever the zealot is 40
or less pixels from the target? For me, thats what the opcode does (Lol it would be hard to have a unit exactly 40 pixels away. Plus, 40 pixels is rather short ranged
).
potatoes, I suggest making the zealot use the ranged attack by default and only use the melee attack if the target is close (lets say, 16 pixels). I used this in my mod. If it werent for the SMC, I would show the script to you.
None.
Well, FlyingHat, wouldnt that just fire the ranged attack whenever the zealot is 40
or less pixels from the target? For me, thats what the opcode does (Lol it would be hard to have a unit exactly 40 pixels away. Plus, 40 pixels is rather short ranged
).
You're saying the zealot is using it's ranged attack at 40 pixels or less.... THAT MEANS IT'S WORKING PERFECTLY.
None.