Random creep spawn system

volgera

New Member
Reaction score
0
Hi guys,

I need a creep spawn system that can spawn RANDOM creeps every x seconds. Does anyone have one that I could use? or any tips for making one?
 

Dirac

22710180
Reaction score
147
Here at these forums we believe is for the best if you try to do one and we help you with your problems, instead of giving you the whole thing already done.
Also please specify your request, spawn creeps where? how many? for what? are they supposed to attack something? move somewhere? are you making a TD?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
You could use Unit-Type of (Random Unit from CreepTypes), where CreepTypes is a unit group containing 1 of every unit-type you need.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Make an unit-type array and store the unit-type's in it.
Then spawn a random unit from the array.


/EDIT: Owned by AFK.
 

scubazoo

Member
Reaction score
1
Make a region in which you want the creeps to spawn. Event, every x seconds, create unit at random point in region.
OOOH Random creeps. Hmm. Ya make a unit array and set the creeps you want to each array integer. and then instead of create unit, create a random integer from that unit array.
 

volgera

New Member
Reaction score
0
well, I'm making a map where you catch random hero creeps and level them. So, there are different types of creeps in a region. And every region has different creeps with specific abilities, strengths and weaknesses. So I just need to get a good spawning system in which you can spawn x amount of creeps every x seconds....

now my problem is: how can I set a unit array [x] to a specific unit that still has to be spawned?
 

krainert

Member
Reaction score
10
I'm not sure I understand what you mean by "how can I set a unit array [x] to a specific unit that still has to be spawned?". Could you elaborate?
 

volgera

New Member
Reaction score
0
well, to let creeps spawn randomly I have to make a unit array. When I make one (for example array 5) I want to make unit array [1] be a archmage, array [2] be a bloodmage etc. Every time i want to set the variable, I have to select a unit that's already on the map, and if I delete the unit, the variable is no longer valid. So, I want to set the variables onto units that are not on the map...
 

Xindaris

New Member
Reaction score
0
Actually, an example of a "Unit-type" would be footman, peasant, archmage, etc. In other words, unit-type represents a type of unit.

Unit variables refer to specific units that already exist; unit-types are what you select when you say to "create number of units of unit-type in location", for example.
 

volgera

New Member
Reaction score
0
oooh like that. thanks, i can select them now, but how do I let them spawn at random?

with that, I mean this;

every 30 seconds of game time, I want to create 5 heros into the region. How can I let the editor select 5 heros at random in a variable, which has 14 different kinds of heros in it.... anyone who has some kind of trigger that does that??
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
So you are going to firstly want to create a Unit-Type Array, and set all the different unit-types you want into the array, like this:
Trigger:
  • Trigger 1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set UnitTypeArray[1] = Paladin
      • Set UnitTypeArray[2] = Archmage
      • Set UnitTypeArray[3] = Mountain King
      • Set UnitTypeArray[4] = Blood Mage
      • ...
      • Set UnitTypeArray[X] = Warden

X would be the total number of unit-types, the number you arrive at after you have all the different unit-types you want stored in the array. Then you would make a second trigger to look like this:
Trigger:
  • Trigger 2
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Unit - Create 1 UnitTypeArray[(Random integer number between 1 and X)] for Neutral Hostile at (Center of Your Region <gen>) facing Default building facing degrees

X again being the total different number of unit-types. This trigger will create 5 units every 30 seconds with a random unit-type from the list made in the first trigger.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top