• 🏆 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] Wave Spawning

Status
Not open for further replies.
Level 3
Joined
May 16, 2011
Messages
57
So I've been cracking at this for years now, trying to get the triggers to work properly for a Wave/Creep Survival game. Sadly, I'm not having much look.

The timer Triggers work fine, if crude:

Wave1Timer.png


Then we get to the Creep AI behavior:

Wave1Triggers.png


Meaning that this one is untested:

Wave1Ending.png


So in a sense, the gates open, the Zombies spawn, pick targets and move to attack. The gates close behind the Zombies. When all the Zombies are dead, the next round starts.

...Except the Zombies don't move towards the player. They just sit there until provoked. Sometimes, the Wave Spawning cocks itself up, spawning multiple waves at the exact same time or not spawning them at all.

Some assistance is required.
 
Level 7
Joined
Jan 28, 2012
Messages
266
you are leaking, a lot,


use this
  • CustomScript: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units owned by Player 7 (Green)) and do (Actions)
    • Loop - Actions
      • CustomScript set bj_wantDestroyGroup = true
      • Unit - Order (Picked unit) to Attack (Random unit from (Units owned by (Random player from Player Group - Player 10 (Light Blue))))
this
  • Unit Group - Pick every ....
though even better would be this
  • Actions
    • Set Playindex = 0
    • Player Group - Pick every player in marines and do (Actions)
      • Loop - Actions
        • Set Playindex = (Playindex + 1)
        • Set Player[Playindex] = (Units owned by (Picked player))
    • Custom Script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Player 7 (Green)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack (Random unit from Player[(Random integer number between 1 and Playindex)])
  • For integer a from 1 to Playindex do actions
    • loop
      • CustomScript: call DestroyGroup(Player[bj_forLoopAIndex ])
      • CustomScript: Set Player[integer a] = null
 
Level 3
Joined
May 16, 2011
Messages
57
you are leaking, a lot,


use this
  • CustomScript: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units owned by Player 7 (Green)) and do (Actions)
    • Loop - Actions
      • CustomScript set bj_wantDestroyGroup = true
      • Unit - Order (Picked unit) to Attack (Random unit from (Units owned by (Random player from Player Group - Player 10 (Light Blue))))
this
  • Unit Group - Pick every ....
though even better would be this
  • Actions
    • Set Playindex = 0
    • Player Group - Pick every player in marines and do (Actions)
      • Loop - Actions
        • Set Playindex = (Playindex + 1)
        • Set Player[Playindex] = (Units owned by (Picked player))
    • Custom Script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Player 7 (Green)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack (Random unit from Player[(Random integer number between 1 and Playindex)])
  • For integer a from 1 to Playindex do actions
    • loop
      • CustomScript: call DestroyGroup(Player[bj_forLoopAIndex ])
      • CustomScript: Set Player[integer a] = null

So, call me an idiot, but this is for the second one right? The timer's and three seperate scripts are fine?
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Here is a map. Just so you can view it from the editor. I'd like to mention, every1 codes slightly differently, I pretty much followed "Enders" first method, and finished the rest of the trigger. Leak free.
 

Attachments

  • Zombie Spawns.w3x
    17.2 KB · Views: 55
Level 3
Joined
May 16, 2011
Messages
57
Here is a map. Just so you can view it from the editor. I'd like to mention, every1 codes slightly differently, I pretty much followed "Enders" first method, and finished the rest of the trigger. Leak free.

I'm still getting the same issue. It's again based on yours, though I tried to differ as much as I could to avoid copy/paste modding.

Wave1NewTriggersA.png


They're still just sitting in their spawn zones, not moving towards me :vw_unimpressed:

I even tried a variant with an If/Then/Else version, to try and make it target players who were playing. Still no effect.

EDIT - Okay, quick update. The good news is, we got them to move. The bad news is, they're not moving beyond the gates -_-

EDIT #2 - Here, just to prove it:

 
Last edited:
Level 16
Joined
Mar 27, 2011
Messages
1,349
Not relevant to that problem, but to increase the speed of your spawn trigger, you can remove the Set variable lines.

Since the spawn points are the same every time, you can set them once at map initialization.

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set AttackSpawns[1] = (Center of Mook Spawn A <gen>)
      • Set AttackSpawns[2] = (Center of Mook Spawn B <gen>)
      • Set AttackSpawns[3] = (Center of Mook Spawn C <gen>)
      • Set AttackSpawns[4] = (Center of Mook Spawn D <gen>)
Now, you dont need to re-set the variables every time the zombies spawn. This saves the computer redoing it when it doesnt have to.

  • Untitled Trigger 001
    • Events
      • Time - WaveTimer expires
    • Conditions
    • Actions
      • Unit - Create 10 Zombie for Player 7 (Green) at AttackSpawns[1] facing Default building facing degrees
      • Unit - Create 10 Zombie for Player 7 (Green) at AttackSpawns[2] facing Default building facing degrees
      • Unit - Create 10 Zombie for Player 7 (Green) at AttackSpawns[3] facing Default building facing degrees
      • Unit - Create 10 Zombie for Player 7 (Green) at AttackSpawns[4] facing Default building facing degrees
      • Destructible - Open Elven Gate (Vertical) 0000 <gen>
      • Destructible - Open Elven Gate (Vertical) 0001 <gen>
      • Destructible - Open Elven Gate (Vertical) 0002 <gen>
      • Destructible - Open Elven Gate (Vertical) 0003 <gen>
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 7 (Green)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack (Random unit from (Units owned by (Random player from Marines)))
      • Countdown Timer - Destroy (Last created timer window)
      • Destructible - Close Elven Gate (Vertical) 0000 <gen>
      • Destructible - Close Elven Gate (Vertical) 0001 <gen>
      • Destructible - Close Elven Gate (Vertical) 0002 <gen>
      • Destructible - Close Elven Gate (Vertical) 0003 <gen>
 
Level 3
Joined
May 16, 2011
Messages
57
We've gone back to Square 1. Triggers are leaking somewhere, I think but I can't tell where. They've gone back to just sitting on the spawn point.

The triggers for the wave resemble this:

Wave1NewTriggersB.png


On a side note (so not related to above problem, but still a problem), we've got another broken Trigger folder. This one concerns certain "Kill Zones" - if a Player controlled unit wanders past a point, the game kills him splat dead. So far, it looks like this:

KillZoneTriggers.png


With the player grouping looking like this:

PlayerGroupControl.png


And yet it's not killing any unit I ride into that spot.

Finally, I have a feeling this may be a problem:

DocumentCorruption.png


See the little padlocks over my map? Somewhere, Windows 7 has decided to make them hidden files for some reason O_O

All in all: :ogre_rage:
 
Level 3
Joined
May 16, 2011
Messages
57
ehh, please just give me your map via a private message and I will fix it. I have no intentions what so ever to steal anything. It seems like theres a fair bit to fix over forums.

As much as I'd love to fix it myself (only way to learn, folks!), I'll agree to send it over. Should be with you within five minutes.
 
Status
Not open for further replies.
Top