Home   Help Search Login Register  

Author Topic: run scripts  (Read 1672 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
run scripts
« on: 26 Sep 2005, 18:03:08 »
okay im kind of creating an addon more like editing one but ive struck a problem
ive got an addon wich is just a few scripts how can i get one script called init.sqs for example to run straight away once ofp has started ?
secondly how can i run scripts through the init.sqs ?
for example the path to run the script like
addons/myaddon.pbo/folder/script.sqs
i think thats how its done but im not sure i dont know anything about addons im just editing it to suit my own needs

any help would be great

Kyle Sarnik

  • Guest
Re:run scripts
« Reply #1 on: 26 Sep 2005, 20:49:12 »
For any CfgVehicle entry in a config, you can add eventhandlers. Using the init eventhandler, the script will execute (locally of course) for each unit as soon as it is created (or at the start of the mission). It looks like this:

Code: [Select]
      class Eventhandlers
      {
         init="_this exec {\path\script.sqs}";
      };

The path will allways start with a "\" if it is inside of a .pbo file. The rest of the path is simple, just treat the .pbo file as a folder.
« Last Edit: 26 Sep 2005, 20:50:16 by Kyle Sarnik »

Offline 456820

  • Contributing Member
  • **
Re:run scripts
« Reply #2 on: 27 Sep 2005, 17:58:59 »
thanks for that i think it seems to work so topic solved thanks

Offline 456820

  • Contributing Member
  • **
Re:run scripts
« Reply #3 on: 28 Sep 2005, 21:34:17 »
little prob does what you suggested run the script on vechiles aswell or just units ?

Kyle Sarnik

  • Guest
Re:run scripts
« Reply #4 on: 29 Sep 2005, 03:20:54 »
little prob does what you suggested run the script on vechiles aswell or just units ?

Oh please, don't make me have to answer this for you, re-read my post and you'll be able to answer yourself...