Jump to content
Sign in to follow this  
takealready

help with INIT

Recommended Posts

What is the proper format for an init (like in ofp's eventhandlers)? I've tried ofpec forum and wiki and still I can't find an answer.

Where does it go in the cpp?

I don't get an error message (when I start arma) and when the addon loads in the game..nothing happens.

This is what I have:

class EventHandlers

{

init = [_this] execVM "\Spboats\scripts\common_init.sqs";

};

I'm trying to master arma's new style of init so that I can write a random weapons sqf for my soldiers I'm porting to arma. I had one on my ofp soldiers that worked perfectly.

Thanks in advance for someones expret advice.

Share this post


Link to post
Share on other sites

Its the quote inside that are different and i dont think you need the [] with _this

class EventHandlers

{

init = "_this execVM ""\Spboats\scripts\common_init.sqs""";

};

Edit ,it goes there

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class MYSaboteurbc1: SoldierWSaboteur

{

scope = 2;

displayName = "Spec Op ";

vehicleClass="MY_Addons";

weapons[] = {"M4A1SD","M9SD","Throw","Put","NVGoggles"};

magazines[] = {"30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD"};

class EventHandlers

{

init = "_this execVM ""\Spboats\scripts\common_init.sqs""";

};

};

or try what madmatt sugested for easier future additions

Share this post


Link to post
Share on other sites

If you're going to add custom eventhandlers to your addon, please use the extended eventhandler addon by Solus. That way your addon can still inherit eventhandlers from mods as well as have it's own.

Look here for more info.

So far several addons and mods are using it, including mine.

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  

×