Which of my triggers is not working?

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
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
What do you mean when you say it's not working? What is happening right now?

What is the unit group "ghosts" for? Is it the life ghosts in 3x3 square or is it the ghosts that the players control?
 

MissKerrigan

Active Member
Reaction score
23
unit group 'ghosts': this are the playing units (1,2,3 and 4)
unit group 'lifes': this are the lifes in the 3x3 square

I forgot something!

when a ghost is created for a player, the ghost moves in the unit group 'ghosts'
so if this number = 0 (depending on howmany players) then the trigger should be run

if play with 2 players, the unit group 'ghosts' = 2 am I right?

I tested it alone since I haven't uploaded the map yet

- So when I start my map, the number of units in 'ghosts' = 1
- When my ghost dies, nothing happens

What should happen?

- 1 of the lifes must disappear (depending on howmuch lifes there are which one will be taken)
- after 5 game seconds you should get a new one to continue the level
- in the meantime of the 5 seconds a message with 'get ready' should appear and the camera should pan for the player

(I left the text message + pan camera away because it would be to much)
 

X-maul

AKA: Demtrod
Reaction score
201
I cant get an overview of the trigger when it stands like that. Please start posting your triggers in [CODE.] tags [CODE/.] (remove the . and insert your triggers between the two tags).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top