Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Woodpeckersam

Member
  • Content Count

    230
  • Joined

  • Last visited

  • Medals

Everything posted by Woodpeckersam

  1. Im not sure if I have corrected it fully as I am not at home, and that I may have not sorted out the code properly, but this code... hint ("Arma2Net.Unmanaged" callExtension format ["SQLstats [pGUID, '%1']", _clientID]); It seems logical if it was written like this hint ["Arma2Net.Unmanaged" callExtension format ["SQLstats [pGUID, '%1']", _clientID]]; Sorry I cant really check, lots at work today, im only on my 5min break :(
  2. Woodpeckersam

    Using animations

    It wont work in the init as it has to run after mission start im afraid. Create a trigger, set size to 0, replace "this" in condition to "true", set to Anybody, set timeout to 0.00001 , 0.00001 , 0.00001 In the init line of the trigger, copy your code above. ---------- Post added at 10:30 ---------- Previous post was at 10:28 ---------- As for the main question, im not at home right now, if I was i'd be able to help out a bit more.
  3. Woodpeckersam

    Random position of a "hostage"

    Maybe this? private ["_positions","_posCount","_posRand"]; _positions = [[3276.53,5834.76,4.44275],[3212.53,5801.64,5.4184],[3116.63,6047.01,5.43996],[2974.16,5962.07,7.41268],[2991.32,6065.4,7.93298],[2936.35,6206.78,28.4003],[2859.03,5943.29,3.16571],[2847.96,5890.91,8.95265],[2703.19,6055.4,2.12373],[2885.04,6124.48,11.245]]; _posCount = count _positions; _posRand = (random _posCount); doctor setPos getPos _posRand; ---------- Post added at 20:01 ---------- Previous post was at 19:59 ---------- Edit: Sorry I updated the script as I missed a semi-colon
  4. Woodpeckersam

    Operators inside a string

    Thanks for everything guys, its been very informative and plus the script is working great. I did not use everything that was mentioned on here, but I hope you know that I took everything in, tried it out, mixed it around. Here is the script. Anyone can use it to their benefit. Maybe some more advance scripter can edit/change the script so that one can make sure that for example the items will not be placed on roads, or inside buildings, or not within 5 meters of each other etc. You dont need to credit me, but please let me know if you change it, so I can look/see how you improved things (for my learning benefit). // Init.sqf fnc_ranPos = compile preprocessFile "Scripts\Functions\RanPos.sqf"; [ Dude , "Land_Tyres_F" , 150 , 20 , "Tyres" , true , 10 ] spawn fnc_ranPos; // Scripts\Functions\RanPos.sqf private ["_pos","_areasize","_position","_randCode","_minNumber0f","_name","_type","_numberOf","_object","_random","_minNumberOf","_setName"]; //Write in a Marker name or Unit/Object Name in quotes. _type = _this select 0; //Set the object that you want to spawn in quotes. _object = _this select 1; //Size of the area to spawn the objects in _areasize = _this select 2; //Sets the amount OR the Maximum amount of objects to spawn _numberOf = _this select 3; //Sets the name of all the objects by typing in the name you want in quotes. _setName = _this select 4; //Set to True if want random or False if not _random = _this select 5; //Sets a minimum number of objects to spawn _minNumberOf = _this select 6; if (_random) then { if (_minNumberOf > 0) then { _randCode = (_minNumberOf + (random _numberOf)); } else { _randCode = (random _numberOf); } } else { _randCode = _numberOf; }; for "_i" from 0 to _randCode do { switch (typeName _type) do { //If the _type is a string, then more than likely it is a marker case ("STRING"): { _pos = getMarkerPos _type; }; //If it is an object, then it could be a unit/vehicle/gamelogic etc case ("OBJECT"): { _pos = getPosATL _type; }; }; //CBA is required for this _position = [_pos, _areasize] call CBA_fnc_randPos; //Create the named object to spawn, and set a random direction. _name = _object createVehicle (_position); _name setDir (random 360); //I know the 2 codes below this comment are basically the same thing, //but I wanted to sort of put them in together as they seem to produce a nicer result that using one of them individually _name setPos getPos _name; _name setVectorUP (surfaceNormal [(getPosATL _name) select 0,(getPosATL _name) select 1]); //If there is no name, then exit, otherwise set a name for each object then exit. if (_setName == "") then {exit;} else { missionNameSpace setVariable [format[_setName+"%1",_i],_name];} }; exit;
  5. Woodpeckersam

    Operators inside a string

    Ah brilliant this is great stuff, thanks Larrow! Ok so I have another issue, its been bugging me for a little while... here is the updated code private ["_pos","_areasize","_position","_randCode","_minNumber0f","_name","_type","_numberOf","_object","_random","_minNumberOf","_setName"]; _areasize = _this select 0; //Size of the area to spawn the objects in _type = _this select 1; //Write in a Marker name in quotes or Unit/Object Name without quotes. _numberOf = _this select 2; //Sets the amount OR the Maximum amount of objects to spawn _object = _this select 3; //Set the object that you want to spawn in quotes. _setName = if (count _this > 4) then {_this select 4}; //Sets the name of all the objects by typing in the name you want in quotes. _random = if (count _this > 5) then {_this select 5}; //Set to True if want random or False if not _minNumberOf = if (count _this > 6) then {_this select 6}; //Sets a minimum number of objects to spawn _minNumberOf = 0; _random = false; if (_random) then { if (_minNumberOf > 0) then { _randCode = (_minNumberOf + (random _numberOf)); } else { _randCode = (random _numberOf); } } else { _randCode = _numberOf; }; for "_i" from 0 to _randCode do { switch (typeName _type) do { case ("STRING"): { _pos = getMarkerPos _type; }; case ("ARRAY"): { _pos = []; { _pos set [_forEachIndex, _type select _forEachIndex]; } forEach _type; }; case ("OBJECT"): { _pos = getPosATL _type; }; }; _position = [_pos, _areasize] call CBA_fnc_randPos; _name = _object createVehicle (_position); _name setDir (random 360); if (_setName == "") then {} else { missionNameSpace setVariable [format[_setName+"%1",_i],_name];} }; You notice the text highlighted in BOLD RED? Well leaving that there would override the input spawned at the init. But when testing it, it spawns the object i want. But still the input at spawn has priority so I decided to move that highlighted code to the top, just underneath the Private code. I test it in game, it does not spawn any objects.... If i remove the code, it still does not spawn any objects. Does anyone know why? I put it there in case no one sets the Random to true and the minimum amount of objects to be spawned. ---------- Post added at 22:20 ---------- Previous post was at 22:10 ---------- Edit: I had no choice but to force the user to input data for all the indexes on the function. fnc_ranPos = compile preprocessFile "Scripts\Functions\RanPos.sqf"; [150, Dude, 100,"Land_Tyres_F","Tyres",true,20] spawn fnc_ranPos; [150, Dude, 30,"Land_GarbageWashingMachine_F","WMachine",false,0] spawn fnc_ranPos; For example the second line I had to force it to not be random and have no minimum amount, which makes no sense to write all that because I only just want to spawn 30 Washing Machines, no random and obviously theres no need to write the minimum amount because not having a random will skip that part of the code. private ["_pos","_areasize","_position","_randCode","_minNumber0f","_name","_type","_numberOf","_object","_random","_minNumberOf","_setName"]; _areasize = _this select 0; //Size of the area to spawn the objects in _type = _this select 1; //Write in a Marker name or Unit/Object Name in quotes. _numberOf = _this select 2; //Sets the amount OR the Maximum amount of objects to spawn _object = _this select 3; //Set the object that you want to spawn in quotes. _setName = _this select 4; //Sets the name of all the objects by typing in the name you want in quotes. _random = _this select 5; //Set to True if want random or False if not _minNumberOf = _this select 6; //Sets a minimum number of objects to spawn if (_random) then { if (_minNumberOf > 0) then { _randCode = (_minNumberOf + (random _numberOf)); } else { _randCode = (random _numberOf); } } else { _randCode = _numberOf; }; for "_i" from 0 to _randCode do { switch (typeName _type) do { case ("STRING"): { _pos = getMarkerPos _type; }; case ("ARRAY"): { _pos = []; { _pos set [_forEachIndex, _type select _forEachIndex]; } forEach _type; }; case ("OBJECT"): { _pos = getPosATL _type; }; }; _position = [_pos, _areasize] call CBA_fnc_randPos; _name = _object createVehicle (_position); _name setDir (random 360); if (_setName == "") then {} else { missionNameSpace setVariable [format[_setName+"%1",_i],_name];} };
  6. Woodpeckersam

    Operators inside a string

    (sorry about the //comments on my code below, if you can stretch the web browser to the edge of your screen so the code can be read better) That does make a lot of sense, thanks for that man Haha dont worry about it dude, the code you posted seemed logical, but obviously it did not work. I appreciate the help though! Wow pretty advance stuff. Still in the learning phase even though i have been using the editor since OFP. If you see below, the completed script in which I have created a function from it, would what you have posted benefited me a lot more than what I have now? [150, "Agia_Marina", 100,"Land_Garbage_square3_F","Garbage"] spawn fnc_ranPos; The above code is calling the function, which is the code below. private ["_pos","_areasize","_position","_randCode","_minNumber0f","_name","_type","_numberOf","_object","_random","_minNumberOf","_setName"]; _areasize = _this select 0; //Size of the area to spawn the objects in _type = _this select 1; //Write in a Marker name or Unit/Object Name in quotes. _numberOf = _this select 2; //Sets the amount OR the Maximum amount of objects to spawn _object = _this select 3; //Set the object that you want to spawn in quotes. _setName = if (count _this > 4) then {_this select 4}; //Sets the name of all the objects by typing in the name you want in quotes. _random = if (count _this > 5) then {_this select 5}; //Set to True if want random or False if not _minNumberOf = if (count _this > 6) then {_this select 6}; //Sets a minimum number of objects to spawn _minNumberOf = 0; _random = false; if (_random) then { if (_minNumber0f > 0) then { _randCode = (_minNumberOf + (random _numberOf)); } else { _randCode = (random _numberOf); } } else { _randCode = _numberOf; }; for "_i" from 0 to _randCode do { [b][color="#FF0000"]if (typeOf _type == "Marker") then {_pos = getPos _type;} else {_pos = getMarkerPos _type;};[/color][/b] _position = [_pos, _areasize] call CBA_fnc_randPos; _name = _object createVehicle (_position); _name setDir (random 360); if (_setName == "") then {} else { missionNameSpace setVariable [format[_setName+"%1",_i],_name];} }; I do have a problem here... I am trying to figure out how to determine what _type is in the script. If it is a Marker, then do a getMarkerPos code else if it is not a marker do a getPos code Any way to find out the type of entity (is that the right word for it?)
  7. Woodpeckersam

    Operators inside a string

    Hey k0rd thanks for the response. The code you posted, while logical it does not work. The game is throwing out this error: Hmm...
  8. Woodpeckersam

    Any solid info about Underground structures yet?

    So we cant rule it out =)
  9. Woodpeckersam

    Any solid info about Underground structures yet?

    VBS2 has underground =) Also in the latest dev update they added the "Loiter" waypoint, which is also present in VBS2. Which makes me excited that the possibilities for a lot of features from VBS2 such as Underground Structures are making its way into ArmA 3.
  10. Woodpeckersam

    MBG Killhouses (Arma3)

    How do I allow the walls to follow the terrain rather than be "straight" all the time?
  11. Any time mate =) How about this, make a 1 second recording of "Silence" into an ogg file and maybe call it Silent.ogg and voila you have your "Radio turn off" I think lol :P I have not really played around with say3d so I am unsure if the sounds would overlap or play individually. Worth a check. Good luck with your mission making =) You seem to be gathering a lot of knowledge at speed. ---------- Post added at 20:07 ---------- Previous post was at 20:04 ---------- Alternatively play around with audacity and create radio static which fades to silent, simulating the radio being turned off. Adds a nice touch lol.
  12. Where is your radio script located in the mission folder? If it is in the root folder then use vehiclename addAction ["Radio on", "say3d.sqf"]; (It should be sqf right? Unless you made the script in sqs, try to avoid using sqs as much as possible) If it is in it's own folder inside the mission folder then do it like this for example vehiclename addAction ["Radio on", "Scripts\Radio\say3d.sqf"]; Also remember to rename your vehicle. But it makes more sense to put this code inside the vehicles init / initialization field like this: this addAction ["Radio on", "say3d.sqf"]; this = the current vehicle/unit/object that the code is running from. Im not on my PC so I cannot really check my code, but it should work. ---------- Post added at 01:22 ---------- Previous post was at 01:07 ---------- Alternatively try this private ["_vehicle","_onoff"]; _vehicle = _this select 0; //This is the variable that stores the vehicle that has the action Radio On and Off _onoff = _this select 3; //This is the variable that the user sets for Radio On and Off. On the addaction code, there is space after the "Script Name" to set this variable. track_playing = true; //This is a Global Variable. You can set this variable to true or false anywhere while {track_playing} do //While the Global Variable is true then do the following code { if (_onoff == "On") then //If _onoff is equalled to "On" (set in the AddAction "Radio On") then do t { hint "Song started"; //Tells you that the song is player. Can remove if needed _vehicle say3D "track1"; //Players the tracked specified in the description.ext (i think lol) sleep 169; //Sleeps for 169 seconds hint "Song finished"; //Tells you the song is finished sleep 10; //Simulate the loading of another song before the loop starts again }; if (_onoff == "Off") exitWith {hint "radio off"; _vehicle say3D "";}; //Self explanatory }; exit; Copy these 2 into the Vehicle's init field: See in the code where it says ["On"] and ["Off"] they are associated with _onoff = _this select 3. You can add more strings/numbers/booleans after that if needed. So for example you could have ["On","DebugOn",False,1] "On" would be _this select 3; "DebugOn" would be _this select 4; and so on. Remember to change the path to where the script is. Also use Notepad++ if you are using plain standard word editing program and download the ArmA 3 NotePad++ plugin.
  13. Woodpeckersam

    Cutter Grass inside a trigger/marker

    Ah I found the original script, and it was yourself who made it F2k lol. Well I still cant seem to get it to work though :/ Does not do a thing... maybe I do need an object... *refers to your old script* cheers man.
  14. I am looking for a way to get a list of open-able objects, such as doors/windows/shutters and add them to an array. I want it to work with already placed buildings on the map, and player-placed buildings too. Is this possible? I'd assume using the nearestObjects command. I already have an array of Objects that animates. So I've been trying to find out whether it is possible to use a command such as.. if (nearestObjects Building1 = _objectArray) then {_currentBuildingObjects + [nearestObjects Building1]} Building1 is the buildname _objectArray is the 100% complete list of objects in all the buildings on the map (its huge) _currentBuildingObjects is the list objects related ONLY to Building1 which is currently empty until the nearestObjects finds matching objects from the _objectArray and adds it to _currentBuildingObjects I know this is not very accurate. The proper code for above (if there is one hopefully) would add the object in that building to the _currentBuildingObjects array. What I really need is to add ALL of the building objects to that array. I hope this is easy to understand. I will look through the config viewer as I saw something related somewhere to the open all doors/windows module. Just a bit hard to find lol ---------- Post added at 23:39 ---------- Previous post was at 23:32 ---------- I found this in the functions viewer... hard to interpret at the moment... but will it help me with what I want to achieve? private ["_logic","_units","_radius","_door","_hatch","_i"]; _logic = [_this,0,objnull,[objnull]] call bis_fnc_param; //--- Extract the user defined module arguments _radius = _logic getvariable ["radius",500]; _door = parseNumber (_logic getvariable ["Door",0]); _hatch = parseNumber (_logic getvariable ["Hatch",0]); debugLog str (getPos _logic); _objects = (getPos _logic) NearObjects ["House",_radius]; debugLog str _objects; _MaxDoorsInHouse = 22; //<----------------------- Maximal number of doors in da house - current 22 doors - CAN CHANGE!!!! _MaxHatchesInHouse = 6; //<----------------------- Maximal number of hatches in da house - current 6 hatches - CAN CHANGE!!!! _doorAnimNameStart="Door_"; //<----------------------- Animation name for door is now set for all buildings except Airport Hall door to "Door_#DoorNumber_rot" _doorAnimNameEnd="_rot"; _hatchAnimNameStart="Hatch_"; //<----------------------- Animation name for hatches is now set for all buildings to "Hatch_#HatchNumber_rot" _hatchAnimNameEnd="_rot"; { switch (_door) do { case -1: {}; default { for "_i" from 1 to _MaxDoorsInHouse do { _x animate [(_doorAnimNameStart+str(_i)+_doorAnimNameEnd),_door]; }; }; }; switch (_hatch) do { case -1: {}; default { for "_i" from 1 to _MaxHatchesInHouse do { _x animate [(_hatchAnimNameStart+str(_i)+_hatchAnimNameEnd),_hatch]; }; }; }; } foreach _objects; deleteVehicle _logic; true ---------- Post added at 23:41 ---------- Previous post was at 23:39 ---------- Offtopic: Wow :O Didnt know some of the stuff that is in that code :O :O eg: _doorAnimNameStart+str(_i)+_doorAnimNameEnd Now this WILLL be useful somehow :P
  15. Woodpeckersam

    MBG Killhouses (Arma3)

    I have a request: Is it possible that maybe you can set it so that your walls do not setVectorUp [0,0,1] automatically? It would be nice for it to follow the terrain, and that we can setVectorUp [0,0,1] ourselves. Unless there is a way for me to change it. Also how do you make it so that all the shutters star opened and not closed?
  16. Woodpeckersam

    MBG Killhouses (Arma3)

    Oops i had no idea, sorry lol. I dont come on here as often as i used to... forgive me dude. ---------- Post added at 19:47 ---------- Previous post was at 19:46 ---------- Ah i missed the BI Developer under the name. Well the great to possibilities to come ;)
  17. Woodpeckersam

    MBG Killhouses (Arma3)

    Fantastic mod!!!! Here's an idea, create a ticket on the Feedback tracker asking BIS to create damage models like they way you have made it. It did not take you long to do this right? It should not be difficult for BIS to create those for the current building models. Just show your mod as an example and maybe... they could employ you to do it for them lol.
  18. Just do if (debug = 1) then { hint "debug is 1!"; }; Then set debug = 1 wherever you need it. edit: Ignore my post, I missed a post where you seemed to get it to work. Sorry.
  19. Woodpeckersam

    Marker Colour for JIP

    I think it may be the setMarkerColorLocal command right? Sorry I have never worked on MP scripts before, but this does look like it will for other players by assigning a local marker colour to each player who joins..
  20. I have changed the script dramatically. It does work to a certain extent, it counts too many civilians when there are none placed on the maps hence the reason for this ticket on the feedback tracker: http://feedback.arma3.com/view.php?id=6255 please vote to help =) Here are the updated scripts to help anyone who need it: Init.sqf //Set Functions/Procedures fnc_markerColor = compile preprocessFile "Functions\MarkerColor.sqf"; //Set Global Variables that can be change from anywhere in the mission/scripts check = true; //Sleep to ensure all functions, procedures and variables are loaded sleep 1; //Runs all the code that requires to be on all the time while {true} do { // Specify the unit checking below by copying the call function line for the desired // trigger area and Markers. // // [#triggername#,[#MarkerArray#],#Debug#] call fnc_markerColor; //------------------------------------------------------------------------------------------// // #triggername# = name of the trigger checking the units inside // #MarkerArray# = an array of markers that need changing colour ie ["Marker1","Marker2"] // #Debug# = Set to true to enable the debug or false to disable it //------------------------------------------------------------------------------------------// if (check) then { [northPoint,["One","Two","Three","Four"],true] call fnc_markerColor; sleep 10; }; } MarkerColor.sqf private ["_OpFOR","_Civ","_trigger","_markerArray","_Blufor"]; _trigger = _this select 0; _markerArray = _this select 1; _debug = _this select 2; //Count the units inside the trigger. _Opfor = ({alive _x AND (side _x) == east} count list _trigger); _Civ = ({alive _x AND _x isKindOf "MAN" AND (side _x) == civilian} count list _trigger); _Blufor = ({alive _x AND (side _x) == west} count list _trigger); if (_debug) then { hint format ["Opfor:%1\nCivilians:%2\nBlufor:%3", _Opfor, _Civ, _Blufor]; }; //Change marker colour if there is any Opfor Occupying the area. if (/*_Opfor > _Civ ||*/ _Opfor > _Blufor) then { {_x setMarkerColor "ColorRed"} forEach _markerArray; } else { //Change marker colour if there is either a Civilian or Blufor side occupying the area if (/*_Civ > _Opfor ||*/ _Blufor > _Opfor) then { {_x setMarkerColor "ColorBlue"} forEach _markerArray; } else { //Change the marker colour if there are equal amounts of units from either side if (/*_Civ == _Opfor ||*/ _BluFor == _Opfor /*|| _Civ + _Blufor == _Opfor*/) then { {_x setMarkerColor "ColorOrange"} forEach _markerArray; } else { //Change marker colour if there are no sides occupying the area if (/*_Civ == 0 ||*/ _OpFOR < 1 || _Blufor < 1) then { {_x setMarkerColor "Default"} forEach _markerArray; }; }; }; }; exit; Note: I have commented out the civilian part to see if it would still count the blufor and the opfor EDIT: I have updated the MarkColor.sqf. The changing of marker colours now work!! All i did was to nest all the if statements into if else continuously so i does a long check of everything before deciding what colour to choose. Finally!
  21. I am struggling to get this script to work. It keeps getting an error in game when trying to count the units inside a trigger. It keeps saying something like "....if (_OpFOR > _Civ) then.... is a String, expected object/group"... no idea how to go about fixing it :/ Can anyone help? private ["_OpFOR","_Civ","_trigger","_markerArray"]; _trigger = _this select 0; _markerArray = _this select 1; while {true} do { _OpFOR = ({alive _x AND side _x == east} count units _trigger); _Civ = ({alive _x AND side _x == civilian} count units _trigger); if (_OpFOR > _Civ) then { {_x setMarkerColor "ColorRed"} forEach _markerArray; }; if (_Civ > _OpFOR) then { {_x setMarkerColor "ColorBlue"} forEach _markerArray; }; if (_Civ == 0 && _OpFOR == 0) then { {_x setMarkerColor "ColorBlack"} forEach _markerArray; }; sleep 10; };
  22. No probs Jacmac. Does anyone reckon that maybe the setMarkerColor code is broken when being run from spawn??
  23. Ok i should have made it clearer. Across the map there are grid markers, 500x500 that fits in each grid that you see when zoomed out of the map. Each markers are named appropriately - "One","Two","Three". That are just names to link the markers, nothing else. At the north point of stratis there is a trigger i think about 800x500 that covers most of that northern tip. It is titled NorthPoint. My Init.sqf includes the trigger name when calling the script, and also the array for the markers that need changing color. [NorthPoint,["One","Two","Three","Four"]] call fnc_markerColor; What is meant to happen is if a certain unit/group from Blufor/Opfor/Civilian enters that trigger, and the "count" of that "side" is higher than the other "side" then they occupy that part of Stratis, and the markers changes color accordingly. I wanted to implement the sleep in the function so that the scripts does not constantly update the markers on the maps except only for a small amount of time. So back to topic, would it make any difference if I spawned the function instead of calling it? ps. the _x counts individual units inside the trigger, the while {true} will constantly loop from top to bottom, therefore update the variables _Blufor, _Opfor, _Civ according to how many units per side are inside the trigger or if there are none. I may have to put a variable in there so to be able to turn the loop on/off at will. ---------- Post added at 11:51 ---------- Previous post was at 09:51 ---------- Ok spawning that code allows for the sleep to be executed. I am not receiving any errors whatsoever, however the script is not picking up any units inside the trigger, even though there are units inside the trigger. It keeps popping up with the hint "Noone" but nothing else. Here are the updated codes: Init.sqf fnc_markerColor = compile preprocessFile "Functions\MarkerColor.sqf"; [northPoint,["One","Two","Three","Four"]] spawn fnc_markerColor; MarkerColor.sqf private ["_OpFOR","_Civ","_trigger","_markerArray","_Blufor"]; _trigger = _this select 0; _markerArray = _this select 1; _Opfor = 0; _Civ = 0; _Blufor = 0; while {true} do { _Opfor = ({alive _x AND (side _x) == east} count list _trigger); _Civ = ({alive _x AND (side _x) == civilian} count list _trigger); _Blufor = ({alive _x AND (side _x) == west} count list _trigger); //Change marker colour if there is any Opfor Occupying the area. if (_Opfor > _Civ || _Opfor > _Blufor) then { {_x setMarkerColor "ColorRed"} forEach _markerArray; Hint "Red Guy"; }; //Change marker colour if there is either a Civilian or Blufor side occupying the area if (_Civ > _Opfor || _Blufor > _Opfor) then { {_x setMarkerColor "ColorBlue"} forEach _markerArray; Hint "Blue Guy"; }; if (_Civ == _Opfor || _BluFor == _Opfor || _Civ + _Blufor == _Opfor) then { {_x setMarkerColor "ColorOrange"} forEach _markerArray; Hint "Orange Guys"; }; //Change marker colour if there are no sides occupying the area if (_Civ == 0 || _OpFOR == 0 || _Blufor == 0) then { {_x setMarkerColor "Default"} forEach _markerArray; Hint "Noone"; }; sleep 20; }; Why does it have to be this complicated... when logic produces something that should work, when in fact it doesnt :/ ---------- Post added at 13:10 ---------- Previous post was at 11:51 ---------- Update: I put in a debug hint, using spawn it is counting all the units, but not changing the marker colours. But if use call without sleep it counts all the units, but the colors of the markers changes rapidly between default and red and sometimes orange and sometimes the game hangs. So what is wrong in my script, where spawn does not get the marker names and changes their colour? It works with call but with a massive performance hit, and rapidly changing marker colours. Please help im lost! :(
  24. I still cannot get it to work :/ Can anyone help me with the new error message? https://dl.dropbox.com/u/43380313/107410_2013-03-25_00001.png (2162 kB) Updated MarkerColor.sqf private ["_OpFOR","_Civ","_trigger","_markerArray","_Blufor"]; _trigger = _this select 0; _markerArray = _this select 1; sleep 5; while {true} do { _Opfor = ({alive _x AND (side _x) == east} count list _trigger); _Civ = ({alive _x AND (side _x) == civilian} count list _trigger); _Blufor = ({alive _x AND (side _x) == west} count list _trigger); //Change marker colour if there is any Opfor Occupying the area. if (_Opfor > _Civ || _Opfor > _Blufor) then { {_x setMarkerColor "ColorRed"} forEach _markerArray; }; //Change marker colour if there is either a Civilian or Blufor side occupying the area if (_Civ > _Opfor || _Blufor > _Opfor) then { {_x setMarkerColor "ColorBlue"} forEach _markerArray; }; if (_Civ == _Opfor || _BluFor == _Opfor || _Civ + _Blufor == _Opfor) then { {_x setMarkerColor "ColorOrange"} forEach _markerArray; }; //Change marker colour if there are no sides occupying the area if (_Civ == 0 || _OpFOR == 0 || _Blufor == 0) then { {_x setMarkerColor "Default"} forEach _markerArray; }; sleep 10; };
  25. Thanks =) I did figure that all out myself, but what I cannot figure out is why the marker is not changing colour. There are large grid sized rectangle markers that are at their "Default" colour when nothing is occupying the trigger inside the markers. (500x500 at least in size) Here are the updated scripts. Init.sqf fnc_markerColor = compile preprocessFile "Functions\MarkerColor.sqf"; [NorthPoint,["01","02","03","04"]] call fnc_markerColor; MarkerColor.sqf private ["_OpFOR","_Civ","_trigger","_markerArray"]; _trigger = _this select 0; _markerArray = _this select 1; sleep 5; while {true} do { _Opfor = ({alive _x AND (side _x) == east} count list _trigger); _Civ = ({alive _x AND (side _x) == civilian} count list _trigger); _Blufor = ({alive _x AND (side _x) == west} count list _trigger); //Change marker colour if there is any Opfor Occupying the area. if (_Opfor > _Civ || _Opfor > _Blufor) then { {_x setMarkerColor "ColorRed"} forEach _markerArray; }; //Change marker colour if there is either a Civilian or Blufor side occupying the area if (_Civ > _Opfor || _Blufor > _Opfor) then { {_x setMarkerColor "ColorBlue"} forEach _markerArray; }; //Change marker colour if there are no sides occupying the area if (_Civ == 0 || _OpFOR == 0 || _Blufor == 0) then { {_x setMarkerColor "Default"} forEach _markerArray; }; sleep 10; }; I dont get any errors this time round though which is great, I just need to figure out why the markers are not changing colour. ps offtopic. Im british and I spell it as Colour, is it international english that spell it as Color? Interesting if so lol. Im starting to write with Color lol.
×