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

WC3: Firefight - Wave clear trigger assistance #2

Status
Not open for further replies.
Level 3
Joined
Jun 18, 2008
Messages
28
My trigger is kind of bugged: I've tried to configure it correctly:

  • Wave 1a
  • Events -
  • Conditions -
  • Actions -
    • Game - Display to (All players) the text "text"
    • Unit - Create 15 Ghoul Devourers for Player 5 (Yellow) at Center of Spawn Zone 1 <gen> facing (Position of triggered unit)
    • Unit - Create 15 Ghoul Devourers for Player 5 (Yellow) at Center of Spawn Zone 2 <gen> facing (Position of triggered unit)
    • Trigger - Turn off Wave 1a
  • Wave 1Sa
  • Events -
    • Unit - A unit dies
  • Conditions -
    • Owner of (triggering unit) equal to Player 5 (Yellow)
  • Actions -
    • Set EnemyKills = (EnemyKills + 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • EnemyKills equal to 30
      • Then - Actions
        • Trigger - Run Wave 1b <gen> (ignoring Conditions)
        • Trigger - Run Wave 1Sb <gen> (ignoring Conditions)
      • Else - Actions
        • Trigger - Turn off Wave 1Sa <gen>
Surely enough - this trigger's kind of borked and I can't really do much about this. Can anyone assist me in fixing these triggers up to the next stage, at least so I can configure the next waves of my new map?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Instead of the linear chain approach.

1 --> 2 --> 3 --> 4 --> ...

You are meant to do a more functional approach to waves.

0 --> F -(+1)-> F

Which the very crude illistration above demonstrates that you could then recycle the same code for all waves and purly increase the wave data by 1 each wave. This is how most TDs and such maps work as it is far easier and more efficent than creating dozens of separate unique code objects repeating large pieces of functionality.

To do this, simply use variables and arrays instead of constants for certain values.

What I currently see wrong with the provided code (as you have not actually mentioned what is wrong...) is that you never reset EnemyKills to 0 at the end of each wave. Also you have missed out huge blocks of code so we have no idea what could be wrong with the interaction between your crude GUI triggers.

I will not bother pointing out the fact your code leaks in about 2 ways, I advise you read up about leaks and switch to JASS or atleast optimize the map with vexorians optimizer before release (even if left unprotected in the optimizer options, just to fix the inherent GUI leaks of handle indexes).
 
Level 3
Joined
Jun 18, 2008
Messages
28
Let me just say something:

This is my first attempt in a TD/HD (hero defense) style map... so I just was asking for assistance. I don't know too much about coding, but I know a few things.
 
Status
Not open for further replies.
Top