• 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] Well, another broken Loop

Status
Not open for further replies.
Level 4
Joined
Jul 14, 2012
Messages
100
[Solved] Well, another broken Loop

  • happiness over time
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 102, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (village[(Integer A)] is alive) Equal to True
            • Then - Actions
              • Set villagehappiness[(Integer A)] = (villagehappiness[(Integer A)] + Increase[(Player number of (Owner of village[(Integer A)]))])
            • Else - Actions
              • Do nothing
      • Trigger - Run count civ happiness <gen> (ignoring conditions)
EDIT: YAY! After a couple hours of toying with this I managed to fix it on my own! :D Above is now the functioning trigger.
 
Last edited:
Level 4
Joined
Jul 14, 2012
Messages
100
Why are you picking every player in the loop?

If these villages are units, you can set the happiness using the Player number of (Owner of unit) as reference.

Also, it would help if you also posted the other part of the trigger - where villagehappiness[] is initially set.

Okay i simplified it a lot more but it still only increases 1 village's happiness.

And the problem lies not within setting the village's initial Happiness, that has worked since as long as I can remember and I have not tampered with it. It was only when i tried increasing the Happiness of these villages over time did it not do so :(
 
Status
Not open for further replies.
Top