Xplorer4x4 Posted May 30, 2014 Report Share Posted May 30, 2014 Ok I want to set up a delay in a script but I can't see how do do it since I can;t see a way to use ACTION_* unless I maybe split these 3 lines in to a dummy command of itself. In which case, I think I can do but not sure this is the best route to go. Example code:else if (vt.blah() == VT_BLAH){ if (vt.HasBlah(NULL)) vt.RemoveBlah();}These are the three lines needing a delay. They will actually go in to a random choice variable so maybe it would be easier to add the delay in to int random = Math::rand()%3; for example? Quote Link to comment Share on other sites More sharing options...
bma Posted May 30, 2014 Report Share Posted May 30, 2014 What abiut using the PushActionWait(ACTION_APPEND, X.f); Not sure its spelled the right way though Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 30, 2014 Report Share Posted May 30, 2014 Anyway, the only way to create a delay in a command script? is through PushActionWait(ActionInsertMode mode_, float time_);. Do you want the vehicle to have a delay of 3 seconds before removing the object? But it would require you to use an ActionInsertMode anyway. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted May 30, 2014 Author Report Share Posted May 30, 2014 So.. else if (vt.blah() == VT_BLAH){ if (vt.HasBlah(NULL))int random = Math::rand()%3; if (random == 0)vt.PushActionWait(ACTION_NEWLIST, 0.05f); vt.RemoveBlah();if (random == 1)vt.PushActionWait(ACTION_NEWLIST, 1.05f); vt.RemoveBlah();if (random == 3)vt.PushActionWait(ACTION_NEWLIST, 5.05f); vt.RemoveBlah();}Maybe something like this? Maybe I just cant my head around this and need to look at it in the AM lol. Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 30, 2014 Report Share Posted May 30, 2014 Yes...something like that. So now you have 3 random delays before the vehicle is removed.For context, what are using this script for? Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted May 30, 2014 Author Report Share Posted May 30, 2014 That would be top secret information! Sent from my DROID RAZR HD using Tapatalk Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 30, 2014 Report Share Posted May 30, 2014 Haha....Anyway, hope that we were able to help you. Quote Link to comment Share on other sites More sharing options...
The Loot Posted May 30, 2014 Report Share Posted May 30, 2014 If a command isn't a PushAction, it won't be affected by a PushActionWait. I suggest making a dummy command with "vt.RemoveBlah();" as its only function, and then PushActionExecute it after the Wait. Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 30, 2014 Report Share Posted May 30, 2014 Your right. vt.RemoveBlah(); is a function, not a push action. I guess he'll have to create a dummy script to go around that. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted May 30, 2014 Author Report Share Posted May 30, 2014 Thanks guys, I only got to thinking of making a dummy command after I started typing and it was late so i figured i would gather feedback on the best way to do it first. Quote Link to comment Share on other sites More sharing options...