Zeealex Posted December 23, 2011 Share Posted December 23, 2011 is there any possible way of setting up a visual timer in the scripts so players know how much time they have left to complete a certain objective? and then how to set up a mission fail script once the timer reaches 0? Quote Link to comment Share on other sites More sharing options...
Tinker Posted December 23, 2011 Share Posted December 23, 2011 This has obj 01 as kill all enemy, 30 minute timer, displaying message every 5 minutes, then the last 2 minutes. Game ends if timer runs down. Timer cancels if obj 01 is complete. Sure you can work it from there. Attached the script that can be imported into Igor to view. Group: <Default> Comment: SETUP Trigger Event: The simulation is starting. Responses: Set P-Platoon to (The player-controlled platoon). Set Time limit 5 to expire in 300 second(s). Enable the TL script blocks. Set tough luck to true. Prevent this block from being reactivated. Group: TL Comment: TL 5 Trigger Event: Time limit 5 has expired. Responses: Display "25 Minutes remaining....." to all players. Set Time limit 4 to expire in 300 second(s). Prevent this block from being reactivated. Group: TL Comment: TL 4 Trigger Event: Time limit 4 has expired. Responses: Display "20 Minutes remaining....." to all players. Set Time limit 3 to expire in 300 second(s). Prevent this block from being reactivated. Group: TL Comment: TL 3 Trigger Event: Time limit 3 has expired. Responses: Display "15 Minutes remaining....." to all players. Set Time limit 2 to expire in 300 second(s). Prevent this block from being reactivated. Group: TL Comment: TL 2 Trigger Event: Time limit 2 has expired. Responses: Display "10 Minutes remaining....." to all players. Set Time limit 1 to expire in 300 second(s). Prevent this block from being reactivated. Group: TL Comment: TL 1 Trigger Event: Time limit 1 has expired. Responses: Display "5 Minutes remaining....." to all players. Set Time limit 0 to expire in 180 second(s). Prevent this block from being reactivated. Group: TL Comment: TL 0 Trigger Event: Time limit 0 has expired. Responses: Display "2 Minutes remaining....." to all players. Set tough luck to expire in 120 second(s). Enable the Tough Luck script blocks. Set tough luck to true. Prevent this block from being reactivated. Group: Tough Luck Comment: End Trigger Event: Time limit 0 has expired. Responses: Continue executing responses if (The state of tough luck). Display "Time is up!!!!!" and register mission failure. Prevent this block from being reactivated. Group: <Default> Comment: OBJ 01 Trigger Event: All actors in Opp Forces have been killed. Responses: Mark Objective 1 complete in the objective list. Disable the TL script blocks. Continue executing responses if (The state of tough luck). Set tough luck to false. Prevent this block from being reactivated.timer_script.zip Quote Link to comment Share on other sites More sharing options...
Zeealex Posted December 23, 2011 Author Share Posted December 23, 2011 thank you tinker! Quote Link to comment Share on other sites More sharing options...
RileyFletcher_01 Posted December 23, 2011 Share Posted December 23, 2011 Or more simply..... When you want the timer to initiate, enable the group e.g. 'Timer Group'. Make these blocks; Group: Timer Blocks Trig: 1 second elapsed Resp: BlockPreserve CounterDecrement (Counter - Time Left) DisplayMessageAll (Get value of Counter - Time Left + seconds left.) Group: Timer Blocks Trig: 1 second elapsed Resp: BlockPreserve ContinueIf (Value of Counter - Timer is equal to 0) GroupDisable (Timer Blocks) Put your fail block to be enabled or set a fail timer or however you want to end the mission Group: Timer Blocks Trig: The objective is completed Resp: GroupDisable (Timer Blocks) Mark the objective done That's just off the top of my head, so it may need a couple of edits, but I've done stuff like this before. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.