• 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] Help

Status
Not open for further replies.
Level 14
Joined
Oct 27, 2007
Messages
1,395
I have a question concerning variables/conditions.
I'm working on a trigger that gives food to a player when a specific variable reaches a certain number. But when I do it in the trigger it doesn't work. And then when I take the variable out of the condition it works.
(I'm not really sure how to trigger wrap.. i'm rather new at this)
This is what I have:
  • Demon Selector Food
    • Events
      • Player - Player 1 (Red) types a chat message containing Upgrade1 as An exact match
    • Conditions
      • Income[(Integer A)] Equal to 18000
    • Actions
      • Player - Add 2 to Player 1 (Red) Food cap
 
Last edited:
Level 14
Joined
Oct 27, 2007
Messages
1,395
well, it eventually becomes 18000, it starts at 0.
and yeah it's an integer.. I'll try it as a real

EDIT: Thanks, it works now as a real variable..
kinda odd it didn't work as an integer.
 
Last edited:
Level 9
Joined
May 27, 2006
Messages
498
Wut? Integer A in the trigger condition?! This will never work. Integer A can be used only inside
  • For each (Integer A) from <number> to <number> do actions:
else the game won't know what the integer A is.

By the way, check this tutorial (explains about arrays)
 
Level 14
Joined
Oct 27, 2007
Messages
1,395
Thanks, I didn't see that tutorial.
I changed it back to real. Couldn't customize it for each player w/ real.
I'm going to keep trying.
 
Level 9
Joined
May 27, 2006
Messages
498
I'm guessing you want to check if income of message-typing player equals to 18000 and then give him +2 to food cap. You could do it this way:
  • Blah
    • Events:
      • Player - Player 1 (Red) types a chat message containing Upgrade1 as An exact match
      • Player - Player 2 (Blue) types a chat message containing Upgrade1 as An exact match
      • Player - Player 3 (Teal) types a chat message containing Upgrade1 as An exact match
      • etc etc... for all players in your game
    • Conditions:
      • Income(Player number of (Triggering player)) Equal to 18000
    • Actions:
      • Player - Add 2 to (Triggering player) Food cap
And no, you dont have to change to real. Integer variable will work.
 
Level 14
Joined
Oct 27, 2007
Messages
1,395
thanks!
Yeah I was trying something like that, I just couldn't get it right.
I'll try it like that now.
Thanks for the help, I'm really new at triggers and such, but learning quickly :)

EDIT: OK thank you so very much! It works.

+rep for you!
 
Status
Not open for further replies.
Top