if/then/else (trigger)

MissKerrigan

Active Member
Reaction score
23
Hello,

I REALLY have no idea what's wrong with this trigger:

event: unit dies
condition: owner of unit is player 9 (computer)
actions:

if: unit has behavior boss (true)
then: modify player (killing player) add 25 minerals
else: modify player (killing player) add 5 minerals


So when I'm killing normal units I'm NOT getting any minerals, and ALSO not any text tag appears
I am SURE the bosses having a behavior boss on them and the normal units haven't
When I kill a boss, I get my 25 minerals and the text tag appears, this works

Can anyone please tell me what's going on here?

Marloes


(this trigger should very well am I right?)
 

X-maul

AKA: Demtrod
Reaction score
201
When a unit dies, it will no longer have the behavior. So it wont check as if the unit had the behavior. I would make the boss unit a hero unit (Check the hero flag) and make the condition check if the unit is a hero, instead.
 

MissKerrigan

Active Member
Reaction score
23
It's not working but fortunetaly I found some solution:

- I created a global variable of the type unit and called it boss
- as soon a boss comes, I store it in the variable
- now I just make an event that if the 'boss' dies, I get my 25 minerals and text tag +25 minerals

I don't know why, but it works now
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top