Jump to content
Sign in to follow this  
mindbl4ster

Loading Modulfunctions without placing the Modules

Recommended Posts

hi guys,

so here is the thing:

i want to build a mission without mod dependencies. but i want to call the functionallities of mods when the mod is detected by a function. so e.g. when the user has cse running the mission should call the medic system without the need to place the module. so basiclly i need to somehow call the functions/runtimes or whatever with my init.sqf but the modules are coded in classes and i have no clue how to handle that :(

would be very kind if someone could help me with that either giving me something like a tut or solving the prob right away ;)

thanks!

Share this post


Link to post
Share on other sites

Check if the cse cfg exists and then call the fnc. I'm on the phone and i can't post the exact code

Share this post


Link to post
Share on other sites

You are looking for something like this:

if (isClass (configFile >> "CfgPatches" >> "CSE_CONFIG_NAME")) then {
YOUR CODE
};

To get the config entry, start CSE and click on configs in the 2d editor.

However, I would suggest you to just ask in the CSE thread, they easily help you out.

Share this post


Link to post
Share on other sites

thanks for your reply. but i tried it in cse forum before just did not get an answer :(

but to clarify things the part with the isClass command i already had. the tricky part is the "YOUR CODE" part. i somehow need to define parameters and call the cse framework. and i don't know how to do it the proper way :(

Share this post


Link to post
Share on other sites

The modules work by calling a function. Any of the options set in the editor module window is saved to the module via setVariable. I dont know any of the CSE module/functions but it would work something like this.

[color="#FF8040"][color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]isClass[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]configFile[/b][/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"CfgPatches"[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"CSE_CONFIG_NAME"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
[color="#191970"][b]private[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"_grp"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_pos"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_logic"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"_fnc"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#1874CD"]_grp[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]createGroup[/b][/color] [color="#000000"]west[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// group for logic/module[/i][/color]
[color="#000000"]_pos[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// position for logic/module[/i][/color]
[color="#1874CD"]_logic[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#1874CD"]_grp[/color] [color="#191970"][b]createUnit[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Logic"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]_pos[/color][color="#8B3E2F"][b],[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"NONE"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// "Logic" or "Logic_F" - cant remember[/i][/color]
[color="#1874CD"]_logic[/color] [color="#191970"][b]setVariable[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"CSE_FUCTION_SOMEVARIABLE"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// set variables[/i][/color]
[color="#1874CD"]_logic[/color] [color="#191970"][b]setVariable[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"CSE_FUCTION_SOMEVARIABLE"[/color][color="#8B3E2F"][b],[/b][/color][color="#FF0000"]2[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#1874CD"]_logic[/color] [color="#191970"][b]setVariable[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"CSE_FUCTION_SOMEVARIABLE"[/color][color="#8B3E2F"][b],[/b][/color][color="#000000"]west[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#1874CD"]_fnc[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_logic[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] CSE_fnc_SomeModuleFunction[color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// call module function[/i][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

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  

×