• 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.

Requesting a trigger please help

Status
Not open for further replies.
Level 2
Joined
Jul 6, 2004
Messages
28
Can Anyone make a trigger witch allows u to get wood from a certen unit but when the unit gets destryoed it dosnt give wood like having a building give u income.. i realy would use anyones help ots a kinda import map to me..
 
not exectly sure if it will work and you will have to modify it for your use.

Create a trigger:

Code:
aa
    Events
        Unit - A unit Finishes construction
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Triggering unit)) Equal to Farm
                (Number of units in (Units of type Farm)) Equal to 1
            Then - Actions
                Set Farm = (Last created unit)
                Trigger - Run trig 1 <gen> (ignoring conditions)
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Farm is dead) Equal to True
                    Then - Actions
                        Trigger - Turn off trig 1 <gen>
                    Else - Actions
                        Do nothing

then create another one and set it so it isnt instantly on.

Code:
trig 1
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Player - Add 100 to (Owner of Farm) Current gold

hope it works... thou I really dont know :roll:
 
Level 9
Joined
Nov 27, 2004
Messages
465
Or you may do this thing:

if building not a neutral, then

every X seconds

set variable Y = 0
Action pick every unit for player 1
loop
if
picked unit-type = A
then
y=y + 1
if
picked unit-type = B
then
y=y+something more
Add y*your number gold for player1
___________

"Add y*your number gold for player1" isn't in a picke every unit action

For making it for many users , just make an array varriable ..i take always integer Y(12)
 
Status
Not open for further replies.
Top