Jump to content
Sign in to follow this  
Fiodor

Expanding the editor via Addon Module

Recommended Posts

Hi, name's Fedor and I'm trying to add some functionality to the editor via-module that would save a lot of time for editors of my community.

It's the first time I try any kind of scripting in Arma and it took a great deal of keyboard-to-head to get to where I am... So, here's where I'm at:

I have an editor module (functioning as per the step by step this link) that has a couple arguments, like this:

class Arguments: ArgumentsBaseUnits
{
class [b][color="#B22222"]Units[/color][/b]: Units {}; 

class [color="#000080"]SampleArgument[/color]
 	{
	displayName = "Some data"; // Argument label
	description = "Some data I want to use"; //
	typeName = "STRING"; //type of the arg
};

[indent](...)[/indent]


};

And myModuleFunction, that is called when the Editor Module is initiliazed in the game:

// ???? aparently this is the triggering entity
_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;

//synced units, these units are the ones declared in the [b][color="#B22222"]Units[/color][/b] in the Arguments class in the Editor Module
[b][color="#B22222"]_units[/color][/b] = [_this,1,[],[[]]] call BIS_fnc_param; 

_activated = [_this, 2, true, [true]] call BIS_fnc_param;

if (_activated) then 
{
//magical stuff happens with the info 
};

So my question is... how would I go about accessing from the function (myModuleFunction) custom defined arguments, such as SampleArgument (as declared in the editor module class) ?

The way I see it, you can define custom variables in the editor module so there should be a way to access them.

I have yet to see an addon like this. So... is this even possible ?

Edited by FedorSFS

Share this post


Link to post
Share on other sites

Use the logic variable:

_logic getVariable "SampleArgument";

Share this post


Link to post
Share on other sites
Use the logic variable:

_logic getVariable "SampleArgument";

Thank you very much!

Did I miss any documentation in bi wiki, or is this something you knew out of experience?

I'd like to know if there's any additional information sources that I missed, so in the future I can answer my own questions, instead of just researching here and there, only to end up asking in the forums.

Share this post


Link to post
Share on other sites

I figured out from another Arma coding friend of mine, I had the same issue you did for days until I talked with him, I don't believe this info is on the wiki, should probably be added, but I'm too lazy to add it myself.

Share this post


Link to post
Share on other sites

Thanks, I've added that the function example in the step-by-step guide so that there's at least an example of that.

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  

×