HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spawn Items around unit

10-23-2004, 11:56 PM#1
Ordin
I've been trying to do this trigger but so far with no luck. What I want is every 30 seconds there is a random chance that an item is spawned around these buildings located around the map. The buildings can be destroyed and built by players which means I cant just simply use a region around each building. Can anyone help with this trigger?
10-24-2004, 02:13 AM#2
AntJAB
Events
Every 30 seconds of game.

Actions
Pick every unit [ or random unit ] matching (conditions = unit type of matching unit equal to BuildingSpecial) and do ( Create item within 200 radius of picked building. )


If you need the exact code I can give it to you in a few hours when I get home.
10-24-2004, 03:00 AM#3
Guest
If you want a circular distribution, use PolarProjection with random radius and random angle. If you want a rectangular distribution, use the spawning unit's coordinates +/- a random real number to the X and Y.

(note, however, that you should use (random number)^2 for the radius, unless you don't want an even distribution...)