• 🏆 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 make levels with variables :o

Status
Not open for further replies.
Level 3
Joined
Oct 3, 2009
Messages
29
Hello

Im making a maul right now.
I've been trying to do so when the timer expires ( and food of creeps = 0 ) then a timer starts. When that timer expires next wave will begin. And it should of course be new creeps, thats my problem, to change the type of creeps. And yes it sounds easy.

Well, this is my timer trigger;

  • Timer1
    • Events
      • Player - Player 10 (Light Blue)'s Food used becomes Less than or equal to 0.00
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Timer1 as a One-shot timer that will expire in 10.00 seconds
      • Countdown Timer - Create a timer window for Timer1 with title Next wave in:
      • Wait 10.00 seconds
      • Set LevelINT = (LevelINT + 1)
      • Countdown Timer - Destroy (Last created timer window)
Tell me if you found anything wrong, I'm not the best att triggers. :<

Here is the "unit-type" changer trigger wich dosnt work. Ehm I guess you guys will know why.

  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • If (LevelINT Equal to 1) then do (Set UnitType = [LV01] Seal) else do (Do nothing)
      • If (LevelINT Equal to 2) then do (Set UnitType = Mortar Team) else do (Do nothing)
      • If (LevelINT Equal to 3) then do (Set UnitType = Flying Machine) else do (Do nothing)
Here is spawn, if it makes any sense.

  • RedSpawn
    • Events
      • Time - Timer1 expires
    • Conditions
    • Actions
      • -------- Level 1 --------
      • Unit - Create 15 UnitType for Player 10 (Light Blue) at (Center of RedSpawn <gen>) facing Default building facing degrees

I would be really thankfull if some1 helped me! :):)
+rep of course (A)
 
Level 11
Joined
Feb 11, 2010
Messages
199
Hello

Im making a maul right now.
I've been trying to do so when the timer expires ( and food of creeps = 0 ) then a timer starts. When that timer expires next wave will begin. And it should of course be new creeps, thats my problem, to change the type of creeps. And yes it sounds easy.

Well, this is my timer trigger;

  • Timer1
    • Events
      • Player - Player 10 (Light Blue)'s Food used becomes Less than or equal to 0.00
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Timer1 as a One-shot timer that will expire in 10.00 seconds
      • Countdown Timer - Create a timer window for Timer1 with title Next wave in:
      • Wait 10.00 seconds
      • Set LevelINT = (LevelINT + 1)
      • Countdown Timer - Destroy (Last created timer window)
Tell me if you found anything wrong, I'm not the best att triggers. :<
There's no reason to have a wait. In fact you should never use the wait command ever, because it's inaccurate (in terms of timing, since it's a polled wait) and prone to causing bugs. Set the countdown timer to a variable and do your stuff when the timer expires.

Here is the "unit-type" changer trigger wich dosnt work. Ehm I guess you guys will know why.

  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • If (LevelINT Equal to 1) then do (Set UnitType = [LV01] Seal) else do (Do nothing)
      • If (LevelINT Equal to 2) then do (Set UnitType = Mortar Team) else do (Do nothing)
      • If (LevelINT Equal to 3) then do (Set UnitType = Flying Machine) else do (Do nothing)
Well your problem is that it's at map initialization. Do it in your RedSpawn trigger. Also, never use Do Nothing. EVER. Seriously, it's even worse than Wait. It's like getting up and calling your friend over to do something, then telling him you want him to do nothing. He's going to be like "What the hell did you call me for?" Do nothing is a function that does absolutely nothing but decrease the efficiency of your code. Just leave else blank if you have to!!
___

Here:

  • Timer1
    • Events
      • Player - Player 10 (Light Blue)'s Food used becomes Less than or equal to 0.00
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Timer1 as a One-shot timer that will expire in 10.00 seconds
      • Countdown Timer - Create a timer window for Timer1 with title Next wave in:
      • Countdown Timer - Show WaveTimerWindow for (Whatever player you want to see the timer)
  • RedSpawn
    • Events
      • Time - Timer1 expires
    • Conditions
    • Actions
      • -------- Level 1 --------
      • Set LevelINT = (LevelINT + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LevelINT Equal to 1
        • Then - Actions
          • Set UnitType = [LV01] Seal
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LevelINT Equal to 2
            • Then - Actions
              • Set UnitType = Mortar Team
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LevelINT Equal to 3
                • Then - Actions
                  • Set UnitType = Flying Machine
                • Else - Actions
        • Unit - Create 15 UnitType for Player 10 (Light Blue) at (Center of RedSpawn <gen>) facing Default building facing degrees
        • Countdown Timer - Destroy (Timer1)
 
Last edited:
Level 3
Joined
Oct 3, 2009
Messages
29

Oh god man, thank you! + rep for sure!
It worked perfect :)
I don't know why people here on Hive help noobs like me, but well its really nice that people like you have the time to do it! Im very glad that you helped me! I mean, not many have the time to do it :)
Thanks!!
+Rep!
 
Level 11
Joined
Feb 11, 2010
Messages
199
Oh god man, thank you! + rep for sure!
It worked perfect :)
I don't know why people here on Hive help noobs like me, but well its really nice that people like you have the time to do it! Im very glad that you helped me! I mean, not many have the time to do it :)
Thanks!!
+Rep!

You're welcome. Look at my response again though, looks like you were responding while I was editing it to make it better. :thumbs_up:
 
Status
Not open for further replies.
Top