Home   Help Search Login Register  

Author Topic: Adding script to addon  (Read 623 times)

0 Members and 1 Guest are viewing this topic.

Offline KevBaz

  • Members
  • *
Adding script to addon
« on: 25 Nov 2002, 20:12:36 »
How do ya do it? do you add a line in the cpp?

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Adding script to addon
« Reply #1 on: 26 Nov 2002, 22:18:20 »
No.  Just put it in the addon folder, and pbo it up.  call it:
[] exec "\AddonName\scriptname.sqs"
of course, it's good practice to give scripts their own subdirectory.
So in the mine pack we have:
[] exec "\CoCMines\scripts\InitMines.sqs"

to start it with an object's initialization, you put in the config.cpp:

Code: [Select]
class EventHandlers
      {
         init = "_this exec {\AddOnName\scriptname.sqs}";
      };

Note that this will only work on the machine the object is local to.  If you want all MP machines to run a script, you need to put a call in the init.sqs file.
Dinger/Cfit