Jump to content

How to get an init file to load from PBO??


Darth_Rogue

Recommended Posts

Ok so I'm sure this will probably be a silly noob question but here goes anyways....

 

I'm tinkering with an AI package and trying to get it to run from a pbo on the server side.  It requires that I call an init.sqf file to start the addon, but I can't figure out where to call the init from.  I've tried putting the init load command in the mission file (which generates errors and a pubvar kick) and also tried putting it in one of the hpp files, which causes it to not load at all.  

 

Ideas??

Link to comment
Share on other sites

  • 2 weeks later...

#1.

Any init.sqf inside the mission file (missionname.island.pbo) gets executed on mission start by the client and server.

You then need a check like: if(!isDedicated)exitWith{}; or if(hasInterface)exitWith{}; to prevent clients from executing the code below this line.

Check this list to see which files get executed when and where (client or server):

https://community.bistudio.com/wiki/Event_Scripts

#2.

You don't need to start a Addon via an external script.

Check out this little example addon that auto executes its own init.sqf on mission start: a3autoexec_addon.zip

Greez KiloSwiss

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...