• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Problem wiht real variables

Status
Not open for further replies.
Level 20
Joined
Oct 21, 2006
Messages
3,231
  • 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