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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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