Home   Help Search Login Register  

Author Topic: Where to put scripts?  (Read 972 times)

0 Members and 1 Guest are viewing this topic.

PubicWarrior

  • Guest
Where to put scripts?
« 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?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Where to put scripts?
« Reply #1 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.
"When 900 years YOU reach, look as good you will not!"

Re: Where to put scripts?
« Reply #2 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
? (this == thinkable) : this = scriptable

PubicWarrior

  • Guest
Re: Where to put scripts?
« Reply #3 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

Offline Kronzky

  • Members
  • *
    • My OFP/VBS Scripts/Missions/Addons
Re: Where to put scripts?
« Reply #4 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.