RVA8 0 Report post Posted March 21, 2011 Hey all, I've got what will hopefully be an easy Xpresso question. I need to have Xpresso determine a random point on an object for a random duration then, at the end of that duration, pick another random point on the same object for another random duration and keep going. I know enough Xpresso to be dangerous, but I'm stumped on this one since it seems I can't feed the result at the end of my node chain back into the beginning. I can determine the random point just fine. I can determine a random duration with no problem. The problem is that when I use a noise node it keeps generating random numbers on every frame. I can't seem to get just one random number for a set period of time. Anyone have any ideas? Thanks! R Quote Share this post Link to post Share on other sites
Srek 0 Report post Posted March 21, 2011 Xpresso is evaluated at least once per frame. What you need is to determine when it should be active an when not. Some kind of modulo operation on the frame number is an option for example. With that bool value you enable/disable the last node that does the final assignement. Take a look here http://www.bonkers.de/xpa/xpgoodies.html for the ray collision example, i use the bool value of the ray collision to enable the control objects node. Quote Share this post Link to post Share on other sites
RVA8 0 Report post Posted March 22, 2011 That makes sense. What I would like to do is, say, have a node that compares the current time to the randomly determined target time. Once the timeline reaches the target time to then trigger a boole to turn on the node that randomizes the point index. At the same time, once that new index is determined it should restart the process and a new target time should be created. I have most of this working. My problem seems to come when it's time to restart the process. It wants to keep going because I have no way of shutting the triggering boole value off again and generating a new target time. R Quote Share this post Link to post Share on other sites
Srek 0 Report post Posted March 22, 2011 You could use user data like variables to store the random value and the current state. Quote Share this post Link to post Share on other sites
RVA8 0 Report post Posted March 22, 2011 That's a great idea! I didn't think of using User Data to store a variable. I'll give it a try! Thanks for the help! R Quote Share this post Link to post Share on other sites
RVA8 0 Report post Posted March 22, 2011 Works great! Thanks again! R Quote Share this post Link to post Share on other sites