OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Jim666 on 09 May 2005, 14:49:26

Title: Finding an object and using it
Post by: Jim666 on 09 May 2005, 14:49:26
I had an idea for a mission. The idea was to look for an object, like a key for example. you find the key, and pick it up. (But you dont as its not actually an object)

You then have to use this key to unlock a vehicle for example?

I'd appreciate some help with this.
Title: Re:Finding an object and using it
Post by: macguba on 09 May 2005, 14:54:37
This occurs in .... I think its one of the Red Hammer missions, where you are driving Angelina in the lorry and you are ambushed.   Anybody?

If we can figure out what mission it is you can unpbo it and see how it was done.    There are several possibilities.    Triggers and addAction commands are the most likely.
Title: Re:Finding an object and using it
Post by: Jim666 on 09 May 2005, 14:57:44
I do think it is that mission ,where you go find that civillian in the house and he gives you key, I shall have a look when i get back from college.

I'd still aprreciate any help if anyone has a script for it.
Title: Re:Finding an object and using it
Post by: Jim666 on 09 May 2005, 16:43:35
Ok, ive unpbo'd the mission, and it seems pretty understadable to work it out for myself.
Title: Re:Finding an object and using it
Post by: macguba on 09 May 2005, 16:50:56
:thumbsup:
Title: Re:Finding an object and using it
Post by: RujiK on 09 May 2005, 20:16:16
I have made a mission like this a long time ago, I gave the player an "Examine" action which checked the ground for whatever objects, also its very basic scripting, here it is:


Code: [Select]
User action ["Rearm",User]
~1
?(User distance Key_Pos < 5):Goto"FoundKey"
titletext ["Nothing Here...","Plain Down",0.3]
exit

#foundkey
titletext ["You found a key! YEEEE-HAAAW!","Plain Down",0.3]
;then make whatever you want to happen here, such as make a vehicle unlock.
;also you will need to delete the Key_Pos as to prevent the player from finding the key over and over.