Jump to content
whatsupdoc_1_27

selectRandom not working or something else...

Recommended Posts

I'm hoping somebody that does some scripting in Wasteland can help me out on this because it does not make any sense that its not working.

 

I wanted to setup random Territories  in Wasteland. In the root directory there is a file called config.sqf. In this file is this line:

 

config_territory_markers = compileFinal preprocessFileLineNumbers "mapConfig\territories.sqf";

 

So what AgentRev did for me was to come up with a way to randomly call multiple territory.sqfs. This way I will have different territories in each territory.sqf.

 

Here is the script that replaced the above:

 

_territoryFile = selectRandom ["territories1", "territories2", "territories3"];
config_territory_markers = compileFinal preprocessFileLineNumbers format ["mapConfig\%1.sqf", _territoryFile];

 

So I have territories1.sqf, territories2.sqf and territories3.sqf located in the mapConfig directory.

 

The problem I (WE) are having is that the selectRandom code above works but what is happening is the territory markers are still being placed on the map for some odd reason. No these territories will not activate but the marker and flag on showing on the map. The only thing I can think of that is causing this is something is being called/created/executed before the above script or config.sqf is being called. I say this because in the RPT you can see the territory marker being created then  deleted even though they are still being shown on the map:

 

16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_0_SOUTH_RIEDELBACH_RUINS_A'. Deleting it!"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_0_RIEDELBACH_APARTMENTS_B'. Deleting it!"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_0_RIEDELBACH_LUMBERYARD_C'. Deleting it!"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_1_DORFWEIL_NE_RUINS_A'"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_1_DORFWEIL_EAST_WAREHOUSES_B'. Deleting it!"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_1_DORFWEIL_CHURCH_C'"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_2_WINTERMUHLE_EAST_FACTORY_A'. Deleting it!"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_2_WINTERMUHLE_RUINS_B'"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_2_WINTERMUHLE_OLD_BARN_C'. Deleting it!"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_3_SCHWALBACH_APARTMENTS_A'"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_3_SCHWALBACH_APARTMENTS_B'. Deleting it!"
16:16:37 "WARNING: No config_territory_markers definition for marker 'TERRITORY_3_SCHWALBACH_CONSTRUCTION_C'"

So if you see a territory marker that was created but it was NOT deleted then they work fine. But the ones that shows "Deleting it! actually is not deleting the marker and flag itself just the trigger to activate he marker. Keep in mind these markers are created dynamically by script not in Eden. I only use Eden to get POS and SIZE of the markers.

 

Now, in the init.sqf there is a line that reads:

 

call compile preprocessFile "mapConfig\territories\init_external.sqf";

The above init_external.sqf that #includes each territory file that is in that directory.

 

Its it possible that Arma 3 server is actually loading the above init_external.sqf first instead of randomly loading :

 

_territoryFile = selectRandom ["territories1", "territories2", "territories3"];
config_territory_markers = compileFinal preprocessFileLineNumbers format ["mapConfig\%1.sqf", _territoryFile];

Any help is appreciated...

 

Doc

 

Share this post


Link to post
Share on other sites

are the territories identified as "territory1" or "territory1.sqf" in script. I'm not quite sure what your full setup is like here, just throwing ideas out there. 

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

×