• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] I need help with this

Status
Not open for further replies.
Level 4
Joined
Jan 6, 2009
Messages
100
So, i've got a map going. It's entirely experimental, it's me messing with the Time - Periodical event among other things.

So, the thing i'm confused about is I have a research (that doesn't actually do anything) that says it will spawn more units. Below is the code.

  • Spawn
    • Events:
      • Time - Every 9.00 seconds of game time
    • Conditions:
      • None
    • Actions:
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions:
          • (Researched tech-type) Equal to Recruitment
        • Then - Actions
          • Unit - Create 4 Orc Grunts for Player 1 (Red) at (Center of Start <gen>) facing (Center of Tele 1 <gen>)
        • Else - Actions
          • Unit - Create 3 Orc Grunts for Player 1 (Red) at (Center of Start <gen>) facing (Center of Tele 1 <gen>)
Can someone explain to me why this won't work?
If you want the map or more info, don't hesitate to ask.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
It's
(Researched tech-type) Equal to Recruitment
that makes it bug.

You need to have something about researching in your event. Begins/finishes/cancels research to use that condition.

It works the same way in all cases. All event response thingies look for...things from the event of the trigger.

Are you trying to spawn those units every 9 seconds if you have researched that tech type?
 
Level 4
Joined
Jan 6, 2009
Messages
100
No, what it does is spawns 3 units every 9 seconds. What it should do is spawn 4 units every 9 seconds when you research the upgrade. I'm not too sure how to do that though.
 
Level 9
Joined
Nov 28, 2008
Messages
704
You are doing it inefficiently. What you want to do is have two triggers. One of them will detect a research finished. If this research is your unit spawning type (condition) then turn on the periodic trigger, which is OFF by default. This periodic then will spawn your units :D.
 
Level 3
Joined
Dec 6, 2005
Messages
67
i'm no expert at trigger making but personally i'd set a variable for the number of spawned creeps

Trigger1
  • Events
    • Unit - A unit Finishes research
  • Conditions
    • (Researched tech-type) Equal to Recruitment
  • Actions
    • Set spawn_count = 4
Trigger2
  • Events
    • Time - Every 9.00 seconds of game time
  • Conditions
  • Actions
    • Unit - Create spawn_count Orc Grunts for Player 1 (Red) at (Center of Start <gen>) facing (Center of Tele 1 <gen>)
Otherwise if you really want to stick with your method, use this condition
  • (Current research level of Recruitment for Player 1 (Red)) Equal to 1
instead of
  • (Researched tech-type) Equal to Recruitment
 
Last edited:
Level 4
Joined
Jan 6, 2009
Messages
100
I'm having a bit of trouble getting my head around what your saying, Mooglefrooglian. You wouldn't be able to put it in Trigger format, could you?

Wait, nevermind, i think i've got it.
 
Level 4
Joined
Jan 6, 2009
Messages
100
  • Recruitment Spawn
    • Events
      • Unit - A unit Finishes an upgrade.
    • Conditions
      • (Researched tech-type) Equal to Recruitment
    • Actions
      • Trigger - Turn off Spawn 2 (Spawns 3 units every 9 secs)
      • Trigger - Turn on Spawn 3 (Spawns 4 units every 9 secs)
And yes, Spawn 2 is initially on and Spawn 3 is initially off. Am I doing something wrong here? Because it doesn't work.
 
Status
Not open for further replies.
Top