Well lets say, I want to create a trigger that makes " when the base is killed, everything owned by the owner of the base will be exploded and respawn randomly on the map. " ( this include Hero, but he will be revived at his base after 2 seconds. )
First I declare variables used for randoming the place for the bases.
then I start making a trigger that will randomly create the base in these regions when a player select a Hero.
( This is just the trigger for the race " Beast Nation " in my map, just leeting you guys know why it has to be named " Beast Nation " )
OK. Now I have create the base, then I made a trigger that makes the base respawn randomly on the map when it gets destroyed.
RebornPlace is a variable i use to store the respawning base. It is a unit type variable.
hrc is a string type variable that used to store " yes " and " non "
when it comes to " yes " that means the base is destroyed.
Then finally, I made a trigger that revive the hero of the owner of the base at his base after 2 seconds.
The reason i made hrc = yes in the last trigger is to make this trigger take effect. If the base is destroyed (hrc = yes) the hero will be revived, but if the hero just die by himself and the base is still alive, hero wouldn't be revived. After reviving the hero when the base is respawned, I set hrc to non from preventing the hero to get revived if he die by himself.
THE BUG is that sometimes the Hero will be revived at the other player's base. I don't know what I did wrong in these trigger.... I f anyone would help me correct it, That will be greatful.
Thank you very much for paying attention. Looking forward for correction...