Jump to content

Larrow

Member
  • Content Count

    3604
  • Joined

  • Last visited

  • Medals

Everything posted by Larrow

  1. All the vehicle textures changed with the last classname changes "\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_co.paa", //red "\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE01_CO.paa", //yellow "\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE02_CO.paa", //white "\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE03_CO.paa", //blue "\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE04_CO.paa", //darkred "\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE05_CO.paa" //darkblue
  2. Helicopters have an automatic waypoint completion of around 500m (especially when using GET OUT type), no matter what completion radius you create the waypoint with. This may also be whats causing the other problem. As heli is spawned , its already within 500m of the waypoint so because of the Land command it just looks for the nearest landing spot. You maybe able to get around this by including a distance check in the waypoints condition. e.g _wp1 setWaypointStatements ["true[color="#FF0000"] && ((this distance _landPos) < 20)[/color]", "(vehicle this) LAND 'GET IN';"]; and _wp2 setWaypointStatements ["true [color="#FF0000"]&& ((this distance _spawnPos) < 20)[/color]", "{deleteVehicle _x} forEach crew (vehicle this) + [vehicle this]; SMOKEHELI_Active = false; publicVariable 'SMOKEHELI_Active';"]; This should force the heli to get closer before the waypoint is considered completed, and then the land commands are activated/or the vehicle is deleted. __________________________________________________ OK i played with this for a bit, looks like the main problem was the use of the leaveVehicle command. This was having the unwanted effect off the reinforcements saying 'we want out and we want out NOW' so the pilot would find the nearest place to land. Ive changed the helis waypoint to a TR UNLOAD and the land to GET OUT. So they dismount nicely without the need for the leaveVehicle. Then used the waituntil to count that no one is left in the helicopter before sending it on its way. I tweaked the positioning of the HeliPad to make sure its 0 elevation as i have had this cause me problems before. Ive also sent the heli back to where it came from plus 500m so that it dosent delete to early if you are close to the spawnPoint and moved the clean up of the helipad to the end , I found deleting it to early (especially with other pads nearby like around the airport) made the heli try to reland before moving off to its new waypoint. Ive tested it in lots of different areas and it lands where the smoke is and everything seems to be behaving. // Options. SMOKEHELI_spawnMarker = "heliBase"; // STRING - marker name of where to start and delete the helicopter. SMOKEHELI_helicopterType = "B_Heli_Light_01_F"; // STRING - class name of the helicopter to use. SMOKEHELI_groupType = (configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_ReconPatrol"); // CONFIG - CfgGroups entry of preset group // SMOKEHELI_groupType = ["B_Soldier_F","B_Soldier_F","B_Soldier_F"]; // ARRAY - List of classnames to spawn for reinforcements. Option instead of above. SMOKEHELI_SmokeColor = "SmokeShellGreen"; // STRING - classname of the smoke grenade to look for. SMOKEHELI_feedback = true; // BOOL - Yell smoke out like a boss? if (isNil "SMOKEHELI_Active") then {SMOKEHELI_Active = false;}; // Function to check for smoke being thrown. SMOKEHELI_fnc_addSmokeCheck = { // Add eventHandler for tossing smoke from Demonized _idx = player addEventHandler ["Fired", { if (((_this select 5) != SMOKEHELI_SmokeColor) || SMOKEHELI_Active) exitWith {}; // Not green so ignore it. // Green! Lets see where it lands. _null = (_this select 6) spawn { // Get current location of the smoke shell _posg = getPos _this; sleep 0.5; // As it rolls keep updating the location. If it keeps rolling or jitters it's last pos when it disappears will be _posg. while {(_posg distance (getPos _this)) > 0} do { _posg = getPos _this; sleep 0.5; }; // We've come to a stop and know where to fly so lets do it! [[_posg, player], "SMOKEHELI_fnc_spawnReinforcements", false] spawn BIS_fnc_MP; if (SMOKEHELI_feedback) then { player sideChat "Smoke out!"; playSound3D ["A3\dubbing_radio_f\data\Male02\RadioProtocolENG\Stealth\200_CombatShouts\ThrowingSmokeE_2.ogg", player]; // so lulz :) }; }; }]; }; // Function to spawn helicopter and reinforcements and deploy them. SMOKEHELI_fnc_spawnReinforcements = { private["_reinforcements", "_heli"]; SMOKEHELI_Active = true; publicVariable "SMOKEHELI_Active"; _landPos = _this select 0; _unit = _this select 1; _spawnPos = getMarkerPos SMOKEHELI_spawnMarker; //make sure helipad is at 0 elevation _landPos set [2, 0]; // Spawn invis helipad at the smoke to land on. _helipad = createVehicle ["Land_HeliPadEmpty_F", _landPos, [], 0, "NONE"]; // Spawn helicopter and crew. _helisv = [_spawnPos, [_spawnPos, _landPos] call BIS_fnc_dirTo , SMOKEHELI_helicopterType, west] call BIS_fnc_spawnVehicle; _heli = _helisv select 0; _heliCrew = _helisv select 1; _heliGroup = _helisv select 2; // Spawn reinforcements and get them in the helicopter. _reinforcements = [_spawnPos, blufor, SMOKEHELI_groupType] call BIS_fnc_spawnGroup; {_x assignAsCargo _heli; _x moveInCargo _heli;} forEach units _reinforcements; // Waypoint to the location for heli _wp1 = _heliGroup addWaypoint [_landPos, 0]; _wp1 setWaypointSpeed "FULL"; _wp1 setWaypointType "TR UNLOAD"; _wp1 setWaypointStatements ["true", "(vehicle this) LAND 'GET OUT';"]; // Wait till we're out. waitUntil{sleep 1; {_x in _heli} count units _reinforcements == 0}; // Release heli from being landed and clean up. _heli flyInHeight 50; // Join the units to the player's group. units _reinforcements joinSilent _unit; //Waypoint back to base and delete _dir = [_landPos, _spawnpos] call BIS_fnc_dirTo; _delPos = [_spawnPos, 500, _dir] call BIS_fnc_relPos; _wp2 = _heliGroup addWaypoint [_delPos, 0]; _wp2 setWaypointSpeed "FULL"; _wp2 setWaypointType "MOVE"; _wp2 setWaypointStatements ["true", "{deleteVehicle _x} forEach crew (vehicle this) + [vehicle this]; SMOKEHELI_Active = false; publicVariable 'SMOKEHELI_Active';"]; deleteVehicle _helipad; }; // Add eventhandler to player. player call SMOKEHELI_fnc_addSmokeCheck;
  3. Larrow

    Remove Items by Class?

    If you already have created the arena cant you keep a reference of what youve created then remove them when you need to? How are you creating? Are they using ObjectMapper? I mean if you already have an array of class names why do you need to check it is a class? why not just deleteVehicle each one? And if these are objects why are you foreaching allUnits. We really could do with more info to help you efficiently do this.
  4. They were detected as you would see the hint come up, just the data was empty. I noticed Fak's were not showing, as i said was only a quick example, you would need to look see what other data/text is there to pull from each slot. If you unpack your Arma3/Addons/UI_f.pbo in there you will find:-config.cpp <- Inventory UI starts at line 34681 hpp/defineResincl.inc <- has the defined idd & idc numbers, inventory starts at line 785 Handy pages to have bookmarked Dialog Overview IDC types from BISim UI event handlers UI Editor UI scripting commands EDIT: Updated my first post with a script to get as much info as i could find about an idc Listbox's selected index. Data if filled in seems to be class name. Text seems to be displayname from class. Value is just the index number. Picture gives you the path to the items paa. So if the class name is not present then your most likely going need a little config scripting wizardry to get the info for the object, or set up your own array for items you know your going to need to reference.
  5. Just this allowDamage false; this addAction [("<t color=""#FFFF66"">" + ("Secure Objective") + "</t>"),"SecureObjective.sqf",[],1,false,true,"","side _this == west && _this distance _target < 2"]; will do the job. Object is always set as allowdamage false, then the action itself does the side and distance check of the caller.
  6. Yes its possible to run scripts from clicking on items in your inventory. As cuel says you need to wait for the inventory dialog to be opened then set an event on the control you want to monitor that runs your function. As a quick example run this in the debug console. handle = [] spawn { fnc_test = { _idc = ctrlIDC (_this select 0); _selectedIndex = _this select 1; _data = format ["Data\n%1\n________\n",lbData [_idc, _selectedIndex]]; _text = format ["Text\n%1\n________\n",lbText [_idc, _selectedIndex]]; _value = format ["Value\n%1\n________\n",lbValue [_idc, _selectedIndex]]; _pic = format ["Picture\n%1\n________\n",lbPicture [_idc, _selectedIndex]]; hint format["Selected Uniform Index: %1\n%2%3%4%5",_selectedIndex,_data,_text,_value,_pic]; false }; while {true} do { waituntil {!(isnull (finddisplay 602))}; hint "Inventory has been opened\nAdding event to uniform listbox"; ((findDisplay 602) displayCtrl 633) ctrlSetEventHandler ["LBSelChanged", "_this call fnc_test"]; waituntil {isnull (finddisplay 602)}; }; }; When you open your inventory and click on any item in your uniform it will hint what that items description is.
  7. Larrow

    Problem CtrlSetPos

    Dont you have todo something like a ctrlCommit to get the change to show??
  8. As you have realised createUnit does not return the created object, you need to use createUnit ARRAY instead. If you wish to use the other format you will need to assign the variable (OF1) in the init string e.g _officers = [ ["O_officer_F","OF1",'this addGoggles "G_Shades_Blue"',1,"CORPORAL"], ["O_officer_F","OF8",'Removeuniform this;this addGoggles "G_Shades_Blue"',1,"CORPORAL"] ]; _pos = position player; _grp = creategroup east; _ocount = (count _officers) - 1; for "_o" from 0 to _ocount do { _class = (_officers select _o) select 0; _var = (_officers select _o) select 1; _init = (_officers select _o) select 2; _initString = format["%1 = this;%2",_var,_init]; _skill = (_officers select _o) select 3; _rank = (_officers select _o) select 4; _class createUnit [_pos,_grp,_initString,_skill,_rank]; }; if (!alive OF1) then { hint "OF1 is not alive!"; } else { hint "OF1 is alive!"; }; OR change your array around and incorporate the OF1 = this; directly in the init string part. _officers = [ ["O_officer_F",'OF1 =this; this addGoggles "G_Shades_Blue"',1,"CORPORAL"], ["O_officer_F",'OF8 = this; Removeuniform this;this addGoggles "G_Shades_Blue"',1,"CORPORAL"] ]; _pos = position player; _grp = creategroup east; _ocount = (count _officers) - 1; for "_o" from 0 to _ocount do { _class = (_officers select _o) select 0; _init = (_officers select _o) select 1; _skill = (_officers select _o) select 2; _rank = (_officers select _o) select 3; _class createUnit [_pos,_grp,_init,_skill,_rank]; }; if (!alive OF1) then { hint "OF1 is not alive!"; } else { hint "OF1 is alive!"; }; If you need access to this unit via its variable (OF1 etc) on any other machine other than the one where it was create, then option 1 is better as you still have a reference to just its variable and you can then just publicVariable _var;
  9. Larrow

    Player localized crates

    Use addItemCargo for the scopes instead.
  10. Oh nice had not noticed the change as i had been browsing the unpacked files instead lately. See what you mean though, keys up/down move around each control, even though you can scroll with the mouse wheel as F2k Sel points out it would be nice if when the focus is on the script box that the keys moved the cursor around. Dont like the tab spacing being A space makes the code a little difficult to read. Now just make the script box an edit box, link in the F1 help box like in editor edit boxes, syntax highlighting and a save/load button and we may have a reason not to switch out to our text editors :D like they have not got better things to be doing, can wish though.
  11. Larrow

    Undefined Variable

    _officer = "O_officer_F" createUnit [_rndPos,_oGrp]; createUnit in this form does not return a value. You will need to use the other form createUnit ARRAY.
  12. Yes it also works i Arma3 from a quick test, see HERE
  13. _shouldBeFacingDir = ((((_unitPos select 0) - (_unitPos select 0)) atan2 ((_unitPos select 1) - (_unitPos select 1))) + 360) % 360; Erm so 0 then :) I presume that was meant to be _shouldBeFacingDir = ((((_unitPos select 0) - (_targetPos select 0)) atan2 ((_unitPos select 1) - (_targetPos select 1))) + 360) % 360; Or just use BIS_fnc_inAngleSector instead. //[<center position>,<center angle of sector>,<sector width>,<position>] call bis_fnc_inAngleSector; if ( [_unitPos, eyeDirection _unit, _unitFOV, _targetPos] call bis_fnc_inAngleSector ) then { _____________________ if (lineIntersects [[color="#FF0000"]_unitpos, _targetpos[/color], _unitOne]) then { _canSee = true; }; Not sure if its changed in the last few patches but intersects does not (did not) pick up unit models. As in Tand3rsson EDIT 2 above. ! intersects = cansee
  14. Larrow

    Sector command(s)

    Set the Ownership limit to anything below 1. Its something like you have to keep that zones score for your side above the limit to be the owner. It seems that if set to 1 you always have to have someone present in the area. Remove your hints from your execution lines in your sectors and place this in the init.sqf to see whats happening. handle = [] spawn{ while {true} do {hstring = format ["Area: %1\nSides: %2\nFlags: %3\nTasks: %4\nDesign: %5\nSidesc: %6\nContest: %7\nOwner: %8\nOwnerT: %9\nOwnerCol: %10", a getvariable "areas" , a getvariable "sides" , a getvariable "flags" , a getvariable "tasks" , a getvariable "designation" , a getvariable "sideScore" , a getvariable "contested" , a getvariable "owner" , a getvariable "ownerTexture" , a getvariable "ownerColor"]; hint Hstring; sleep 1;};}; Set the limit to something like 0.8 and you will see that you do not own the area until your sides score > 0.8. _____________________________________ It could well be a mistake in the module script thought, related to this if (_xScore > _ownerLimit && _xScore > _ownerScore) then {_owner = _x; _ownerScore = _xScore}; _totalScore = _totalScore + _xScore; if (_foreachindex > 0) then {_maxScore = _maxScore max _xScore min 1;}; As the score has to be > than the limit rather than >=. It evalues ok straight after score evaluation but then the score is checked against a min of 1, if you then leave the area score is not greater than limit so ownership fails. Although it needs to looked through by Morickey or who ever wrote it, unless this is the intended action?
  15. Larrow

    Sector command(s)

    Spawn is actually better than execVM dependant on where you use it, as execVM compiles the script each time you use it. If for example a call via execVM is in a piece of code that is called many times then it is not really the best option as each time execVM is used the engine has to recompile the script. It would generally be better to (somewhere near the begining of your init to compile the code. myScript = compile preprocessFileLineNumbers "mySectorChecking.sqf"; then use spawn _handle = [Ambb, ambo] spawn myScript; . But as your only ever going to be calling this script once in your case it does not really matter.
  16. Larrow

    Sector command(s)

    No, just not thinking straight :D It will work with as many sectors that you pass in the array
  17. for "_i" from 0 to ((count _sleepAnim) -1) do else on the second loop select _i does not exist (is longer than the array) so _isSleep becomes undefined.
  18. Larrow

    Sector command(s)

    Sorry for the confusion, the first lot of code is not a script it is just INFO ripped out off the sector module script to show all the variables stored on the module object. Something like (untested) _mySectors = [Ambb, ambo]; Blwin = false; Opwin = false; while {!Blwin && !Opwin} do { _Hstring = "No one controls all areas"; if ({_x getVariable "owner" == west}count _mySectors == count _mySectors) then { _Hstring = "Blufor have captured all the areas"; Blwin = true; }; if ({_x getVariable "owner" == east}count _mySectors == count _mySectors) then { _Hstring = "Opfor have captured all the areas"; Opwin = true; }; hintSilent _Hstring; sleep 6; }; And if your making this a script for others to call just replace _mySectors = [Ambb, ambo]; with _mySectors = _this; and have them call it with _handle = [Ambb, ambo] spawn "mySectorChecking.sqf"; For MP youll likely want to make something similar as i done in my last post to display the hints to all clients, and leave this to be only run on the server? maybe
  19. Something like //setup waypoint waitUntil {isTouchingGround newchopper}; unassignVehicle soldier1; soldier1 action ["GetOut", newchopper]; [soldier1] joinSilent (group player); //setup return waypoint I have no idea why TR UNLOAD doesnt work for AI!
  20. Larrow

    Sector command(s)

    Rather than using the Expression box in the editor to set variables on objects you can get the state straight from the module objects them selves. INFO:- //number of modules on map _sectorsModules = count (entities "ModuleSector_F"); //return an array of sector module object names (as in name in editor) _sectors = missionnamespace getvariable ["BIS_fnc_moduleSector_sectors",[]]; //sector setting variables (not able to update from script) _name = _logic getvariable ["Name",""]; _logic getvariable ["Designation",""]; _logic getvariable ["OwnerLimit","0"]; _logic getvariable ["OnOwnerChange","true"]; _logic getvariable ["CaptureCoef","0.05"]; _logic getvariable ["CostInfantry","1"]; _logic getvariable ["CostWheeled","1"]; _logic getvariable ["CostTracked","1"]; _logic getvariable ["CostWater","1"]; _logic getvariable ["CostAir","1"]; _logic getvariable ["CostPlayers","1"]; _logic getvariable ["DefaultOwner","-1"]; _logic getvariable ["TaskOwner",0]; _logic getvariable ["TaskTitle","%1"]; _logic getvariable ["TaskDescription","%1%2%3"]; //game duration variables _logic getvariable ["areas",_areas,true]; _logic getvariable ["sides",_sides,true]; _logic getvariable ["flags",_flags,true]; _logic getvariable ["tasks",_tasks,true]; _logic getvariable ["designation",_designation,true]; _logic getvariable ["sideScore",_sideScore,true]; _logic getvariable ["contested",_contested,true]; _logic getvariable ["owner",_owner,true]; _logic getvariable ["ownerTexture",_iconTexture,true] _logic getvariable ["ownerColor",_iconColor,true]; _logic getvariable ["contested",false,true]; Where _logic is a reference to your sector module or use the name you gave it in the editor. Quick example using something along the lines of what Comp_uter15776 is trying to accomplish. init.sqf if (!isDedicated) then { hintTicketSide = false; fnc_HintTickets = { _HStringWest = format ["West = %1",_this select 0]; _HStringEast = format ["East = %1",_this select 1]; if (hintTicketSide) then { if (side player == west) then { hintSilent _HStringWest; }else{ hintSilent _HStringEast; }; }else{ hintSilent format["%1\n%2",_HStringWest,_HStringEast] }; }; }; if (isServer) then { westTickets = 10; eastTickets = 10; _handle = [] spawn { //while true just for editor testing while {true} do { //count playableUnits >= 1 or {isPlayer _x}count playableUnits for players only //sc1 is the name given to the module in the editor if ((sc1 getVariable "owner") == east) then { WestTickets = westTickets - 1; } else { EastTickets = eastTickets - 1 }; [[westTickets, eastTickets],"fnc_HintTickets",true,false] call BIS_fnc_MP; sleep 60; }; }; }; TestMission inc. MP PBO Shame the module script does not take note of setting variables during operation then you could have scenarios where if a side owns other sectors nearby you can up the cost of things so areas get taken quicker if you own more nearby (a litte bit like planetSide for example). Maybe it does if you disable it change the settings and re-enable, have not tested, only other way is to delete it and spawn a new one i suppose. Anyway hope the above helps you all out.
  21. Larrow

    Timed Server Messages

    Shame there does not seem to be an easy answer to this, kylania's works but you have to line up enough messages to last how ever long the server is going to be up. Mike's relies on scripting the mission, which means you would have to rePBO all mission you had just to incorporate your server messages. Something like onUserConnected = "[{ handle = [] spawn {waitUntil {!isnull player}; while {true} do { systemChat 'server message here'; sleep 900; };};},'BIS_fnc_call',(_this select 0),false] call BIS_fnc_MP;" in the server.cfg would be excellent but i cant get anything (and ive tried multiple different ideas) from this server script line to appear.
  22. Youll have to ignore my noobness really have no experience with administrating with BE but these filters only go in the BE folder yes?So as server admins each time we add a new mod or map we have to find out what is involved in the mod/map (maybe included if the creator is on the ball) and add these filters to our filters in our BE folder! So each time you play a different map the filters currently in the BE could possibly (if not written vague enough to encompass alot of possibilities) interfere with the missions operation. Would it not be possible to let mod/map creators include filters within a BE folder included within the mod/map to relate to their creation (and BE would read them from there)? Then it would just be down to admins to add some coverall concepts in the BE folder. If your running a public server that only runs a one or two map rotation like Occupation, I&A or Wasteland then your filter setup may be pretty easy to envision but if your running with the possibility to select from a multitude of coop missions some filters may not be appropriate and would be better of loaded on a as needed basis? or am i just expecting these filters to do to much and they are only meant as a basic coverall.
  23. This is how the module does it _wp1 setWaypointStatements ["TRUE", " [this, this getVariable 'BIS_SUPP_supportRunCoords', ['B_Parachute_02_F', 'O_Parachute_02_F', 'I_Parachute_02_F'] select ([WEST, EAST, RESISTANCE] find side group this), ['B_supplyCrate_F', 'O_supplyCrate_F', 'I_supplyCrate_F'] select ([WEST, EAST, RESISTANCE] find side group this), this getVariable 'BIS_SUPP_selectedModule'] spawn { _pilot = _this select 0; _wpPos = _this select 1; _chuteType = _this select 2; _crateType = _this select 3; _crateCode = compile ((_this select 4) getVariable 'BIS_SUPP_crateInit'); _oldDist = _pilot distance _wpPos; while {_oldDist >= _pilot distance _wpPos} do { _oldDist = _pilot distance _wpPos; sleep 0.1 }; _pilot setVariable ['BIS_SUPP_supporting', FALSE]; _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY']; _chute setPos [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 50]; _crate = createVehicle [_crateType, position _chute, [], 0, 'NONE']; debuglog str _crateCode; _crate call _crateCode; _crate attachTo [_chute, [0, 0, -1.3]]; waitUntil {position _crate select 2 < 0.5 || isNull _chute}; detach _crate; _crate setPos [position _crate select 0, position _crate select 1, 0] } "]; Inside a waypoint statement but im sure you can pick the necessary bits out of that.
  24. lol Interesting concept :D put something along the lines of handle = this spawn { _wabbit = _this; while {alive _wabbit} do { _Elmas = _this nearEntities ["CAManBase", 5]; if ({side _x == blufor} count _Elmas > 0) then { "HelicopterExploBig" createVehicle getPosATL _wabbit; }; waitUntil {true}; }; }; on your bunnies.
×