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.

How to become bullet Proof

Go down

How to become bullet Proof Empty How to become bullet Proof

Post by TheGeneral Mon 19 Aug 2013, 14:25

This is a quick run through of using the function; OFP:setInvulnerable()


You set it in the code at the start of your mission.

the first line would read



Code:
function onMissionStart()

then your following code/events that you want to have occur at the very beginning of the mission is written in this chunk.

so if you want to have yourself invulnerable all the way through the mission your next line would be:



Code:
OFP:setInvulnerable("unitName", true)

"unitName" would be the name our your unit as default or what ever you change it too. You can also set your whole echelon to true by using the echelon name if you wanted.

Then you would follow up within the next lines whatever events you wanted to have happen.

Not forgetting to close the chunk with an end keyword.

If you want to reverse the invulnerabilty you would then whereever you wanted it to have happen, change the boolean to false.

example: you completed an objective, you then enter a trigger zone.



Code:
function onEnter(zoneName, unitName)  
    if zoneName == "triggerzone" then     
       OFP:setInvulnerable("unitName", false)  
         end
end
Hope that helps!
TheGeneral
TheGeneral
Admin

Points : 780
Reputation : 35
Join date : 2012-12-15

http://maniacaldog.wix.com/keepdralive

Back to top Go down

Back to top


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