Jump to content
TomOZ

Variables in Description.ext CfgORBAT?

Recommended Posts

Hi All,

 

I have a question regarding the status of reading in variables into a Description.ext file for a mission, specifically a profileNamespace variable that a player will have saved in the mission previous.

What I am trying to do is have a dynamically updating ORABT class/module system that illustrates vehicles based upon if they were destroyed in a previous mission.

 

During the first mission, the play can choose to destroy or leave enemy vehicles alive, and at the end of the mission a variable is created that saves all existing vehicle entities into an array.

This array is then filtered (using joinString) to remove the "" (String elements) and essentially make it into an array of objects (plain class names) each separated by a single comma (,) mark.

 

In the next mission, the Description.ext file pulls in this variable and attempts to pass the variable in place inside the CfgORBAT class - specially for the assets[] array in a sub-class.

 

This is what the Description file looks like, explaining what i mean by passing a variable. I want it to illustrate the passed in vehicle classes int he ORBAT viewer, however it just displays NO vehicles instead.

I don't even know if this is allowed, which is basically why im posting it here. 

Edit: LINK https://imgur.com/a/PinvUcN

 

Am i just wasting my time?

Hopefully someone can help me here. Cheers, Tom. 

  • Like 1

Share this post


Link to post
Share on other sites

Answer to updating ORBAT groups: 

Have you seen https://community.bistudio.com/wiki/BIS_fnc_ORBATSetGroupParams?

 

Answer to variables in configs (description.ext, config.cpp):

So, coming from UI config making: It is possible, in some cases, to have strings instead of numbers: https://community.bistudio.com/wiki/CT_STATIC#tileH. The string just gets evaluated as an sqf expression at some point (probably when opening the UI). BUT this does not apply to all config strings! For example, the text attribute is not interpreted as an evaluable string. For sqf arrays in configs: 95% sure that they can't be used interchangeably. Configs are very static, which is the purpose of them.

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi 7erra, 

 

Thanks for your response about my questions.

 

That link you sent for the SetGroupParams seems to be what I should use, and will work perfectly if I can figure out how to implement that into a mission - as the example isn't very helpful, it even has the wrong 'call function' at the bottom. So I was wondering if you know how to implement it with the CfgORBAT groups? I attempted to use the syntax and execute it into the debug console with all fields the same as a group I have already set in CfgORBAT, but It threw an error about 'received Number, expected Config' - almost like it doesn't know what and where i am targeting? Am i meant to target the function, because the syntax doesn't have it. Strange.

 

As for the Description.ext and configs, yeah that's practically what I thought - configs being almost entirely static and 'pre-determined' with limited evaluations and functionality to read in variables, etc - but I just wanted to check. SO thankyou for letting me know your thoughts on that too 🙂

Cheers again, Tom. 

 

EDIT: Solved Below

 

Figured out how to implement the function, there was an error with the wiki page, the syntax expects a 'target config line' as the first element in the syntax, which isn't stated currently - So once i added that alongside all other elements for proper syntax it worked perfectly - Thanks again 7erra for your help, an oversight from me not to visit all options on the wiki including functions before I posted here. 🙂 Cheers, Tom

 

This is the syntax i used in the debug console to execute the function:

 


missionConfigFile >> "CfgORBAT" >> "1stOLS" >> "1stLSP",   // This first entry target config line isn't stated as required on the Wiki syntax, but it is indeed needed.
2, 
"Platoon",  
"Support",  
"East",  
"%1 Logistical Support %3",  
"%1 OLS %3",  
"o_support",  
1,  
"",  
[0,0,0,1],  
"Demir",  
"Lieutenant",  
"Second logistical support platoon in the Operational Logistical Support Division. Recently stationed at Porto for watchover and transportation of mechanized assets - since the failure to protect the BMP's, he has been suppplied further motorized support for ongoing protection of Porto. It is suspected The platoon will soon be recalled and withdraw.",  
[ ["B_MRAP_01_F",5] ]
] call BIS_fnc_ORBATSetGroupParams;

Edited by TomOZ
Solved

Share this post


Link to post
Share on other sites

Huh yeah. I had a look at the function header ingame and it is wrong too. Corrected the BIKI page though. I have close to 0 experience with ORBAT, so good that you could solve the issue 😄

  • Thanks 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

×