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

how do i make this trigger

Status
Not open for further replies.
Level 19
Joined
Feb 15, 2008
Messages
2,184
How do i make a trigger that make:

Every 2 second of game makes (Building create 1 unit) If i have built this building. (Leak Free)

example.

I make 1 building then it should create or buy the unit in the building sell or creates. Or just make 1 unit.

Edit: why did it get removed when it was an trigger?
 
Last edited by a moderator:
Level 20
Joined
Jul 14, 2011
Messages
3,213
It's really simple.

Event: Every 2 secs of gametime
Actionns
-> Custom script: set bj_wantDestroyGroup = true
-> Pick Every Unit of type *YourBuildingType* and do actions:
----> Order "Picked Unit" train *The unit you want*

Another way would be

Event: Every 2 secs of gametime
Actions
-> Custom script: set bj_wantDestroyGroup = true
-> Pick Every Unit of type *YourBuildingType* and do actions:
----> Set 'Point' = Position of (Picked Unit)
----> Unit - Create 1 *Your Unit Type* at 'Point'
----> Custom script: call RemoveLocation(udg_Point)
 
Level 8
Joined
Dec 9, 2009
Messages
397
Could do it easier with 2 triggers,

Trigger 1:
  • Construction
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Finished building Equal to (==) Footman house
        • Then - Actions
          • Unit - Order (Triggering unit) to train/upgrade to a Footman
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Finished building Equal to (==) Knights Hold
            • Then - Actions
              • Unit - Order (Triggering unit) to train/upgrade to a Knight
            • Else - Actions
add as many lines as you need for each buliding (best to order training twice so no delay between each, it's the same kind of system Castle Fight uses)

Trigger 2:
  • Training
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to train/upgrade to a (Unit-type of (Trained unit))
 
Status
Not open for further replies.
Top