OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods Beta Testing => Topic started by: paddy 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
-
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:
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