• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Problem wiht real variables

Status
Not open for further replies.
Level 20
Joined
Oct 21, 2006
Messages
3,230
  • Set Players = (Real((Number of players in (All players controlled by a User player))))
  • Decrease
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Not equal to Player 12 (Brown)
      • ((Dying unit) is Mechanical) Not equal to True
    • Actions
      • Set Players = (Players - 1.00)
  • Lose
    • Events
      • Game - Players becomes Less than or equal to 0.00
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (You survived for + (String((Elapsed time for GameTime))))
      • Trigger - Turn off Zombie Spawn <gen>
      • Trigger - Turn off Zombie Spawn Corpse <gen>
      • Trigger - Turn off Mutant Spawn <gen>
      • Trigger - Turn off Gargoyle Spawn <gen>
      • Wait 10.00 seconds
      • Trigger - Run Start <gen> (checking conditions)
Lose trigger doesn't trigger for some reason.
 
Level 6
Joined
Jul 25, 2005
Messages
221
First of all, I would suggest using integers instead of reals, since all you're doing is counting the amount of players, and since you can't have 1.5 players playing you can just as well use integers.

Second, put the conditions in trigger "Decrease" in an "And" field so that they both must be true to do the actions given.
  • Conditions
    • ((Owner of (Dying Unit)) Not equal to Player 12 (Brown)) and ((Dying unit) is Mechanical) Not equal to True
Third, make absolutely sure your unit you're testing doesn't have the "Mechanical" in its classification, because that could be your problem.
 
Level 6
Joined
Jul 25, 2005
Messages
221
Using JASS you can use Reals as Integers and vice versa, it should be the same in this case, should it not?
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Using JASS you can use Reals as Integers and vice versa, it should be the same in this case, should it not?
I doubt it would work in events, for obvious reasons.

Either way, it doesn't really matter since that would be pointless anyways.

Yes, there are conversion functions. Your triggers up there are quite scrambled, why don't you post them as a picture or rewrite them correctly?
Why would you ever bother posting them as a picture? It's time-consuming, and is more annoying to read.
 
Status
Not open for further replies.
Top