Jump to content

Luft08

Member
  • Content Count

    204
  • Joined

  • Last visited

  • Medals

Everything posted by Luft08

  1. 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.
  2. 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];
  3. I'm writing a mission that randomly creates camp sites in forested areas. However, sometimes the spot picked to place campfires is sloped making the scene look stupid. Is there any way to ensure that objects are placed on level or near level ground? Thanks.
  4. When I run the following code the marker is created at [0,0,0] instead of the position specified: private _marker = createMarker["southForestMarker", [8926.676,5542.027, 0]]; southForestMarker setMarkerShape "RECTANGLE"; southForestMarker setMarkerAlpha 0; southForestMarker setMarkerSize [6000,6000]; southForestMarker setMarkerDir 0; I can move the marker with: southForestMarker setMarkerPos [8926.676,5542.027, 0]; But I don't understand why I need to do that.
  5. I have a script that creates a trigger which is suppose to fire when a player returns to base during a mission but it doesn't fire. private _position = [10433.3, 7237.693]; trg2 = createTrigger["EmptyDetector", _position]; trg2 setTriggerArea [68, 67, 90, true, 1.5]; trg2 setPos [10433.3, 7237.693, 5.5]; playerAtBase = { private _result = false; { if(_x inArea trg2) then { _result = true; }; } forEach activePlayerArray; _result }; trg2 setTriggerStatements["call playerAtBase", "[] execVM (missionPath + 'evaluatePerformance.sqf')", "nil"]; The activePlayerArray gets initialized earlier: activePlayerArray = call BIS_fnc_listPlayers; Any ideas why this fails? Thanks.
  6. I know that allowing the writing to a file in a game can be an incredibly dangerous security risk but what is the best way to capture debug information? A mission I am working on is quite far along and is really fun to play when all goes well but there are times when anomalous behavior pops up and without debug information I can't really track down the reason. Thanks.
  7. Luft08

    Fighting with my server

    I have been trying to get a dedicated server to run on the same PC that I play on so that I can test missions I am creating as a non-server. I'm getting close. The server starts and displays a list of missions and allows me to vote. It then places me in a lobby where I choose the slot I wish to play. Then is appears to load the mission but instead of starting it bounces me back into the voting screen with no error message. Also the server window shows the message: No entry 'bin\config.bin/CfgWorlds.gm_weferlingen_summer'. I did copy the GM folder from my client to the dedicated server but no joy. Does anyone know what could be happening? Thanks.
  8. I took a piece of code that Grumpy Old Man wrote and modified it to do what I needed. The modified code does indeed work. Now I would like to know why. Here is my modified code: { private _referencePos = _x; private _sortedByRange = [allMapMarkers,[],{_referencePos distanceSqr getMarkerPos _x},"ASCEND", {(_x select [0,3] == "wp_")}] call BIS_fnc_sortBy; _sortedByRange params ["_nearestMarker"]; private _townNameArray = _nearestMarker splitString "_"; private _wpPrefix = "wp_" + (_townNameArray select 1) + "_"; hint _wpPrefix; } forEach activePlayerArray; I wanted the code to get the closest marker that name begins with "wp_" which it does. I just don't understand this line: private _sortedByRange = [allMapMarkers,[],{_referencePos distanceSqr getMarkerPos _x},"ASCEND", {(_x select [0,3] == "wp_")}] call BIS_fnc_sortBy; In particular I don't understand where the "magic variable" _x is getting its data. It's not from the forEach which would return a player. I think its from the allMapMarkers but I don't know why as I don't see a looping structure.
  9. Thanks, I didn't know anything about "apply." I guess I still have a lot of learning ahead. Thanks again.
  10. Dedmen, You are a god! Thank you!
  11. I need to determine which side of the East/West German border a player is located on the Weferlingen summer map. I don't want the East Germans shooting across the border. At first I though I would use triggers but it takes a LOT of triggers to get the granularity I need. So I though I would bite the bullet and do some kind of ray trace and count the number of times the ray crosses the fence line. Odd number and they are valid targets, even and they are safe. However I don't know how to define the polygon from the fence/wall. Can code be written to do that automatically or must I painstakingly define each point by hand? Thanks
  12. I've watched several videos and read many posts about functions but I can't seem to get mine to work. description.ext: class CfgFunctions { #include "functions\cfgFunctions.hpp" }; cfgFunctions.hpp (inside a folder called functions): class cfgFunctions { class LFT { tag = "LFT"; class functions { file = "functions\functions.sqf"; class GetDistance {}; }; }; }; functions.sqf (inside the folder called functions): GetDistance = { params ["_object1", "_object2"]; private _distance = _object1 distance _object2; _distance }; inside the calling script: private _distance = [officer_01, weaponsCache] call getDistance; hint str _distance; The officer_01 and weaponsCache are both objects. When called I get an "undefined variable getDistance" error. I've tried calling LFT_getDistance, LFT_fn_getDistance and LFT_fnc_getDistance but no joy. I need a slow thinker's tutorial I guess. 😞
  13. Perfect! With this example I think I may be able to write functions. There is one thing. The editor I use gives a warning on the hint line: "Public variable 'LFT_fnc_getDistance' may be used before being assigned a value." The mission does not complain at all but am I forgetting to define the function or something (Just to shut my editor up)
  14. I made a quick mission that has various helicopters as a training scenario. I unchecked the "enable damage" boxes in the Eden editor for the helicopters and all the players. It works as expected when run from the editor, however when run from my dedicated server crashing still causes damage, death and other mayhem.
  15. I found that putting: "this allowDamage false;" in the init fields fixed this. I don't understand why unchecking the Eden editor's "enable damage" property doesn't do the same thing but it's working now.
  16. I installed a dedicated server on an older PC but when I run Arma from my regular PC it tells me that I am already running Arma from another PC. I'm sure there is a way to run a server without having to create another account and purchase Arma and all of the DLC's again isn't there?
  17. The wiki gives an example of the use of createMarker: _marker1 = createMarker ["Marker1", position player]; It also explains the parameters as: name, position and says that it returns a string. However, I don't understand what the string is. How can I use it? Is it some kind of id?
  18. Now that makes sense. Thanks.
  19. Yes, but my point is that it is a string that I supplied so I could do that even if it didn't return anything. I already have the string. Maybe I'm not understanding something? Oh well, it is what it is...
  20. So it returns one of the parameters that I supply? I don't understand how that is helpful?
  21. I have read the information here: https://community.bistudio.com/wiki/remoteExec and they make it look easy but I get really confused on some commands. Specifically I found out that the effects of setTriggerStatements is local and I'm tearing what little hair I have left out trying to convert the following line of code to use remoteExec: trg1 setTriggerStatements["!alive weaponsCache", "[] execVM missionPath + 'tsk1Succeeded.sqf'", ""]; Thanks for any help.
  22. Thanks, it is a variable so I'll use the brackets. I have scripts in several directories. "missionPath" is actually a misleading variable name. Hmmm... I think I need to pay a little more attention to detail.
  23. gc8, I think you are correct. I believe I have an error elsewhere. For one thing the quote mark in the above code. 😞 Your code example does help however. That's the way I'll be doing a lot of remoteExec from now on. Thanks again.
  24. I'm no expert either so maybe I'm doing completely wrong. I read that the setTriggerStatements only runs locally. I recently installed a dedicated server on my PC so that I could test as a non-server. I noticed that what I was seeing wasn't always the same as when I was both the server and a player. For example I would see the characters move their lips when speaking but my friends would not. (randomLip is also local.) I also noticed when playing as a non-server that when I completed the final task the mission wouldn't end so I assumed it was a scope problem with the setTriggerStatements. Here's the tsk1Succeeded.sqf code that creates the final task (which is simply to fly back to base: if(isServer) then { ["tsk1","SUCCEEDED"] call BIS_fnc_taskSetState; deleteVehicle trg1; // delete the trigger. if(!isNil "player_1") then { [80]execVM missionPath + "goAfterPlayer_1.sqf"; }; if(!isNil "player_2") then { [80] execVM missionPath + "goAfterPlayer_2.sqf"; }; if (!isNil "player_3") then { [80] execVM missionPath + "goAfterPlayer_3.sqf"; }; if(alive heli_01) then { [true, ["tsk2"], ["Fly the littlebird back to base and land on the helipad", "Return to base", "returnMarker"], hPad_01, "ASSIGNED", 1, true, "land", true] call BIS_fnc_taskCreate; handle = execVM "missionPath + createReturnToBaseTrigger.sqf"; } else { // give option to call for extraction. }; }; I'm getting better (believe it or not) but I still have a long ways to go.
×