Operation Flashpoint Dragon Rising OFDR Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Using custom timers

2 posters

Go down

Using custom timers Empty Using custom timers

Post by TheTurkishMoose Sat 21 Nov 2015, 15:59

Hello, I'm new to the mission editor and have gone through all the help documents
I'm still struggling with the timers though

I've created my own timer which sets of once the player is spotted by enemies (it's a stealth mission). It lasts for 600000 (which should be 10 minutes right?)

After ten minutes, the mission is failed but I don't know how to write the function.
The timer is called "USAlerted"

Could someone tell me how I should write it so that when the USAlerted timer reaches 10 minutes, the mission fails

Thank you!

TheTurkishMoose

Location : England
Points : 6
Reputation : 1
Join date : 2015-11-19
Age : 28

Back to top Go down

Using custom timers Empty Re: Using custom timers

Post by runerback Mon 23 Nov 2015, 08:33

Do you mean after player is spotted by enemies 10 minutes later the mission failed? If it is, write some code like this:

Code:

function onIdentified( identifiedID, identifierID)
    --judge if player is spootted, if true
    OFP: addTimer( "USAlerted", 600000)
end

function onTimer_USAlerted()
    --the timer triggered
    OFP:missionFailed()
end

BTW, if you are using EDX, there are some better way to write codes.

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

Using custom timers Empty Re: Using custom timers

Post by TheTurkishMoose Mon 23 Nov 2015, 09:54

Thanks for the help runerback, that was exactly what I was looking for - the "function onTimer_USAlerted()" part particularly!




I'm not sure what EDX means, sorry. I'm using the default mission editor editing the leve.lua file. Could you explain what you mean please?

TheTurkishMoose

Location : England
Points : 6
Reputation : 1
Join date : 2015-11-19
Age : 28

Back to top Go down

Using custom timers Empty Re: Using custom timers

Post by runerback Tue 24 Nov 2015, 01:38

You can check it here:
Mission Editor Expansion

runerback

Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18

Back to top Go down

Using custom timers Empty Re: Using custom timers

Post by TheTurkishMoose Tue 24 Nov 2015, 12:36

Thaks runerback, completely missed this!

TheTurkishMoose

Location : England
Points : 6
Reputation : 1
Join date : 2015-11-19
Age : 28

Back to top Go down

Using custom timers Empty Re: Using custom timers

Post by TheTurkishMoose Thu 26 Nov 2015, 22:55

Okay so I had a look through all the EDX stuff and decided to just stick with the main editor. I know it talks about making mission making easier and more efficient, but I'm happier doing it the old fashioned way!

TheTurkishMoose

Location : England
Points : 6
Reputation : 1
Join date : 2015-11-19
Age : 28

Back to top Go down

Using custom timers Empty Re: Using custom timers

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum