• 🏆 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!

Small trigger bug help...

Status
Not open for further replies.
Level 8
Joined
Jul 9, 2004
Messages
405
Im still working on my farmer and hunter-type map and remember how each sheep gives u 2 gold every 60 seconds? well this is what i tried to do the same thing:

Event: every 30 seconds of game
Action:
1. pick every unit in (sheepfarmgroup) and do create 1 sheep at position of picked unit
2. Add last created unit to (sheeps)

then this was the one that gave u the money:

Event: every 60 seconds of the game
Actions: pick every unit in (sheeps) and do player add (number of units in sheeps) to (owner of picked unit's) current gold

i would figure that to add 1 gold right? NO! it adds 12 for some reason maybe i went wrong somewhere?
 
Level 4
Joined
Jul 28, 2004
Messages
43
hi

I never play to farmer/hunter but i think that its gives to u 12 because u have 12 player, and when u picked sheeps, u pick 'all players sheeps'
I never try it but i think its that:
Event:every 60 sec in game
Condition: Picked unit equal to sheeps
Actions pick every units of 'usuario' and do player...
Usuario=Player Variable
try it
 
Level 2
Joined
Jun 19, 2004
Messages
2
RaD- said:
Im still working on my farmer and hunter-type map and remember how each sheep gives u 2 gold every 60 seconds? well this is what i tried to do the same thing:

Event: every 30 seconds of game
Action:
1. pick every unit in (sheepfarmgroup) and do create 1 sheep at position of picked unit
2. Add last created unit to (sheeps)

then this was the one that gave u the money:

Event: every 60 seconds of the game
Actions: pick every unit in (sheeps) and do player add (number of units in sheeps) to (owner of picked unit's) current gold

i would figure that to add 1 gold right? NO! it adds 12 for some reason maybe i went wrong somewhere?


Why don't you just use this trigger:

Event - Every 60 seconds of the game
Action - Add ((number of sheep owned by player 1)x(2)) gold to (player 1)
Add ((number of sheep owned by player 2)x(2)) gold to (player 2)
Add ((number of sheep owned by player 3)x(2)) gold to (player 3)
Add ((number of sheep owned by player 4)x(2)) gold to (player 4)

And so on....
 
Level 8
Joined
Jul 9, 2004
Messages
405
TTFTCUTS said:
Or even:

Code:
pick every unit in (sheeps) and do player add X to (owner of picked unit's) current gold

That should add X for each sheep to the owning players gold...

thats just what i did
Action: pick every unit in (sheeps) and add (number of units in (sheep)) to owner of picked unit... exactly lol

Edit: ok maybe it wasnt... :/
 
Level 7
Joined
Jul 30, 2004
Messages
451
RaD- said:
Im still working on my farmer and hunter-type map and remember how each sheep gives u 2 gold every 60 seconds? well this is what i tried to do the same thing:

Event: every 30 seconds of game
Action:
1. pick every unit in (sheepfarmgroup) and do create 1 sheep at position of picked unit
2. Add last created unit to (sheeps)

then this was the one that gave u the money:

Event: every 60 seconds of the game
Actions: pick every unit in (sheeps) and do player add (number of units in sheeps) to (owner of picked unit's) current gold

i would figure that to add 1 gold right? NO! it adds 12 for some reason maybe i went wrong somewhere?


ok i'll go over this logically with you
lets look at your last statement

'pick every unit in (sheeps) and do player add (number of units in sheeps) to (owner of picked units) current gold'

now, lets say you have 8 sheeps, 4 owned by player 1, and 4 owned by player 2

warcraft will 'pick' every sheep (you told it to pick all units in (sheeps) ), which means it just picked 8 sheeps, and for each sheep it picked, it will add (number of units in sheeps) gold to the owner of that sheep

- so theres sheep 1, its owned by player 1, and theres 8 units in (sheeps)
- so war3 adds 8 (number of units in sheeps) gold to player 1
- now sheep 2, its owned by player 1, and there are 8 units in (sheeps)
- so war3 adds 8 (number of units in sheeps) gold to player 1
etc...

so player 1 will get 8 x 4 = 32 gold, and player 2 will get 8 x 4 = 32 gold for having 4 sheeps each

= pick every unit in (sheeps) and do player add (1) to (owner of picked unit's) current gold
[gives the value of each sheep 1 gold and will give it to the owner]
 
Status
Not open for further replies.
Top