Jump to content
Luft08

Mission has anomalous behavior on server

Recommended Posts

I have a mission that generates a scenario from about a half dozen types. However, after the players play a scenario and then start a new mission the variables etc are not destroyed and recreated but rather persist with old data.  For example we played a "Destroy the convoy" mission then after winning we get returned to the lobby and start the mission again. This time we get a "Hunt the AA" mission but the convoy Array from the last mission isn't cleared causing a ghost convoy to appear on the map. 

 

I have been ending each scenario with: BIS_fnc_endMissionServer but no joy.

Share this post


Link to post
Share on other sites
58 minutes ago, sarogahtyp said:

Just use _array = nil; to destroy it

 

I call a clearVariables.sqf file but no joy.

if(!isServer) exitWith {};

missionNamespace setVariable ["aaMarkerArray", nil];
missionNamespace setVariable ["activePlayerArray", nil];
missionNamespace setVariable ["ambientEIArray", nil];
missionNamespace setVariable ["ambushChance", nil];
missionNamespace setVariable ["ambushGroupArray", nil];
missionNamespace setVariable ["antiAirArray", nil];
missionNamespace setVariable ["bluforTroops", nil];
missionNamespace setVariable ["borderPatrolArray", nil];
missionNamespace setVariable ["bridgeID", nil];
missionNamespace setVariable ["bridgePosition", nil];
missionNamespace setVariable ["cachePrefix", nil];
missionNamespace setVariable ["campCount", nil];
missionNamespace setVariable ["camperGroups", nil];
missionNamespace setVariable ["campfireMarkers", nil];
missionNamespace setVariable ["campfires", nil];
missionNamespace setVariable ["cityNum", nil];
missionNamespace setVariable ["cityPrefix", nil];
missionNamespace setVariable ["cityWPCount", nil];
missionNamespace setVariable ["civRecordArray", nil];
missionNamespace setVariable ["clearAmbientDist", nil];
missionNamespace setVariable ["convoyArray", nil];
missionNamespace setVariable ["enemyGroupArray", nil];
missionNamespace setVariable ["enemyMissionTroopArray", nil];
missionNamespace setVariable ["fenceWaypointCount", nil];
missionNamespace setVariable ["gateMarkerArray", nil];
missionNamespace setVariable ["groupsEast", nil];
missionNamespace setVariable ["groupsWest", nil];
missionNamespace setVariable ["guardGroupArray", nil];
missionNamespace setVariable ["guardTowerOccupancy", nil];
missionNamespace setVariable ["maxAA", nil];
missionNamespace setVariable ["maxCacheLocations", nil];
missionNamespace setVariable ["maxCity", nil];
missionNamespace setVariable ["maxScenario", nil];
missionNamespace setVariable ["minDistForVehicle", nil];
missionNamespace setVariable ["riflemanArray", nil];
missionNamespace setVariable ["riflemanRatio", nil];
missionNamespace setVariable ["scenarioNum", nil];
missionNamespace setVariable ["southForestMarker", nil];
missionNamespace setVariable ["spotterChance", nil];
missionNamespace setVariable ["spotterTimer", nil];
missionNamespace setVariable ["startDistCache", nil];
missionNamespace setVariable ["tentArray", nil];
missionNamespace setVariable ["troopsEast", nil];
missionNamespace setVariable ["troopsWest", nil];
missionNamespace setVariable ["vehicleAreaEest", nil];
missionNamespace setVariable ["vehicleAreaWest", nil];
missionNamespace setVariable ["vehicleArrayWest", nil];
missionNamespace setVariable ["vehicleArray", nil];
missionNamespace setVariable ["vehicleOdds", nil];
missionNamespace setVariable ["vehicleRatio", nil];

 

Share this post


Link to post
Share on other sites

Ill not roll another dice  to realize that u knew the result already!

 

Show the problem instead of eplaining mysterious things which happen ... 

show code!

 

  • Like 1

Share this post


Link to post
Share on other sites
20 hours ago, sarogahtyp said:

Ill not roll another dice  to realize that u knew the result already!

 

Show the problem instead of eplaining mysterious things which happen ... 

show code!

 

The problem with showing the code is that I don't know what could be causing the behavior so I don't know what code to show. The mission file is almost 5 MB. I'd be glad to post the entire mission (if I knew how) with the understanding that this is my first real attempt and it is a work in progress.

 

There are other anomalies also. The ending triggers sometimes don't fire. Mostly they do but not always. Debugging would be so much simpler if they would either always work or always fail.  

 

I was hoping that someone knew of some code that I should be calling to totally reset a server prior to a new round beginning.

 

Also it may have to do with some players coming in late so that they don't get added to the activePlayers array.  Or maybe it's caused by people aborting out of a mission rather then letting it end normally.  Truthfully I haven't got a clue why things sometimes don't work but mostly do.

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

×