just like i said in my first post. when a hero dies, i need it to pick a hero whos in 'tagged 1' move the person in 'tagged 2' to 'tagged 1', and if its any of their first lives, creates the hero for their second life. 2 teams, 3 players per team
Hmmm, again this is a specific kind of question for a specific functionality. I may have done something similar, in that i have build code for a player to jump in and use a mech during my map. When the player gets near, it transfers functionality to the mech as if the player had gone in, moves the hero to a group called MECH, moves the mech unit to the hero group, and teleports him to my pineapple (Object out of view from the playable map). The part that may help, is how i juggled the players hero, and the mech between 2 diffrent unit groups. That way, if the mech reaches 0 HP, the mech blows up, the player dies, a trigger check occurs that shows that A the player in hero 1 group died (mech), but HEY, there is a unit in mech 1, so it moves the hero unit from group mech 1 to group hero 1 (original configuration), and teleports the hero to the site where the mech bit the dust.
If this seems like something you could use, just let me know, if not, no worries.
I don't really understand the code, but seems that is repetitive with a Triggering Unit and a Create Unit, and you do 3 comparison for each. You can always do a bucle. I hope this helps even if I don't get the grasp of the code.
Create an array (type of unit) with the Triggering Unit in position 0, and the Create Unit in position 1, for example.
So when a Hero he dies he is reincarnated, switching between two forms each time he does so?
How about you define a set of variables for each player? E.g One integer array called "hero" and a second called "form_state"
Event - Unit dies
Conditions - Unit belongs to group "hero_group"
Local variables - "id"
Actions - For each integer 1 to 3 (increasing in steps of 1)
If (triggering unit = "hero", Index "id") AND ("form_state", Index "id" = 1)
Then - Create unit at point, type "hero_form_2"
Else - Create unit at point, type "hero_form_1"
Please excuse my pseudo-code :) Am I barking up the right tree? :P
the problem with that is, the units can die in any order. and if the teams arnt 3v3, it will break the cycle (since they will always spawn in 002, but they get put in the arena only if they are in 001.
would it just be easier to make a check every second for a unit in region, and if the region is empty to move the unit?
i didnt want to do taht because i think it would bug
Unfortunately, I was still unsure as to what you're after, so I just made the triggers replicate exactly what was happening in the test map. I might take another look at it later.
Just a tip but don't try to fit everything into one big giant trigger. You can often achieve these types of things easier with multiple triggers fired in a linear fashion.
Your code you posted there from first glance of what you wanted to do you just want to save a unit as a variable ...... shouldnt require that much code .... me thinks it should only take about 2 lines of code...
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Instead of having it check each tagged region each time, but a if statement above that entire lump, and use a switch statement for each triggering unit
-=Edited=-
@torrasqu: Go
You can't code, and much less understand code, without understanding the general purpose of the code.
What exactly is it that you need?
@Kafoso: Go
just like i said in my first post. when a hero dies, i need it to pick a hero whos in 'tagged 1' move the person in 'tagged 2' to 'tagged 1', and if its any of their first lives, creates the hero for their second life. 2 teams, 3 players per team
@torrasqu: Go
Hmmm, again this is a specific kind of question for a specific functionality. I may have done something similar, in that i have build code for a player to jump in and use a mech during my map. When the player gets near, it transfers functionality to the mech as if the player had gone in, moves the hero to a group called MECH, moves the mech unit to the hero group, and teleports him to my pineapple (Object out of view from the playable map). The part that may help, is how i juggled the players hero, and the mech between 2 diffrent unit groups. That way, if the mech reaches 0 HP, the mech blows up, the player dies, a trigger check occurs that shows that A the player in hero 1 group died (mech), but HEY, there is a unit in mech 1, so it moves the hero unit from group mech 1 to group hero 1 (original configuration), and teleports the hero to the site where the mech bit the dust.
If this seems like something you could use, just let me know, if not, no worries.
@coronbale: Go
BTW, my post was assuming you were meaning tagged 1 and 2 to be unit groups.
@coronbale: Go
nope, regions. tagging as in you tag someone else 'in' and you go out
@torrasqu: Go
I don't really understand the code, but seems that is repetitive with a Triggering Unit and a Create Unit, and you do 3 comparison for each. You can always do a bucle. I hope this helps even if I don't get the grasp of the code.
Create an array (type of unit) with the Triggering Unit in position 0, and the Create Unit in position 1, for example.
Your_Array[0][0]=Marine
Your_Array[0][1]=Ghost
Your_Array[1][0]=Firebat
Your_Array[1][1]=Devil Dog ... ...
Then use a While and do all the comparisons.
While Counter <=Max_Number_of_Different_Units
(Triggering unit) == Your_Array[Counter][0]
blahblahblah*your comparions here*
Create Your_Array[Counter][1]
Counter +1
So when a Hero he dies he is reincarnated, switching between two forms each time he does so?
How about you define a set of variables for each player? E.g One integer array called "hero" and a second called "form_state"
Event - Unit dies Conditions - Unit belongs to group "hero_group" Local variables - "id" Actions - For each integer 1 to 3 (increasing in steps of 1) If (triggering unit = "hero", Index "id") AND ("form_state", Index "id" = 1) Then - Create unit at point, type "hero_form_2" Else - Create unit at point, type "hero_form_1"
Please excuse my pseudo-code :) Am I barking up the right tree? :P
here is a copy of the trigger. just use the archon to kill the units to see how it works
Ok, try this. This what you after?
the problem with that is, the units can die in any order. and if the teams arnt 3v3, it will break the cycle (since they will always spawn in 002, but they get put in the arena only if they are in 001.
would it just be easier to make a check every second for a unit in region, and if the region is empty to move the unit?
i didnt want to do taht because i think it would bug
Unfortunately, I was still unsure as to what you're after, so I just made the triggers replicate exactly what was happening in the test map. I might take another look at it later.
@ChromiumBoy: Go
Just a tip but don't try to fit everything into one big giant trigger. You can often achieve these types of things easier with multiple triggers fired in a linear fashion.
@ST4RKiLL3R: Go
Thanks Star :) I'm actually working on a map atm and finding that my triggers are becoming a bit convoluted, so I'll give it a try.
Your code you posted there from first glance of what you wanted to do you just want to save a unit as a variable ...... shouldnt require that much code .... me thinks it should only take about 2 lines of code...
Instead of having it check each tagged region each time, but a if statement above that entire lump, and use a switch statement for each triggering unit
@Feldeat: Go
can you give me an example? i havnt used switch statements yet