Game Development Community

Need help creating a fxFoliage replicator through code

by Jamie Zephyr · in Torque Game Engine · 05/31/2008 (1:25 pm) · 1 replies

Fx foliage replicator created dynamically in code but wont show until I select in editor

I am using a function thats callable in code to create a foliage replicator (to represent weeds growing in a farmer's area).

The problem is that the actual planes of foliage do not appear until you click the fxFoliage object in the editor. Does someone know how to get them to appear right when I make the replicator and set its transform to where I want it to be?

Any help would be great!

#1
05/31/2008 (4:49 pm)
Ahh found the answer in this post

http://www.garagegames.com/mg/forums/result.thread.php?qt=18448

in case anyone comes across and is curious you have to schedule the startFoliageReplication() function to run from another function

example:

//after creating the new fxFoliageReplicator

schedule(10, 0, runMe);

function runMe()
{
echo("Rendering Foliage");
startFoliageReplication();
}