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

How to disable spawn trigger when at 100 limit?

Status
Not open for further replies.
Level 2
Joined
Apr 15, 2018
Messages
13
The problem is that it later on the game, there will be so many units fighting then it gets so laggy. I want to disable the spawn trigger when it reaches at 100 limit. Then enable the spawn trigger when it is 99 or below food limit... Any idea using the Trigger Editor?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
  • Spawn Trigger
    • Events
      • Spawn Event ???
    • Conditions
      • Food for Player X < 100
    • Actions
      • Spawn stuff
OR
  • Spawn Trigger
    • Events
      • Spawn Event ???
    • Conditions
    • Actions
      • Loop PlayerNumber from 1 to 24
        • If (Food for Player(PlayerNumber) < 100)
          • Spawn stuff for Player(PlayerNumber)
Syntax is totally off the charts and it has to be a bit polished, but you should understand the idea.

Hope this helps?
-Ned
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Both of those are plain texts that I wrote just as I wrote this reply to indicate what has to be there.

"Spawn event" is non existent. I wrote that just for indication. you would place your spawn event there, whatever you like. e.g.
  • Time - Every 5.00 seconds of game time
or
  • Unit - A unit starts the effect of a spell
"Food for player" exists, but the syntax is VERY different. It is under Conditions > Integer Comparison.
You would get a "Left side", a "Right side" and a "comparator"

On the left side you go:
Player - Player Property >>> Current food for Player(X)
Now "Player(X)" also has to be set, it would be something like "Convert player index to player" where player index would be the PlayerNumber variable that I have used.

Right side you just put in 100

Comparator is inbetween the two, by default it should be "Equals to" you need to change that to "Less than"

At the end, it should look like:
  • If - do Then actions else do Else actions
    • If - Conditions
      • Food for Player(TempInt) is Less than 100
    • Then Actions
      • Spawn stuff here
    • Else Actions
I am not working with WE at the moment, SO, those instructions are from my head, they may NOT be 100% accurate, actually I guarantee that there are some inconsistencies,
BUT! This should point you in the general direction of everything you need.

regards
-Ned
 
Status
Not open for further replies.
Top