• 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? Plz help me!

Status
Not open for further replies.
Level 1
Joined
Aug 19, 2005
Messages
4
Hi!

I'm kind of new to this forum and I need help with a big thing on my map atm. You are a guy that can plant bushes and I want you too get more money, if you got more bushes. like in:

Hunters vs Farmers(houses)
Village Builder(villagers)

So I need help to create something that checks how many bushes I have and then give me they right value of money. You get 2 gold form one bush, so if I got 2 bushes then I should get 4 gold after 10 seconds.


Is this a hard question?

:D :) :( :eek: :shock: :? 8) :lol: :x :p
:oops: :cry: :evil: :twisted: :roll: :wink:
:!: :?: :idea: :arrow:

Good Smilies!
 
Level 22
Joined
Jan 10, 2005
Messages
3,426
There may be an esier way but I think it must be like this:
Events: time - every 10 sec of the game
COnditions: -
Actions:if number of units of type: 'the plant'owned by player X equal to (1,2,3.........100) then do: player - add (2,4,6........200) gold to player X.
 
Level 7
Joined
Aug 5, 2005
Messages
218
Well, if you don't want to make 100 actions, just say:
For each integer A from 1 to (however many players there are), do Player - add ((number of units owned by player (integer A) of type (Bush)) X (2)) to (Player (integerA)) gold
 
Level 1
Joined
Aug 19, 2005
Messages
4
Los_Tacos said:
Well, if you don't want to make 100 actions, just say:
For each integer A from 1 to (however many players there are), do Player - add ((number of units owned by player (integer A) of type (Bush)) X (2)) to (Player (integerA)) gold

I'm not a pro...... I can try but I dont understand this integer thing..




I'm stupid?
 
Level 6
Joined
Aug 29, 2004
Messages
159
This is the best way to do it:

For each integer A from 1 to (however many players there are), do Player - add ((number of units owned by player (integer A) of type (Bush)) X (2)) to (Player (integerA)) gold

Los_Tacos

the command "For Each Integer A from 1 to 12" is a looping function. It sets the value of Integer A to 1, and then runs the loop, inserting 1 wherever you have "Integer A". Then once the loop is finished, it goes back and instead of using 1 as integer A it uses 2. And then it repeats it for 3, 4, 5, up to 12. (12 is just an example as its the number of players you're likely to have).
So for this function, when it gets to 5 it will read:
Code:
add ((number of units owned by player (5) of type (Bush)) X (2)) to (Player (5)) gold

Understand now?
this function has got to be THE most useful one for triggerers... well, equal to the IF/THEN/ELSE function anyway...

=][= Bort
 
Level 1
Joined
Aug 19, 2005
Messages
4
I tried to look at a Tree Tag map, but it won't work anyway... Anyone know a good tutorial for this with pictures?
 
Level 3
Joined
Aug 18, 2005
Messages
45
The easiest way is really a long one... It sets the gold property of every player to +2 for every plant or farm at a periodic time, but it's really annoying to make and is just a wasting of time.

Code:
Events -
   Every (10) seconds of game time

Conditions -
   *

Actions -
   Set (Player's) gold to (current gold of player's) + ((number of units of type (Plant) the player possesses) X 2).

Repeat for each player.

But the others' solutions are much faster and at least you won't get lost in tons of variables and actions. If you really need help understanding all this, I saw useful tutorials under WC III Campaigns's Tutorial Forum (from the home page, go to Forums, then Tutorials page).
 
Level 1
Joined
Aug 19, 2005
Messages
4
Neltharius said:
The easiest way is really a long one... It sets the gold property of every player to +2 for every plant or farm at a periodic time, but it's really annoying to make and is just a wasting of time.

Code:
Events -
   Every (10) seconds of game time

Conditions -
   *

Actions -
   Set (Player's) gold to (current gold of player's) + ((number of units of type (Plant) the player possesses) X 2).

Repeat for each player.

But the others' solutions are much faster and at least you won't get lost in tons of variables and actions. If you really need help understanding all this, I saw useful tutorials under WC III Campaigns's Tutorial Forum (from the home page, go to Forums, then Tutorials page).

I understood it anyway. It is good for the moment... thx all for your will to help
 
Status
Not open for further replies.
Top