Creep Spawns - Easier way?

mathiasdk

New Member
Reaction score
0
Hi all, i though like if i needed to make alot of levels, this would be a very hard way xD. so is there any easier way to spawn 10 units a time with 2 seconds between ?

something which told the game to spawn Level 1 attacking creep every 2. second for 10 seconds, then level 2 attacking creeps every 2. second for 10 seconds. and so on ?
 

Bonzo

New Member
Reaction score
4
Trigger Spawn
Events
Every 2 seconds of game time
Conditions
--
Actions
Create 1 Your_Creep at <spawnpoint>
Order Last Created Unit to move to <point>


Trigger Creeptype
Events
Every 10 seconds of game time
Conditions
--
Actions
For each integer A from 1 to 50 do Actions {if your map has 50 levels}
if Current_Level = Integer A
then
-set Your_Creep = Creep[Integer A]
-set Current_Level = Current_Level +1
-skip remaining Actions


Your_Creep is a non-array unit type variable
Creep[Index] is an array unit type variable in which you must predefine the different creep types for each level
Current_Level is a non-array integer variable


Greets Bonzo
 

Bonzo

New Member
Reaction score
4
Code:
SpawnStart
    Events
        Time - Elapsed game time is 30.00 seconds
    Conditions
    Actions
        Trigger - Turn on Spawn <gen>
        Trigger - Turn on Creeptype <gen>

Code:
Creeptype
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Unit- Create 1 Your_Creep for Player12 (Brown) at <the point where you want the creeps to spawn> facing 0.0 degrees

Code:
Spawn
    Events
        Time- Every 10.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 50, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    'IF'-Conditions
                        Current_Level equal to Integer A
                    'THEN'-Actions
                        Set Your_Creep = Creep[IntegerA]
                        Set Current_Level = Current_Level+1
                        Skip remaining actions
                    'ELSE'-Actions

You must turn off the Creeptype and the Spawn trigger: rightclick on the triggername and then turn off, so that the sheet in front of it is half red (no cross).
The "for each integer A" actions is in no category, you need to select it directly with no action type.

If you have still problems I'd suggest you learn the basics of triggering.

The preset of the Current_Level variable has to be '1'.

Greets Bonzo
 

Don

Rise with the Fallens!
Reaction score
52
Here, try those:

Map init:
Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Visibility - Disable fog of war
        Visibility - Disable black mask
        Wait 0.01 seconds
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Set (Picked player) Food cap to 1
                Player - Set (Picked player) Current gold to 50
                Player - Set (Picked player) Current lumber to 1
        Set time_ammount = 20
        Set unit_type[1] = 1 - |cffffcc00Pig|r
        Set level = 0
        Trigger - Run Timer <gen> (ignoring conditions)

Timer:
Code:
Timer
    Events
    Conditions
    Actions
        Set level = (level + 1)
        Game - Display to (All players) the text: (Level |cffffcc00 + ((String(level)) + (|r Will start in 30 seconds + , |cffffcc00get ready!|r)))
        Leaderboard - Change the value for Player 9 (Gray) in game_leaderboard to level
        Leaderboard - Change the value for Player 11 (Dark Green) in game_leaderboard to time_ammount
        Countdown Timer - Start wave_timer as a One-shot timer that will expire in 30.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title (Level  + ((String(level)) +  in:))
        Set wave_timer_window = (Last created timer window)
        Countdown Timer - Show (Last created timer window)

Timer expires:
Code:
Timer Expires
    Events
        Time - wave_timer expires
    Conditions
    Actions
        Countdown Timer - Destroy wave_timer_window
        Game - Display to (All players) the text: (Level |cffffcc00 + ((String(level)) + (|r:  + ((String(time_ammount)) + ( |cffffcc00 + ((String(unit_type[level])) + |r in every corner.))))))
        Trigger - Turn on Spawn <gen>
        Wait (Real(time_ammount)) seconds
        Set time_ammount = (time_ammount + 1)
        Leaderboard - Change the value for Player 11 (Dark Green) in game_leaderboard to time_ammount
        Trigger - Run Timer <gen> (ignoring conditions)
        Trigger - Turn off Spawn <gen>

Spawn units:
Code:
Spawn
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (((Player 1 (Red) slot status) Equal to Is playing) and ((Player 1 (Red) controller) Equal to User)) then do (Unit - Create 1 unit_type[level] for Player 9 (Gray) at (Center of red spawn <gen>) facing Default building facing degrees) else do (Do nothing)
        If (((Player 2 (Blue) slot status) Equal to Is playing) and ((Player 2 (Blue) controller) Equal to User)) then do (Unit - Create 1 unit_type[level] for Player 9 (Gray) at (Center of blue spawn <gen>) facing Default building facing degrees) else do (Do nothing)
        If (((Player 3 (Teal) slot status) Equal to Is playing) and ((Player 3 (Teal) controller) Equal to User)) then do (Unit - Create 1 unit_type[level] for Player 10 (Light Blue) at (Center of teal spawn <gen>) facing Default building facing degrees) else do (Do nothing)
        If (((Player 4 (Purple) slot status) Equal to Is playing) and ((Player 4 (Purple) controller) Equal to User)) then do (Unit - Create 1 unit_type[level] for Player 10 (Light Blue) at (Center of purple spawn <gen>) facing Default building facing degrees) else do (Do nothing)
        If (((Player 5 (Yellow) slot status) Equal to Is playing) and ((Player 5 (Yellow) controller) Equal to User)) then do (Unit - Create 1 unit_type[level] for Player 11 (Dark Green) at (Center of yellow spawn <gen>) facing Default building facing degrees) else do (Do nothing)
        If (((Player 6 (Orange) slot status) Equal to Is playing) and ((Player 6 (Orange) controller) Equal to User)) then do (Unit - Create 1 unit_type[level] for Player 11 (Dark Green) at (Center of orange spawn <gen>) facing Default building facing degrees) else do (Do nothing)
        If (((Player 7 (Green) slot status) Equal to Is playing) and ((Player 7 (Green) controller) Equal to User)) then do (Unit - Create 1 unit_type[level] for Player 12 (Brown) at (Center of green spawn <gen>) facing Default building facing degrees) else do (Do nothing)
        If (((Player 8 (Pink) slot status) Equal to Is playing) and ((Player 8 (Pink) controller) Equal to User)) then do (Unit - Create 1 unit_type[level] for Player 12 (Brown) at (Center of pink spawn <gen>) facing Default building facing degrees) else do (Do nothing)

Variables:

Level: integer (no array)
Time_Ammount: integer (in your case it is set to 10)
Unit_type: integer (with array, using level to spawn a fdifferent unit every level.) Also, you pre-set the kinds of units in map initialisation.
Other var are leaderboard and timer, you know how it works (i hope lol)

TGhese are from my newest map, enjoy!
 

Bonzo

New Member
Reaction score
4
This is a simple tutorial for variables:
http://world-editor-tutorials.thehelper.net/variables.php
On this page theres also very much basic stuff that could help you to understand what i wrote.

About the "From Integer A from 1 to 50" function:
This runs a loop 50 times and each time it replaces the A with a number between 1 and 50 and does certain actions.

For example:
From Integer A from 1 to 3 do Actions
- set My_Number = Integer A

This means in smaller steps:
set My_Number = 1
set My_Number = 2
set My_Number = 3

Greets Bonzo
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top