Jump to content
Sign in to follow this  
Redphoenix

Calling a script out of a config

Recommended Posts

So, Lappihuan made me a neat little script and I wanted to include that into my addon.

The thing is, I want to call it right from the start out of the config.

So I added the script into the function library with the following code:

class CfgFunctions
{
class RVE
{
	class RVE_smoke
		{
		class heliSmokeAction {file = "\Refined_Vehicles\rve_blufor\littlebird_refined\scripts\heliSmoke.sqf";};
		};
};
};

It seems to work, if I open the function library ingame it is shown as active.

Proble is right now:

How to call this? I have no idea how scripting eca works, but I know that inside a config you can pre-set the init line of a unit with an EventHandler inside cfgVehicles.

It's looking like that right now:

		class EventHandlers 
	{
	init="blablabla";
	};

My own problem simply is: how do I properly call this function, or the script? Lappi and I tried several things, but none of them worked...

It worked tho when we just entered that in a mission and stuff....

You can find this script hear (it's WIP) - https://dl.dropboxusercontent.com/u/84370332/scripts_smoke.rar

The password is my username.

Cheers:

ps: Sorry for the derpy explanation. I think (hope :D ) Lappi can shed some light later.....

Share this post


Link to post
Share on other sites

Will calling it from the init eventhandler work?

Abs

Share this post


Link to post
Share on other sites

That is the problem. We couldn't get it to work, but we do hope it's does...

Share this post


Link to post
Share on other sites

I will try to explain it a little bit more.

What i have done in the test mission:

(everything just examples)

Init of Heli:

this addEventHandler ["GetIn",[x,y,z] call myFunction1];

myFunctionFile.sqf:

(that is included in the init.sqf)

myFunction2 =
{
//do some stuff
call myFunction3;
};

myFunction1 =
{
//do some stuff
call myFunction2;
};

and so on.

Now when we want to have this in the addon so the EventHandler "GetIn" fires in any mission when the addon is loaded, we need to make those functions known to prevent the "#include "myFunctionFile" for every user in every mission.

This would require to add those Functions to the function library.

But there are some things unclear for me.

When i have 5 functions in one file, do i need to create 5 seperate files to add them to the function library?

class CfgFunctions
{
class myTag
{
	class myCategory
	{
		class myFunction1 {file = "myFile1.sqf";};
		class myFunction2 {file = "myFile2.sqf";};
		class myFunction3 {file = "myFile3.sqf";};
		//etc...
	};
};
};

Or can i let them in one file?

class CfgFunctions
{
class myTag
{
	class myCategory
	{
		class myFunction1 {file = "myFile.sqf";};
		class myFunction2 {file = "myFile.sqf";};
		class myFunction3 {file = "myFile.sqf";};
		//etc...
	};
};
};

Or do i miss something completly here?

That i need to call the function like:

call myTag_fnc_myFunction1:

is clear to me.

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  

×