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

Enemy Spawns

Status
Not open for further replies.
Level 3
Joined
Nov 7, 2006
Messages
50
Ok, anyone have ideas how i could spawn enemies across a region without getting them stuck (alot of objects and cliff terrain are included) I dont really need the triggers themselves, since i could do them myself, I just need ideas for different methods on spreading em around. Any help would be appreciated thnx.
 
Level 5
Joined
Jul 11, 2007
Messages
152
Just do a periodic looping trigger that moves the units to a random point in the region every X seconds. So if they get stuck chances are good that they'll get out while still being in the same region and the ones that aren't stuck are already out of the way.
 
Level 3
Joined
Mar 6, 2007
Messages
48
What i would do is this.. This is fast, efficient and very good if you want to choose certain areas where units randomly get created..

Okay, so you go into the object editor, choose a peasant or something, and create a custom unit.. Give the custom unit locust and then change the scale of the unit to .10 and selection scale to .10 - Now you change the model giving it no visibility on the map of such a unit.. Type in a custom model path: (Just type "NONE") The map won't find the model of course, which is a good thing!

Now what you do is place these units that have no model that have the ability locust wherever you want on the map, choosing areas where you would like your units to randomly spawn.

After you've chosen all the desired areas, you go into triggers and give that custom unit you just made, it's own unit group using a variable (so you don't create memory leaks in your game). Now all you gotta do is have your spawn trigger, create units to a random unit from a specific unit group.

  • Events
    • Map initialization
  • Conditions
  • Actions
    • Unit Group - Add all units of (Units of type Peasant) to VariableRandomSpawn
  • Events
  • Conditions
  • Actions
    • Unit - Create 1 Footman for Player 1 (Red) at (Position of (Random unit from VariableRandomSpawn)) facing (Position of (Triggering unit))
ENJOY!!:grin:
 
Level 3
Joined
Mar 6, 2007
Messages
48
No.. The only leak I see is Map Initialization, but i just put that in there to cover the events for an example. Other than that - second leak?
 
Level 3
Joined
Mar 6, 2007
Messages
48
You can easily change the Position of (triggering unit) and besides, what other way could you do this trigger without leaking?
 
Status
Not open for further replies.
Top