I'm trying to make a tag game where players pick between several runners. Each runner has its own corresponding tagger unit. And I want to make a trigger so when the tagger kills a runner unit the tagger becomes a runner and the runner becomes a tagger and they each switch between there corresponding tagger/runner units.
Detecting a tag?
Changing a unit between runner / tagger?
Keeping track of who's what and to who?
etc.
etc.
I get the feeling that all of the things needed for such a map are pretty basic, but I don't really feel like building all the triggers for you. Tell us exactly what you are having problems with, and perhaps paste the trigger you can't get to work.
Ok, I've skimmed through the triggers... I'll look more later but I don't think you can replace a killed unit.. you have to create a new one. Also, i would merge the two for loops. You should always be switching both the killer and killed unit... or nothing. The break isn't really needed either since theres no risk of the killed unit being both an scv and a drone for example.
...later...
You should use "replaced unit" instead of "created unit" when you select a replaced unit. I shrunk the unit type array and defined the rest of the numbers to get rid of the error messages.
<kinda useless rant>
The problem seemed to be your conditions, which confused me. I tested several different things.. converted the unit types to strings and displayed them.. changed the unit type variables to plain marine and scv.. It should work. Guess what broke your code? The friggin' 0.2 wait (and I placed most of my testing code before the wait, which is why it looked correct). Apparently that short wait messed up the triggering unit "variable".
</kinda useless rant>
What I found out after messing around is that the unit that died is cleared as soon as you "wait" and any variables that pointed to it break ("replace unit" breaks when you wait, so if you do keep the wait, you have to change to create unit, like I did). Basically, if you store any information you want from the unit that dies immediately (before you wait), you'll be fine.
I don't know but that would depend on what resolution the players have... so I'd assume SC2 rescales images to fit. There are probably recommended sizes though, maybe even different ones for wide screen etc.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to make a tag game where players pick between several runners. Each runner has its own corresponding tagger unit. And I want to make a trigger so when the tagger kills a runner unit the tagger becomes a runner and the runner becomes a tagger and they each switch between there corresponding tagger/runner units.
Can someone help me do this?
@Shendoo2: Go
umm if your using triggers the simple way would be to set the custom value on the units for example
if (custom value 0) of unit = 1 then the unit is a runner If the custom value 0 of unit = 0 then hes a tagger
What exactly is the problem?
Detecting a tag?
Changing a unit between runner / tagger?
Keeping track of who's what and to who?
etc.
etc.
I get the feeling that all of the things needed for such a map are pretty basic, but I don't really feel like building all the triggers for you. Tell us exactly what you are having problems with, and perhaps paste the trigger you can't get to work.
Ill just post the map.
I want it so when the Marine kills the SCV he becomes a SCV and the SCV becomes the marine. And when they Marine kills the probe nothing happens.
Ok, I've skimmed through the triggers... I'll look more later but I don't think you can replace a killed unit.. you have to create a new one. Also, i would merge the two for loops. You should always be switching both the killer and killed unit... or nothing. The break isn't really needed either since theres no risk of the killed unit being both an scv and a drone for example.
...later...
You should use "replaced unit" instead of "created unit" when you select a replaced unit. I shrunk the unit type array and defined the rest of the numbers to get rid of the error messages.
<kinda useless rant>
The problem seemed to be your conditions, which confused me. I tested several different things.. converted the unit types to strings and displayed them.. changed the unit type variables to plain marine and scv.. It should work. Guess what broke your code? The friggin' 0.2 wait (and I placed most of my testing code before the wait, which is why it looked correct). Apparently that short wait messed up the triggering unit "variable".
</kinda useless rant>
What I found out after messing around is that the unit that died is cleared as soon as you "wait" and any variables that pointed to it break ("replace unit" breaks when you wait, so if you do keep the wait, you have to change to create unit, like I did). Basically, if you store any information you want from the unit that dies immediately (before you wait), you'll be fine.
Wow, thanks alot man. I was trying to combined it like you did... but well I epic failed. lol
Thanks a lot for the time you spent figuring out/ doing it. I'll give you credits where credits are due!
EDITT:
Kinda off topic, but does anyone know what size you need to make a custom map icon? and the size you should make a custom loading screen?
I don't know but that would depend on what resolution the players have... so I'd assume SC2 rescales images to fit. There are probably recommended sizes though, maybe even different ones for wide screen etc.