Jump to content

osu_apoc

Member
  • Content Count

    10
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About osu_apoc

  • Rank
    Private
  1. Check out killzonekid.com I'm pretty sure he covered that fully in one of his tutorials.
  2. Will the new client perf build replace the arma3battleye.exe? I'm presuming it will, but just wanted to confirm. EDIT - Battleye gives you the finger. Hrm :-/ Neither Perf or Prof will work as arma3battleye.
  3. Interesting. Thanks for that info! It seems as if you cannot actually execute any real code within the setWaypointStatements statement. No local objects seem to be recognized there. The only thing I can get to be recognized are the group leader, and I suspect I could list the units in the group, per the wiki. I tried a basic log entry for the position of the heli in the waypointStatement, to no avail. Though when I used position of the group leader, the log entry showed just fine. ---------- Post added at 02:40 ---------- Previous post was at 01:41 ---------- Well, Larrow, I looked back upon a post of yours from 2013, which showed how the support module was running the paradrop system. Wow... that thing is clunky. I think I'll give the While {true} method a go and see if that helps the other servers out.
  4. Yeah, was adding stuff in and apparently got lazy. I'll fix that right up. Thankfully there's a cleanup script running in the base Wasteland code that will delete the empty groups fairly routinely, so I'm not terribly concerned with this point yet. However, I'll add in the code to delete the group once the heli has done its job and has been removed. ---------- Post added at 00:05 ---------- Previous post was at 23:58 ---------- Larrow and Killzone_Kid, seems like you are contradicting each other. Is the config not allowing the waypoint completion beyond 100m, or ALWAYS completing once within 100m? For my purposes, this is not much of an issue, though when dropping vehicles their inertia can be an issue, so I've had to drop them at around 125m for them to be near to the player. For this case, I may just have the chopper sit at the waypoint and then detach, then add the new waypoint for an exit point. I'll try using the waypoint statements method (I was not familiar with this previously) to execute the drop. While using the waitUntil, my second conditional statement should have picked up the change in waypoint, even at the end of the flight path. However, the heli would proceed to waypoint 2 and just hover. It seems like the waitUntil, at some point, just stopped being evaluated. Though, none of the subsequent code seemed to be either.
  5. I've developed an airdrop system for Wasteland, the gist of which is a player makes a selection via a command menu, a heli and the object are spawned, object attaches to heli. The heli then flies to the drop point (through) and on to a final destination. I've got a waitUntil in the server function which should check a distance between the heli and drop point for release, OR if the heli's pilot's current waypoint is equal to the final waypoint, the object should detach. My issue is that on some servers, under load (not always though) the heli flies through the point and the object never detaches. This is not consistent behavior. On my test server I'd say it is 100% reliable when I've tried it. My script follows this model: Client uses command menu to initialize a client-sided script. This client sided script does some permission/funding checks, and passes arguments to a server-sided function (compiled at server start(compile preprocessFileLineNumbers)) via BIS_fnc_MP. Typically everything works fine, but as I've said, sometimes the heli just overflies the drop point and continues on to its final destination without dropping the object. Here's the code for the server function: //Server Function for Airdrop Assistance //Arguments passed from client script and command menus //Author: Apoc //Credits: Some methods taken from Cre4mpie's airdrop scripts, props for the idea! //Starts off much the same as the client start. This is to find information from config arrays private ["_type","_selection","_player"]; //Variables coming from command menu and client side APOC_cli_startAirdrop _type = _this select 0; _selectionNumber = _this select 1; _player = _this select 2; diag_log format ["SERVER - Apoc's Airdrop Assistance - Player: %1, Drop Type: %2, Selection #: %3",name _player,_type,_selectionNumber]; //hint format ["Well we've made it this far! %1, %2, %3,",_player,_type,_selectionNumber]; _selectionArray = []; switch (_type) do { case "vehicle": {_selectionArray = APOC_AA_VehOptions}; case "supply": {_selectionArray = APOC_AA_SupOptions}; case "picnic": {_selectionArray = APOC_AA_SupOptions}; default {_selectionArray = APOC_AA_VehOptions; diag_log "AAA - Default Array Selected - Something broke";}; }; _selectionName = (_selectionArray select _selectionNumber) select 0; _selectionClass = (_selectionArray select _selectionNumber) select 1; _price = (_selectionArray select _selectionNumber) select 2; _playerMoney = _player getVariable ["bmoney", 0]; if (_price > _playerMoney) exitWith{}; _playermoney = _player setVariable ["bmoney", _playermoney - _price, true]; [_player] spawn fn_savePlayerData; //OK, now the real fun /////// Let's spawn us an AI helo to carry the cargo ///////////////////////////////////////////////// _heliType = "B_Heli_Transport_03_unarmed_F"; _center = createCenter civilian; _grp = createGroup civilian; if(isNil("_grp2"))then{_grp2 = createGroup civilian;}else{_grp2 = _grp2;}; _flyHeight = 350; _dropSpot = [(position _player select 0),(position _player select 1),_flyHeight]; _heliDirection = random 360; _flyHeight = 200; //Distance from ground that heli will fly at _heliStartDistance = 5000; _spos=[(_dropSpot select 0) - (sin _heliDirection) * _heliStartDistance, (_dropSpot select 1) - (cos _heliDirection) * _heliStartDistance, (_flyHeight+200)]; diag_log format ["AAA - Heli Spawned at %1", _spos]; _heli = createVehicle [_heliType, _spos, [], 0, "FLY"]; _heli allowDamage false; _heli setVariable ["R3F_LOG_disabled", true, true]; [_heli] call vehicleSetup; _crew = [_grp, _spos] call createRandomSoldierC; _crew moveInDriver _heli; _crew allowDamage false; _heli setCaptive true; _heliDistance = 5000; _dir = ((_dropSpot select 0) - (_spos select 0)) atan2 ((_dropSpot select 1) - (_spos select 1)); _flySpot = [(_dropSpot select 0) + (sin _dir) * _heliDistance, (_dropSpot select 1) + (cos _dir) * _heliDistance, _flyHeight]; _grp setCombatMode "BLUE"; _grp setBehaviour "CARELESS"; {_x disableAI "AUTOTARGET"; _x disableAI "TARGET";} forEach units _grp; _wp0 = _grp addWaypoint [_dropSpot, 0, 1]; [_grp,1] setWaypointBehaviour "CARELESS"; [_grp,1] setWaypointCombatMode "BLUE"; [_grp,1] setWaypointCompletionRadius 20; _wp1 = _grp addWaypoint [_flySpot, 0, 2]; [_grp,2] setWaypointBehaviour "CARELESS"; [_grp,2] setWaypointCombatMode "BLUE"; [_grp,2] setWaypointCompletionRadius 20; _heli flyInHeight _flyHeight; //////// Create Purchased Object ////////////////////////////////////////////// _object = switch (_type) do { case "vehicle": { _objectSpawnPos = [(_spos select 0), (_spos select 1), (_spos select 2) - 5]; _object = createVehicle [_selectionClass, _objectSpawnPos, [], 0, "None"]; diag_log format ["Apoc's Airdrop Assistance - Object Spawned at %1", position _object]; _object setVariable ["A3W_purchasedStoreObject", true]; _object setVariable ["A3W_purchasedVehicle", true, true]; _object setVariable ["ownerUID", getPlayerUID _player, true]; [_object, false] call vehicleSetup; if (_object getVariable ["A3W_purchasedVehicle", false] && !isNil "fn_manualVehicleSave") then { _object call fn_manualVehicleSave; }; _object attachTo [_heli, [0,0,-5]]; //Attach Object to the heli _object }; case "supply": { _objectSpawnPos = [(_spos select 0), (_spos select 1), (_spos select 2) - 5]; _object = createVehicle ["B_supplyCrate_F", _objectSpawnPos, [], 0, "None"]; _object setVariable ["A3W_purchasedStoreObject", true]; [_object, _selectionClass] call fn_refillbox; _object attachTo [_heli, [0,0,-5]]; //Attach Object to the heli _object }; case "picnic": //Beware of Bears! { _objectSpawnPos = [(_spos select 0), (_spos select 1), (_spos select 2) - 5]; _object = createVehicle ["B_supplyCrate_F", _objectSpawnPos, [], 0, "None"]; diag_log format ["Apoc's Airdrop Assistance - Object Spawned at %1", position _object]; _object setVariable ["A3W_purchasedStoreObject", true]; _object attachTo [_heli, [0,0,-5]]; //Attach Object to the heli _object } }; _object allowDamage false; //Let's not let these things get destroyed on the way there, shall we? diag_log format ["Apoc's Airdrop Assistance - Object at %1", position _object]; //A little log love to confirm the location of this new creature //Wait until the heli is close to the drop spot, then move on to dropping the cargo and all of that jazz // fix the drop distance between vehicles and ammo boxes - Creampie if (_type == "vehicle") then { WaitUntil{ if ((([_heli, _dropSpot] call BIS_fnc_distance2D)<125)||(currentWaypoint _grp == 2)) exitWith{true}; false }; } else { WaitUntil{ if((([_heli, _dropSpot] call BIS_fnc_distance2D)<50)||(currentWaypoint _grp == 2)) exitWith {true}; false }; }; detach _object; //WHEEEEEEEEEEEEE _objectPosDrop = position _object; _heli fire "CMFlareLauncher"; _heli fire "CMFlareLauncher"; //Delete heli once it has proceeded to end point [_heli,_grp,_flySpot,_dropSpot,_heliDistance] spawn { private ["_heli","_grp","_flySpot","_dropSpot","_heliDistance"]; _heli = _this select 0; _grp = _this select 1; _flySpot = _this select 2; _dropSpot = _this select 3; _heliDistance = _this select 4; while{([_heli, _flySpot] call BIS_fnc_distance2D)>200}do{ if(!alive _heli || !canMove _heli)exitWith{}; sleep 5; }; waitUntil{([_heli, _dropSpot] call BIS_fnc_distance2D)>(_heliDistance * .5)}; { deleteVehicle _x; } forEach units _grp; deleteVehicle _heli; }; //Time based deletion of the heli, in case it gets distracted [_heli,_grp] spawn { private ["_heli","_grp"]; _heli = _this select 0; _grp = _this select 1; sleep 30; if (alive _heli) then { { deleteVehicle _x; } forEach units _grp; deleteVehicle _heli; diag_log "AIRDROP SYSTEM - Deleted Heli after Drop"; }; }; WaitUntil {(((position _object) select 2) < (_flyHeight-20))}; _heli fire "CMFlareLauncher"; _objectPosDrop = position _object; _para = createVehicle ["B_Parachute_02_F", _objectPosDrop, [], 0, ""]; _object attachTo [_para,[0,0,-1.5]]; _smoke1= "SmokeShellGreen" createVehicle getPos _object; _smoke1 attachto [_object,[0,0,-0.5]]; _flare1= "F_40mm_Green" createVehicle getPos _object; _flare1 attachto [_object,[0,0,-0.5]]; if (_type == "vehicle") then {_object allowDamage true;}; //Turn on damage for vehicles once they're in the 'chute. Could move this until they hit the ground. Admins choice. WaitUntil {((((position _object) select 2) < 1) || (isNil "_para"))}; detach _object; _smoke2= "SmokeShellGreen" createVehicle getPos _object; //_smoke2 attachto [_object,[0,0,-0.5]]; _flare2= "F_40mm_Green" createVehicle getPos _object; //_flare2 attachto [_object,[0,0,-0.5]]; sleep 2; if (_type == "picnic") then { //So let's go ahead and delete that ugly ammo pallet and create a wonderful picnic basket/barrel _objectLandPos = position _object; deleteVehicle _object; _object2 = switch (_selectionClass) do { case "Land_Sacks_goods_F": { _object2 = createVehicle [_selectionClass, _objectLandPos, [], 0, "None"]; _object2 setVariable ["food", 50, true]; _object2 }; //A very big picnic, no? case "Land_BarrelWater_F": { _object2 = createVehicle [_selectionClass, _objectLandPos, [], 0, "None"]; _object2 setVariable ["water",50, true]; _object2 }; }; }; Does anyone have any tips on how I can sort out this issue? I've captured no errors in client or server logs that point to any issue with this system.
  6. Thanks! I figured that was the issue after I puzzled on it during the drive to the office. That's what I get for trying to bash some test code together without being thorough enough! Thanks again for the help, folks!
  7. We both missed the fact that in my private statement, I did not use quotation marks on the variables... Thus the reason it was in a tizzy... Thanks for the help looking at it. Now the next step is to see why it does not like adjusted _spawnPos. Returns a zero divisor error in the serverlog.
  8. Eh, still getting the same error in the server log.
  9. So, I'm working on my own version of the airdrop script that Creampie had shown (on Wasteland forums), and I wanted to move the creation functions server-side (Creampie's version trigged BE filters). I'm in the process of testing and figuring out how to use this BIS function further down the road. So what I've done is add a player action to call a simple vehicle spawn script that spawns an ATV near the player. However, I'm apparently not passing the player object to the server properly, as the server-side function does not receive the player object and returns an error about undefined variable. Player Action Code (part of an addaction array in playeractions.sqf) [format ["<img image='client\icons\playerMenu.paa' color='%1'/> <t color='%1'>[</t>Airdrop Test<t color='%1'>]</t>", "#FF0000"],{[[player],"APOC_srv_spawnVEH",false,false] call BIS_fnc_MP}, [], -100, false] Server Function Code private [_player, _playerPOS, _vehicleChoice, _choiceCost]; _player = _this select 0; //_vehicleChoice = _this select 1; _playerPOS = getPos _player; _spawnPOS = [_playerPOS select 0, _playerPOS select 1 + 5, _playerPOS select 2 + 10]; _veh = "Quadbike_01_base_F" createVehicle _spawnPOS; Server Error Error in expression <ce\APOC_srv_spawnVEH.sqf" private [_player, _playerPOS, _vehicleChoice, _ch> Error position: <_player, _playerPOS, _vehicleChoice, _ch> Error Undefined variable in expression: _player So what am I hosing up here?
  10. So I've added this to our A3 Wastelands test server, and I've come up with a couple of issues. 1) In fn_sv_armedAT.sqf, Line 30, the call for vip_sms_fnc_sv_remove is using local variable _d. However, I do not see that variable being declared/defined anywhere. I'm assuming that it was meant to be _dummy. 2) After a player is killed, they no longer have the action menu option for explosives. I'm guessing that has to do with the calls for the menu being in the description.ext. That being the case, the menu would only load on mission load, but something within the Wasteland mission is probably removing all action menu options, thereby "disabling" the SMS menu. EDIT - Hours later ------------------- The change in the _d --> _dummy seemed to fix that error being thrown. Also figured out how to integrate into A3Wasteland mission. Very nice script! Thanks for all of the hard work!
×