Jump to content
ColonelKernel

Make a script run in every mission

Recommended Posts

Hi.

How can I make a script run in every mission (without editing the mission of course). Just like what addons do.

Share this post


Link to post
Share on other sites

With an addon including your script (and adding an eventhandler to start it). If you are not restricted in addons you can use, I recommend CBA for simpler setup and compatibility with other addons.

 

There was a way of adding script execution permanently to the ui namespace but it got exploited and was removed from the game.

Share this post


Link to post
Share on other sites
42 minutes ago, NeoArmageddon said:

With an addon including your script (and adding an eventhandler to start it). If you are not restricted in addons you can use, I recommend CBA for simpler setup and compatibility with other addons.

 

There was a way of adding script execution permanently to the ui namespace but it got exploited and was removed from the game.

Thank you for your reply.

But how do I do that exactly? (I mean adding the eventhandler)

 

P.S: In case it's necessary, here is the script that I want to turn into an addon (Soldier Tracker):

http://www.armaholic.com/page.php?id=26993

Share this post


Link to post
Share on other sites

So here is what I did:

I created a config.cpp file and inserted this code:

class CfgPatches {
	class ST {
		units[] = {""};
		weapons[] = {""};
		requiredAddons[] = {CBA_MAIN};
	};
};

class Extended_PostInit_EventHandlers 
{
	st_Init = "_ok = [] execVM '\ST\QS_icons.sqf'";
};

(ST is the name of the pbo file) Then I put the QS_icons.sqf and config.cpp files next to each other and created the pbo file.

But still nothing happens. Any idea what's wrong?

Share this post


Link to post
Share on other sites

Hey bro, i'm no expert just a noob, but this is what I did in my addon. Hope this can help, but if it's not then I'm sorry for that ;)


class Extended_PostInit_EventHandlers 
{
class SFTacticalSupport
    {
        clientInit = "call compile preprocessFileLineNumbers '\SFTacticalSupport\init.sqf'";
    };
}; 

Edit:
Sorry forgot to add, the required addon: CBA_Extended_EventHandlers

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, palatine said:

Hey bro, i'm no expert just a noob, but this is what I did in my addon. Hope this can help, but if it's not then I'm sorry for that ;)


class Extended_PostInit_EventHandlers 
{
class SFTacticalSupport
    {
        clientInit = "call compile preprocessFileLineNumbers '\SFTacticalSupport\init.sqf'";
    };
}; 

Edit:
Sorry forgot to add, the required addon: CBA_Extended_EventHandlers

Thanks. After messing around with it for a while, here's what I did and it did the trick!

class CfgPatches {
	class SoldierTracker {
		units[] = {}; 
		weapons[] = {}; 
		requiredAddons[] = {"Extended_EventHandlers"}; 
		requiredVersion = 0.1; 
	}; 
};

class Extended_PreInit_EventHandlers {
  ST_Init = "ST_Init_Var = [] execVM ""\ST\QS_icons.sqf""";
};

 

Share this post


Link to post
Share on other sites

Vanilla A3 with no addon dependency.

class CfgPatches {
	class QS_SoldierTracker {
		units[] = {}; 
		weapons[] = {}; 
		requiredAddons[] = {}; 
		requiredVersion = 0.1; 
	}; 
};

class CfgFunctions {
	class ST {
		class soldierTracker {
			class InitIcons {
				file = "\ST\QS_icons.sqf";
				//suspension allowed, although long term will halt mission execution
				//if needed spawn/execVM thread inside of file instead
				postInit = 1;
			};
		};
	};
};

 

 

  • Like 1

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

×