Staredit Network > Forums > Modding Assistance > Topic: Iscript opcode help
Iscript opcode help
Mar 27 2008, 2:16 am
By: coolpotatoes  

Mar 27 2008, 2:16 am coolpotatoes Post #1



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.

Mar 27 2008, 2:57 am FlyingHat Post #2



Quote from coolpotatoes
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.
example
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.

Apr 1 2008, 1:19 am modmaster50 Post #3



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 :bleh: ).

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.

Apr 1 2008, 1:58 am FlyingHat Post #4



Quote from modmaster50
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 :bleh: ).
You're saying the zealot is using it's ranged attack at 40 pixels or less.... THAT MEANS IT'S WORKING PERFECTLY.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
Please log in to shout.


Members Online: NudeRaider, Roy