Spawn different kinds of creep every x minutes

wirawiki

New Member
Reaction score
0
Hello there... I wanted to make a trigger that for the first 10 minutes of the game, every 30 seconds, it spawns 10 Jahrakal (Level 2) creeps on the center of the map. And the next 10 minutes, the creeps spawn will be Broodmother (Level 3). Next 10 minutes, Jahrakal Berserker (Level 5) and so on. I can make a trigger for every x minutes spawn y units, but what can I do with this condition? Anyone has suggestions?
 

TomTTT

New Member
Reaction score
44
I think it will be easy to do it this way:
1. create 3 integer variables (1 for every 10 minutes)
2. At the Map Initialziation, set CreepType(unit) = Whatever starting spawned unit
3. When a time passes what you want, (lets say make an event Time - Elapsed game time is 600 seconds) then set CreepType = next units(so on..).
4. Make a periodic event: Time - Every 60 seconds of game time, create (your amount of units) CreepType at (Point).
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Code:
Spawn Init
    Events
        Map initialization
    Conditions
    Actions
        Set Temp_Int = 0
        Set Temp_Unit[1] = Peasant
        Set Temp_Unit[2] = Footman
        Set Temp_Unit[3] = Knight

Code:
Spawning
    Events
        Time - Every 600.00 seconds of game time
    Conditions
    Actions
        Set Temp_Int = (Temp_Int + 600)
        Set Temp_Point = (Center of (Playable map area))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Temp_Int Equal to 600
            Then - Actions
                Unit - Create 10 Temp_Unit[1] for Neutral Hostile at Temp_Point facing Default building facing degrees
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Temp_Int Equal to 1200
            Then - Actions
                Unit - Create 10 Temp_Unit[2] for Neutral Hostile at Temp_Point facing Default building facing degrees
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Temp_Int Equal to 1800
            Then - Actions
                Unit - Create 10 Temp_Unit[3] for Neutral Hostile at Temp_Point facing Default building facing degrees
            Else - Actions
        Custom script:   call RemoveLocation(udg_Temp_Point)

Make sure to change the Temp_Unit[x] with your unit type.
 

TomTTT

New Member
Reaction score
44
Code:
Spawn Init
    Events
        Map initialization
    Conditions
    Actions
        Set Temp_Int = 0
        Set Temp_Unit[1] = Peasant
        Set Temp_Unit[2] = Footman
        Set Temp_Unit[3] = Knight

Code:
Spawning
    Events
        Time - Every 600.00 seconds of game time
    Conditions
    Actions
        Set Temp_Int = (Temp_Int + 600)
        Set Temp_Point = (Center of (Playable map area))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Temp_Int Equal to 600
            Then - Actions
                Unit - Create 10 Temp_Unit[1] for Neutral Hostile at Temp_Point facing Default building facing degrees
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Temp_Int Equal to 1200
            Then - Actions
                Unit - Create 10 Temp_Unit[2] for Neutral Hostile at Temp_Point facing Default building facing degrees
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Temp_Int Equal to 1800
            Then - Actions
                Unit - Create 10 Temp_Unit[3] for Neutral Hostile at Temp_Point facing Default building facing degrees
            Else - Actions
        Custom script:   call RemoveLocation(udg_Temp_Point)

Make sure to change the Temp_Unit[x] with your unit type.

And obviously not call it "Temp_Unit" since it's not Temporary...
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Actually it doesnt matter, its just a variable every map maker that uses GUI should have. Basically all my stuff uses Temp_Point, Temp_Unit, Temp_Group, it can be named as he wishes also long as he edits the code according to that.
 

TomTTT

New Member
Reaction score
44
Actually it doesnt matter, its just a variable every map maker that uses GUI should have. Basically all my stuff uses Temp_Point, Temp_Unit, Temp_Group, it can be named as he wishes also long as he edits the code according to that.

Well yeah I know it won't matter, but when I see it, my first thought is that it's not used in more than 1 trigger.
 

Mythes

Member
Reaction score
7
Can I use this type of trigger to create a random spawning creep camp?
EG: I have 10 camps in my map at total. In each camp, spawns a different type of creep, and I don't really care if they have the same creep (so it will be more simple :p). I would have to save each "creep camp unit group" to a variable. So:
temp_unit_group[1] = 1 Troll Berserker (Level 6), 2 Troll (Level 1)
temp_unit_group[2] = 1 Broodmother, 5 Spiderlings
etc;

How do I all those units as one unique variable?

Thanks for the atention,

Myt.

PS: Sorry for topic stealing :p
 

0WN3D

New Member
Reaction score
15
Mythes:Sin is not doing what is wrong but knowing its wrong and doing it
Rofl..... Anyway im gonna help u anyway..... But ur descript is vague so i guess u shld be making 1 unit group and then add all ur unitgroup array to that unit group.
 

Mythes

Member
Reaction score
7
Mythes:Sin is not doing what is wrong but knowing its wrong and doing it
Rofl..... Anyway im gonna help u anyway..... But ur descript is vague so i guess u shld be making 1 unit group and then add all ur unitgroup array to that unit group.

Well, I'm not doing it to piss anyone, it just felt really stupid to create another thread to ask almost the same thing...
Anyway, I'll explain better what I asked, but I think you already answered... (but I won't have time to test it till day 23 or so...)

Let's say I have 3 creep camps, Camp A, Camp B and Camp C.
At these 3 camps, there can be many spawnables type of creep "families".
One creep family is: 1 Troll Level 6, 2 Trolls Level 1.
Other creep family is: 1 Broodmother, 5 Spiderlings
Another one: 1 Uther Lightbringer, 3 Undead <- LoL! roleplay ftw.
etc, etc, etc.

So, now I want to random which family can appear at each camp.
I can do such:

Set CreepSpawnChance = Random number between 1 and 100.
If: CSC (for creep spawn chance) = 1
Then: Create 1 "Troll Level 6"
Create 2 "Troll level 1"

If: CSC = 2
Then: Create 1 "Broodmother"
Create 5 "Spiderlings"

If: CSC = 3
Then: Create 1 "Lol you got the idea ¬¬"



What I wanted is to make only one variable to refer to all the group.
So,

set Broodcamp = 1 Broodmother + 5 Spiderlings
set Trollcamp = 1 Troll Level 6 + 2 Trolls Level 1


Got the idea?
I'll try that when I return from my trip.


Myt.
 
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