• 🏆 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!

Spawn random creep

Status
Not open for further replies.
Level 2
Joined
Nov 17, 2008
Messages
35
ok first off this is quite simple,

RC is just a integer
CS is a unit type array.

Untitled Trigger 001
Events
Map initialization
Conditions
Actions
Set CS[1] = Peasant
Set CS[2] = Footman
Set CS[3] = Knight
Set CS[4] = Rifleman
Set CS[5] = Mortar Team

Untitled Trigger 002
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
Set RC = (Random integer number between 1 and 5)
For each (Integer A) from 1 to 5, do (If (RC Equal to (Integer A)) then do (Unit - Create 1 CS[(Integer A)] for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees) else do (Do nothing))

ok oviously u wont use the same units and it will be more than 5 u might not spawn them in the center they might not be reds but it gives u a general idea.
 
Level 2
Joined
Nov 17, 2008
Messages
35
you will have to put them all into ur array. so if there is 100 ur array will be 100 long.
 
Status
Not open for further replies.
Top