Home » Renegade Discussions » Mod Forum » Timer_Expired
Re: Timer_Expired [message #371858 is a reply to message #371856] |
Thu, 12 February 2009 16:17 |
|
danpaul88
Messages: 5795 Registered: June 2004 Location: England
Karma:
|
General (5 Stars) |
|
|
Jerad Gray wrote on Thu, 12 February 2009 23:06 |
danpaul88 wrote on Thu, 12 February 2009 10:40 | Just use the Custom system instead, make it send a custom to itself with an x second delay and put the players ID as the parameter to the custom. Easy.
|
Kind of removes the whole delay part though...
|
Quote: | typedef void (*_Send_Custom_Event) (GameObject *Sender,GameObject *Reciever,int Message,int Param,float Delay);
|
Highlighting added for emphasis. Why else do you think the Send_Custom_Event takes a delay parameter if not to delay the delivery of the custom?
Example;
float delay = 10.0f; // delay in seconds
int message = 12345; // unique message code to identify this from other customs
int param = Get_Player_ID( enter ); // ID of player (use Commands->Get_ID(obj) to get the player object ID, which is probably what you really need)
Commands->Send_Custom_Event ( obj, obj, message, param, delay );
No need to create the variables, you can condense it into a single line statement, I added them for clarity only. You need to decide if you want to send the player ID (as seen from FDS) or the player's object ID (which also makes it work for AI units and makes it easy to cancel triggering if the player died before the delay was triggered)
[Updated on: Thu, 12 February 2009 16:30] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Dec 23 22:27:22 MST 2024
Total time taken to generate the page: 0.01303 seconds
|