OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: PubicWarrior on 23 Jun 2006, 10:28:45

Title: Where to put scripts?
Post by: PubicWarrior on 23 Jun 2006, 10:28:45
hi, well the name of the thread says it all, i have made an eject script and dont know where to ut it so it will work

any suggestions?
Title: Re: Where to put scripts?
Post by: Wolfrug on 23 Jun 2006, 11:05:53
Scripts are put in your OFP/Users/YourName/Missions/YourMission.island folder. You can also put the script in a subfolder withing the mission folder, but to call it you then need to use something like []exec "/ScriptFolder/eject.sqs" instead of just []exec "eject.sqs."

:) Hope that helps.

/Wolfrug out.
Title: Re: Where to put scripts?
Post by: Doktor Headshot on 23 Jun 2006, 11:09:08
You should put it inside the mission's folder and then, to make it work, you have to put the following command into the onActivation tab of a trigger or into the init field of an unit:

this exec "script.sqs"

this is the activator of the script: if there is no one who activate it or if you choose to activate it from a trigger you should replace this with []; therefore new line would be: [] exec "script.sqs"

"script.sqs" is the script you want to execute. Change script with your script's name. Is it eject.sqs? Therefore new line would be: this exec "eject.sqs".

I hope to have helped you, let me know how it ends.

Guido
Title: Re: Where to put scripts?
Post by: PubicWarrior on 23 Jun 2006, 12:43:45
thanks guys i know it was a n00by question but i have only just started editing altho i have had the game since it first came out, well those 2 osts have sorted it

thank you  ;D
Title: Re: Where to put scripts?
Post by: Kronzky on 29 Jun 2006, 07:02:03
If it's a script that you might end up using in all kinds of missions it might be a better idea to put it into a central script folder.

That way you don't have to copy it everytime you write a new mission, and if you should change it you don't have to worry whether you copied it to all the right places. You will also be able to use it in the editor immediately, as soon as you open a map - even if you haven't saved anything yet.

The folder is called \Script, and it should be located in your main OFP directory (where your .EXEs are).
By default it doesn't exist in OFP, so you will probably have to create it yourself.