Game Development Community

FxShapeReplicator with nonstatic items

by Russell Snyder · in Torque Game Engine · 04/24/2006 (6:42 pm) · 2 replies

I am working on a hide and seek type game for my kids and would like the game to randomly place the items throughout the area. I can use fxShapeReplicator to place static items but not items that can be picked up (think Healthkit). Any ideas would be great.

#1
04/24/2006 (7:42 pm)
What kind of area are you working with? Items have simple physics... including basic gravity, so depending on the type of levels you have, you could just randomly spawn a bunch of items over an area and they'd fall into place. You could also do raycast checks to make them only spawn over certain "legal" areas... but this all really depends on how your maps are setup.
#2
04/26/2006 (10:24 am)
Use script. Do a simple loop, generate random positions then create your items there. Open the mission file in a script editor and you'll see how to create objects through script (the .mis file is a plain simple script, all it does is create lots of objects).

The fxShapeReplicator is NOT meant for adding dynamic (i.e: movable/pickable/destructible) objects to the scene, since it creates TSStatics on the server side and on the client side independently (so changes on the server shape won't affect the client shape).