Game Development Community

Random object spawns withing a set area....

by Brandon Beauchene · in Technical Issues · 02/18/2005 (2:09 am) · 1 replies

Hello all, I was trying to figure out the best way to create a random number of objects at a random interval on the map....easily done, except i want that spawn to be withing a certain area, i know i can do this in script by setting limits to the random location; however, i was hopeing (for map building sake) that there is a way to create a kind of zone object that has script attached so that i can just add the zone object anywhere on the map and set the script to load, init, and run, on game start.

This way i can have any number of random object spawn in a single map, but with different objects to spawn, different intervals, ammounts, etc, without having to code them all individually. Like a template object i can use, and just modify member variables from the world editor.

Think random resources nodes that players will harvest, ie randomly spawning trees that the players gather wood from. when tree has been harvested completely, it allows for another to spawn in a randomly generated ammount of time based on spawn interval variable.

Hope that makes sense. Thanks