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.
[04:37 am]
Ultraviolet -- 80% of statistics are made up on the spot
[08:05 pm]
Symmetry -- 50% of strings in starcraft are references
[2026-6-07. : 1:59 am]
RIVE -- Lots of fun little nods to different works of others in the cheats too.
[2026-6-06. : 5:17 pm]
Oh_Man -- so i was today years old wen i learned rebel yell starcraft mission is named after a billy idol song. makes me wonder wat other missions are named after songs
[2026-6-04. : 3:42 am]
RIVE -- Hellooooo, Nurse
[2026-6-03. : 4:19 pm]
NudeRaider -- Hello World!
[2026-6-01. : 4:03 pm]
IskatuMesk -- no Hello World? No Hello . jpeg? Not even ddosing some government website? smh my head
[2026-5-31. : 10:02 pm]
Symmetry -- I was really just figuring out how to compile
[2026-5-31. : 10:02 pm]
Symmetry -- I didn't make it do anything
[2026-5-31. : 9:17 pm]
Ultraviolet -- hell yeah. did you have trouble making the button functional, or just haven't gotten there yet?
Please log in to shout.


Members Online: RIVE, AnthonyRichards