Warcraft III resources & community, 2003–2006 · archived

Trigger? Plz help me!

10 posts
#1

Trigger? Plz help me!

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 :) :( :o :shock: :? 8) :lol: :x :P
:oops: :cry: :evil: :twisted: :roll: :wink:
:!: :?: :idea: :arrow:

Good Smilies!
#2
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.
#3
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
#4
Los_TacosWell, 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?
#5
hey do this:

Event:
Time - Every 1.00 seconds of game time

Action:
Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Farm) and do (Player - Add 1 to Player 1 (Red) Current gold)
#6
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:

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
#7
I tried to look at a Tree Tag map, but it won't work anyway... Anyone know a good tutorial for this with pictures?
#8
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.



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).
#9
Well, using for loop doesn't use variables, but it can save you a lot of time and I recommend you make an effort to learn it. It's really easy, anyway.
#10
NelthariusThe 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.



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