MissKerrigan
Active Member
- Reaction score
- 23
Hello this is a long one so I hope people don't get confused by reading it
At first you must know when my map starts there is a 3x3 squared field in the middle of the map, this contains 9 squares of 1x1. At the upper 3 squares there are 3 ghosts, this means you got 3 lifes. The simply rule I made is when you lose a life as team, 1 ghost will be taken from the ghosts.
I also made some possibilities to gain lifes by points or finding 'lifes'. Here counts the simple rule, once 1 life is found or enough points are earned to gain a life, 1 ghost will be added to the lifes. All lifes will be added into the unit group 'lifes'. So I put 3 trigger-actions in the map initialization trigger which adds the 3 ghosts to the unit group 'lifes'
note: maybe you did not know this yet, but 9 lifes can be owned maximum!
Now I made the next things:
Trigger 1
event unit dies
condition 1 unit type of unit is 'ghost'
condition 2 number of unit in 'ghost' == 0
(I made condition 2 because a life will only been taken if all ghosts are dead)
action 1 wait 5.0 game seconds
action 2 if/then/else
if number of units in 'lifes' >0
then if/then/else
if status of player 1 = playing
then 1 create 1 ghost for player 1 at 'start player 1'
then 2 set 'ghost player 1' is last created unit
then 3 attach region 'follow player 1' to last created unit
else
if status of player 2 = playing
then 1 create 1 ghost for player 2 at 'start player 2'
then 2 set 'ghost player 2' is last created unit
then 3 attach region 'follow player 2' to last created unit
else
if status of player 3 = playing
then 1 create 1 ghost for player 3 at 'start player 3'
then 2 set 'ghost player 3' is last created unit
then 3 attach region 'follow player 3' to last created unit
else
if status of player 4 = playing
then 1 create 1 ghost for player 4 at 'start player 4'
then 2 set 'ghost player 4' is last created unit
then 3 attach region 'follow player 4' to last created unit
else
Trigger 2
event unit dies
condition 1 unit type of unit is 'ghost'
condition 2 number of unit in 'ghost' == 0
action if/then/else
if number of units in 'lifes' == 9
then remove 'life 9' from the game
else
if number of units in 'lifes' == 8
then remove 'life 8' from the game
else
if number of units in 'lifes' == 7
then remove 'life 7' from the game
else
if number of units in 'lifes' == 6
then remove 'life 6' from the game
else
if number of units in 'lifes' == 5
then remove 'life 5' from the game
else
if number of units in 'lifes' == 4
then remove 'life 4' from the game
else
if number of units in 'lifes' == 3
then remove 'life 3' from the game
else
if number of units in 'lifes' == 2
then remove 'life 2' from the game
else
if number of units in 'lifes' == 1
then remove 'life 1' from the game
else
if number of units in 'lifes' == 0
then run trigger 'game over'
else
Trigger 3
event any unit uses effect 'extra life!'
condition 1
action if/then/else
if number of units in 'lifes' == 0
then 1 create 1 'life' in center of region 'life 1' for player 0 (neutral player)
then 2 set variable 'life 1' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 1
then 1 create 1 'life' in center of region 'life 2' for player 0 (neutral player)
then 2 set variable 'life 2' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 2
then 1 create 1 'life' in center of region 'life 3' for player 0 (neutral player)
then 2 set variable 'life 3' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 3
then 1 create 1 'life' in center of region 'life 4' for player 0 (neutral player)
then 2 set variable 'life 4' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 4
then 1 create 1 'life' in center of region 'life 5' for player 0 (neutral player)
then 2 set variable 'life 5' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 5
then 1 create 1 'life' in center of region 'life 6' for player 0 (neutral player)
then 2 set variable 'life 6' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 6
then 1 create 1 'life' in center of region 'life 7' for player 0 (neutral player)
then 2 set variable 'life 7' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 7
then 1 create 1 'life' in center of region 'life 8' for player 0 (neutral player)
then 2 set variable 'life 8' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 8
then 1 create 1 'life' in center of region 'life 9' for player 0 (neutral player)
then 2 set variable 'life 9' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 9
then 1 add 1000 score for 'triggering effect unit (target)
then 2 create a text tag with the text '1000' at position of triggering effected unit (target)
then 3 set the velocity of text tag....
then 4 set the color of text tag...
In my opinion this should works all fine
But for some reason when you lose a life, you are NOT getting a new one
Does somebody knows what's going on and in which trigger?
Marloes
At first you must know when my map starts there is a 3x3 squared field in the middle of the map, this contains 9 squares of 1x1. At the upper 3 squares there are 3 ghosts, this means you got 3 lifes. The simply rule I made is when you lose a life as team, 1 ghost will be taken from the ghosts.
I also made some possibilities to gain lifes by points or finding 'lifes'. Here counts the simple rule, once 1 life is found or enough points are earned to gain a life, 1 ghost will be added to the lifes. All lifes will be added into the unit group 'lifes'. So I put 3 trigger-actions in the map initialization trigger which adds the 3 ghosts to the unit group 'lifes'
note: maybe you did not know this yet, but 9 lifes can be owned maximum!
Now I made the next things:
Trigger 1
event unit dies
condition 1 unit type of unit is 'ghost'
condition 2 number of unit in 'ghost' == 0
(I made condition 2 because a life will only been taken if all ghosts are dead)
action 1 wait 5.0 game seconds
action 2 if/then/else
if number of units in 'lifes' >0
then if/then/else
if status of player 1 = playing
then 1 create 1 ghost for player 1 at 'start player 1'
then 2 set 'ghost player 1' is last created unit
then 3 attach region 'follow player 1' to last created unit
else
if status of player 2 = playing
then 1 create 1 ghost for player 2 at 'start player 2'
then 2 set 'ghost player 2' is last created unit
then 3 attach region 'follow player 2' to last created unit
else
if status of player 3 = playing
then 1 create 1 ghost for player 3 at 'start player 3'
then 2 set 'ghost player 3' is last created unit
then 3 attach region 'follow player 3' to last created unit
else
if status of player 4 = playing
then 1 create 1 ghost for player 4 at 'start player 4'
then 2 set 'ghost player 4' is last created unit
then 3 attach region 'follow player 4' to last created unit
else
Trigger 2
event unit dies
condition 1 unit type of unit is 'ghost'
condition 2 number of unit in 'ghost' == 0
action if/then/else
if number of units in 'lifes' == 9
then remove 'life 9' from the game
else
if number of units in 'lifes' == 8
then remove 'life 8' from the game
else
if number of units in 'lifes' == 7
then remove 'life 7' from the game
else
if number of units in 'lifes' == 6
then remove 'life 6' from the game
else
if number of units in 'lifes' == 5
then remove 'life 5' from the game
else
if number of units in 'lifes' == 4
then remove 'life 4' from the game
else
if number of units in 'lifes' == 3
then remove 'life 3' from the game
else
if number of units in 'lifes' == 2
then remove 'life 2' from the game
else
if number of units in 'lifes' == 1
then remove 'life 1' from the game
else
if number of units in 'lifes' == 0
then run trigger 'game over'
else
Trigger 3
event any unit uses effect 'extra life!'
condition 1
action if/then/else
if number of units in 'lifes' == 0
then 1 create 1 'life' in center of region 'life 1' for player 0 (neutral player)
then 2 set variable 'life 1' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 1
then 1 create 1 'life' in center of region 'life 2' for player 0 (neutral player)
then 2 set variable 'life 2' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 2
then 1 create 1 'life' in center of region 'life 3' for player 0 (neutral player)
then 2 set variable 'life 3' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 3
then 1 create 1 'life' in center of region 'life 4' for player 0 (neutral player)
then 2 set variable 'life 4' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 4
then 1 create 1 'life' in center of region 'life 5' for player 0 (neutral player)
then 2 set variable 'life 5' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 5
then 1 create 1 'life' in center of region 'life 6' for player 0 (neutral player)
then 2 set variable 'life 6' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 6
then 1 create 1 'life' in center of region 'life 7' for player 0 (neutral player)
then 2 set variable 'life 7' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 7
then 1 create 1 'life' in center of region 'life 8' for player 0 (neutral player)
then 2 set variable 'life 8' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 8
then 1 create 1 'life' in center of region 'life 9' for player 0 (neutral player)
then 2 set variable 'life 9' is last created unit
then 3 add last created to unit group 'lifes'
if number of units in 'lifes' == 9
then 1 add 1000 score for 'triggering effect unit (target)
then 2 create a text tag with the text '1000' at position of triggering effected unit (target)
then 3 set the velocity of text tag....
then 4 set the color of text tag...
In my opinion this should works all fine
But for some reason when you lose a life, you are NOT getting a new one
Does somebody knows what's going on and in which trigger?
Marloes