Staredit Newtork
Community
StarCraft
Games
Site
Favourites
Iscript opcode help, trgtrangecondjmp 0x3a
Creator: coolpotatoes
Time: Mar 27 2008, 2:16 am
 coolpotatoes Mar 27 2008, 2:16 am Post #1
[Avatar]
 M
 -142
 K
 3
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.
(top)
 FlyingHat Mar 27 2008, 2:57 am Post #2
[Avatar]
 M
 10
 K
 43
Quote from coolpotatoestrgtrangecondjmp 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.
This post was edited 1 time, last edit by FlyingHat: Mar 27 2008, 3:03 am.
(top)
 modmaster50 Apr 1 2008, 1:19 am Post #3
[Avatar]
 M
 53
 K
 1
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.
 FlyingHat Apr 1 2008, 1:58 am Post #4
[Avatar]
 M
 10
 K
 43
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.
(top)
Users reading this topic: (plus 1 guests)


[02:43 pm]
Killer_Kow[MM] -- You're doing it wrong, then.
[02:40 pm]
Brontobyte -- I have the correct version, I have the game running, ect...
[02:40 pm]
Brontobyte -- Clokr_ The PP isn't displaying the text that was typed during the game. :-(
[02:15 pm]
chuiu -- vote moose party
[02:05 pm]
Greo -- Macs aren't invunerable. Hell, they're much easier to make viruses for because of how simple the OS is.
[08:28 am]
Oo.LoveLess.oO -- Fatal, I agree. I need to show this up-stuck Mac users that they aren't invulnerable...
Login to shout

©2003-2008 Staredit Network.
Starcraft & Starcraft II are trademarks of Blizzard Entertainment.
Site Index   |   Terms of Service   |   Privacy Policy   |   Contributions