Jump to content
Xplorer4x4

Delay with out using ACTION_NEWLIST/APPEND

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...