Jump to content
Sign in to follow this  
Rydygier

How to convert a script into auto-init pbo addon without CBA?

Recommended Posts

It is nothing wrong with CBA, on the contrary, usualy it is best solution, but sometimes there is a reason for avoiding such dependency. Till now all my addons are dependent on CBA and prepared like described here:

http://forums.bistudio.com/showthread.php?124589-how-do-you-make-a-script-into-a-mod

But now I have such reason to avoid that method. The only other ways to init a script via addon known to me is to add path to it as init in EventHandlers class of some objects, as logic (eg map placeable "module"), but this still needs to edit given mission for adding that object and activating script there (also there is possible messing with model's fsms, but this is another story).

What I need is a flexible solution, that will allow to init my pbo-ized script in any launched mission without editing it and without any additional dependency. How to achieve that? I tried to follow, how CBA auto-initialises itself, but I simply failed (for now at least, will dig more), as I now too little about configs and such.

Share this post


Link to post
Share on other sites

CBA uses extended event handlers (SLX) to init itself I believe. I haven't looked at it in details but I believe that extended event handlers overwrite all event handlers for some key classnames, with both the original event handle script and its own, that are pretty much guaranteed to be present. However, if this is indeed how it works then I don't recommend doing the same as you may then break CBA for those that use it / or using CBA may break your initialization.

You may want to look into the onLoad of RscMissionDisplay, however I don't know if that has a similar issue: http://forums.bistudio.com/showthread.php?132623-RscMissionDisplay-and-REVERT

Share this post


Link to post
Share on other sites

The best you can do is do what Muzzleflash suggested. Keep in mint though that since dedicated server (and I assume headless client as well) does not process UI the onLoad will not be triggered and your script will not be executed.

Share this post


Link to post
Share on other sites

OK, thanks guys, I'll study this.

Share this post


Link to post
Share on other sites

deleted

Edited by Tajin
woops, wrong Version

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  

×