Home   Help Search Login Register  

Author Topic: Scripts in addons??  (Read 934 times)

0 Members and 1 Guest are viewing this topic.

Offline paddy

  • Contributing Member
  • **
  • Llama whipping good
Scripts in addons??
« on: 20 Sep 2005, 10:51:20 »
Hey guys.  I've noticed a number of addons containing scripts.  Being completely new to addon making and atm just messing about with configs I was very interested to discover how these 2 files (scripts and addons) were linked

1) Can an addon launch a script contained in the PBO file?
2) Can you add EH's automatically to an addon unit from inside the PBO file
3) Can an EH launch a script contained within a PBO file?
4) Can a config launch a script

If anyone could shed some light on this area for me I'd be very grateful

Thanks

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Scripts in addons??
« Reply #1 on: 20 Sep 2005, 19:20:26 »
Quote
1) Can an addon launch a script contained in the PBO file?
2) Can you add EH's automatically to an addon unit from inside the PBO file
3) Can an EH launch a script contained within a PBO file?
4) Can a config launch a script
1) Yes. Via eventHandler(s) or userActions (or #define) in the config. A model itself can't execute any scripts....

2) Yes. This is done in the config by defining class eventHandlers to what unit you like, and which eventHandler you like (init, fired, killed, hit, etc..)

like:
Code: [Select]
       class EventHandlers
      {
         init="_this select 0 exec ""\MyAddOn\init.sqs""";
         };


3)Yes.
The scripts can be in the .pbo's 'root', or in subfolders...
You will use paths like [this] exec "\My_Addon\scripts\script.sqs" to execute them...

4)Yes. With #define
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.