Jump to content
Sign in to follow this  
Double Doppler

Executing an SQF file from config

Recommended Posts

I have an addon, and I want an initialization script to be run, how would I execute it from the config? I dont want any external script files - my addon should be easy to install with no external files and mission editing knowledge required for the user.

I have used "Class Eventhandlers" and added it to my weapon's class in CfgWeapons - the path and syntax are correct, but for some reason nothing happens.

I tried adding the script to a game logic init in-game and it DID work, however I cant seem to get it to work using the Cfg Eventhandlers.

Share this post


Link to post
Share on other sites

cfgWeapons doesn't support eventhandlers. Either you create a module that has to be placed (on which the EH would work) or you make use of the extended Eventhandlers from CBA which then would make your addon dependent on CBA. IMHO that's a small downside since there are already quite a lot addons which require CBA so it wouldn't mean too much hassle.

I stand corrected by Synide

Edited by [FRL]Myke

Share this post


Link to post
Share on other sites

So there really isn't a way to get a script to initialize straight from the addon file? (Without external module execution or dependency on other addons.)

Share this post


Link to post
Share on other sites

Not that i know of, no.

I stand corrected by Synide ;)

Edited by [FRL]Myke

Share this post


Link to post
Share on other sites
Myke;2198754']cfgWeapons doesn't support eventhandlers.

Since when? It used too' date=' has something changed? I mean some 'eventhandlers' are ofcourse meaningless in certain 'simulation' types but for instance a 'fired' eventhandler in a CfgWeapons.YourWhizzyClass.EventHandlers should work fine.

But sticking a 'fired' eventhandler into a 'building' simulation would obviously be incorrect.

I have used "Class Eventhandlers" and added it to my weapon's class in CfgWeapons - the path and syntax are correct, but for some reason nothing happens.

Perhaps if you post your excerpt from your config someone might suggest what the problem is...

-Sy.

Share this post


Link to post
Share on other sites

Hmm not sure event handlers work in cfg weapons ,

They do work on the unit or vehicle that is firing that weapon Though ,

Even muzzle flash and any other effects tied to a weapon are usually given a define in the ammo and captured by an event handler attached to the unit firing or vehicle firing iirc.

In summary add the fired eventhandker to the vehicle or unit in cfg vehicles , as suggested extended event handlers is a good system to ensure compatibility for public era

Lease addons .

Share this post


Link to post
Share on other sites

Yeah, sorry true... memory isn't the best nowadays... was having a senior moment 'tween vbs2 functionality & oa functionality.

-Sy

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×