OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: NoMore on 25 Jul 2009, 13:28:05

Title: How to lock driver's seat only? SOLVED
Post by: NoMore on 25 Jul 2009, 13:28:05
Ok, I'm making a rescue mission where the player is sitting in the Rescue Raft from FDFmod. He is sitting in the cargo and it is important that he cannot use the action "To driver's seat".
It is also important that he can get out of the raft and the get in the cargo again still without entering the driver's seat.

Is this possible?  ???
NoMore
Title: Re: How to lock driver's seat only?
Post by: bedges on 25 Jul 2009, 13:53:32
Take a look at the Get In event handler. That combined with unAssignVehicle should do what you need.  :good:
Title: Re: How to lock driver's seat only?
Post by: NoMore on 25 Jul 2009, 14:53:03
I'm sorry but I'm not really good at scrips though I understand the basics.  :confused:
Can you please explain what you mean? I checked the Bohemia Interactive Wiki but still don't understand...

Thank you for such quick answer.  :)
NoMore
Title: Re: How to lock driver's seat only?
Post by: bedges on 25 Jul 2009, 16:29:31
See attached missionette.
Title: Re: How to lock driver's seat only?
Post by: Walter_E_Kurtz on 25 Jul 2009, 22:52:19
As long as no-one else has to get into the driver's seat ... (and even then it would be possible with some scripting) ...

Make sure the empty lifeboat is named, say hellosailor.

Then just place a GameLogic (side: Game Logic ---> Objects ---> GameLogic) and write in the init line:
Code: [Select]
this moveInDriver hellosailor

Game Logics - your invisible friends!
Title: Re: How to lock driver's seat only?
Post by: haroon1992 on 26 Jul 2009, 06:22:23
If you only want your player or the guy who is hurt not to enter as driver ,you will need a checking trigger.
Put these in the trigger.
Code: [Select]
axis a /b : 0
activation : Any body
Repeatedly
Not present
type : none
Condition :  nameofguy == driver nameofvehicle
On Activation :nameofguy action ["eject",nameofvehicle]

I think this one will work(it worked for me)
Everytime you (as player) entered the vehicle,then he will be pumped out from the seat.

If you want to use with AI,please do the following,
On the init line of the vehicle,type :
Code: [Select]
nameofguy assignascargo nameofvehicle
Remove the get in waypoint (if you have one) and place a "move" WP near the vehicle.
In the On Activation of the WP,type :
Code: [Select]
nameofguy ordergetin true
I think that solves your problem
Haroon1992..............
Title: Re: How to lock driver's seat only?
Post by: NoMore on 26 Jul 2009, 09:31:49
Thank you so much every one!
I think Walter's way is the easiest though. I didn't even know you could use game logics like that..
Must remember to look at a game logic tutorial some time.  ;)
NoMore