Havoc302 Posted January 6, 2015 Report Share Posted January 6, 2015 Has anyone worked out how to get vehicles spawned in by missions to stay? I've tried things like this: _vehicle1 call EPOCH_server_setVToken; _vehicle1 call EPOCH_server_save_vehicle; It was in one of the releases of some mission system but doesn't work, any clues? Link to comment Share on other sites More sharing options...
prue420 Posted January 6, 2015 Report Share Posted January 6, 2015 mine from this last patch are staying and i dont want them to. Link to comment Share on other sites More sharing options...
Richie Posted January 6, 2015 Report Share Posted January 6, 2015 According to Skaronator you just add : _vehicle call EPOCH_server_setVToken; Link to comment Share on other sites More sharing options...
Darth_Rogue Posted January 6, 2015 Report Share Posted January 6, 2015 Try EPOCH_server_hiveSET edit: nvm...Richie beat me to it with better knowledge. :) Link to comment Share on other sites More sharing options...
Havoc302 Posted January 6, 2015 Author Report Share Posted January 6, 2015 Awesome thanks guys, I'll give it a go tonight on my test server. Link to comment Share on other sites More sharing options...
nedfox Posted January 7, 2015 Report Share Posted January 7, 2015 You mean every mission vehicle is going to stay on the map? How do you cope with 5000 mission vehicles, server side, after a week? or are they just saved when someone boards them? Even then, you flood the server with WAY too many vehicles. It totally doesn't make sense to me. Link to comment Share on other sites More sharing options...
Richie Posted January 7, 2015 Report Share Posted January 7, 2015 My server goes through shit loads of vehicles, players have discovered the DLC helis that lift can throw cars like bombs :rolleyes: The old tow/lift script has restrictions, the new lift system doesn't and you can fling a car a long long way. Link to comment Share on other sites More sharing options...
Havoc302 Posted January 7, 2015 Author Report Share Posted January 7, 2015 Perhaps you should go and take a look at most mission systems nedfox, they almost all have a condition in them where the vehicle is deleted at the mission end if there's no players present. So only vehicles that were there when a player completed a mission hangs around and most of those players sell. I don't mind managing manually through the database as well. Link to comment Share on other sites More sharing options...
Havoc302 Posted January 8, 2015 Author Report Share Posted January 8, 2015 Yeah not working guys, changed the code to read: _vehicle1 = createVehicle ["C_Offroad_01_EPOCH",[(_pos select 0) + 20, (_pos select 1), 0],[], 0, "CAN_COLLIDE"]; _vehicle1 call EPOCH_server_hiveSET; Now I get these errors in the log everytime it goes to run a mission: 20:08:09 Error in expression <_ab","_ac","_ad","_ae","_af"];_aa=_this select 0;_ab=_this select 1;_ac=str(_thi> 20:08:09 Error position: <select 0;_ab=_this select 1;_ac=str(_thi> 20:08:09 Error select: Type Object, expected Array,String,Config entry 20:08:09 File x\addons\a3_epoch_server\compile\epoch_hive\EPOCH_server_hiveSET.sqf, line 1 Link to comment Share on other sites More sharing options...
shurix Posted January 8, 2015 Report Share Posted January 8, 2015 I'm looking for an empty slot in the database and saving my mission vehicle there. I take no credit for this code, most of the pieces came from Epoch/Skoronator code. If there are no empty slots, I look for a boat or a kart, delete it from the map and reuse the slot in the database with the mission vehicle. This is not perfect, but I did not find a way to add a new vehicle slot in the database (yet). _instanceID = call EPOCH_fn_InstanceID; diag_log format["WAI: _instanceID:%1",_instanceID]; diag_log format["WAI: EPOCH_VehicleSlotCount:%1",EPOCH_VehicleSlotCount]; diag_log format["WAI: EPOCH_VehicleSlots:%1",EPOCH_VehicleSlots]; // _allowedVehicleList = EPOCH_allowedVehiclesList; // diag_log format["WAI: EPOCH_allowedVehiclesList:%1",_allowedVehicleList]; _vehObj = _this; _randomVehicleIndex = -1; if (EPOCH_VehicleSlotCount==0) then { if (!isNil "EPOCH_allowedVehiclesList") then { _countAllowedVeh=count EPOCH_allowedVehiclesList; _randomVehicleIndex=floor(random(_countAllowedVeh)); _randomVehicle=EPOCH_allowedVehiclesList select _randomVehicleIndex; _vehClass=_randomVehicle select 0; _velimit=_randomVehicle select 1; _vehicleCount={typeOf _x==_vehClass}count vehicles; if(_vehicleCount >=_velimit)then{ EPOCH_allowedVehiclesList deleteAt _randomVehicleIndex; } else { if(_vehicleCount==(_velimit-1))then{ EPOCH_allowedVehiclesList deleteAt _randomVehicleIndex; }; }; } else { // _randomVehicleIndex=floor(random(count vehicles)); // _randomVehicle=vehicles select _randomVehicleIndex; _vehlist = nearestObjects [position _vehObj, ["C_Rubberboat_EPOCH","C_Rubberboat_02_EPOCH","C_Rubberboat_03_EPOCH","C_Rubberboat_04_EPOCH""C_Boat_Civil_01_EPOCH","K01","K02","K03","K04","jetski_epoch"], 10000]; diag_log format["WAI: count _vehlist:%1 | _randomVehicle:%2",count _vehlist,_vehlist select 0]; _vehToDelete = _vehlist select 0; _randomVehicleIndex = _vehToDelete getVariable["VEHICLE_SLOT","ABORT"]; deleteVehicle _vehToDelete; }; }; _slot = ""; if !(EPOCH_VehicleSlots isEqualTo[]) then { _slot = EPOCH_VehicleSlots select 0; EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot]; EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots; publicVariable 'EPOCH_VehicleSlotCount'; } else { diag_log format["WAI: _slot = _randomVehicleIndex:%1",_randomVehicleIndex]; _slot = _randomVehicleIndex; }; if (str(_slot) != "") then { _vehObj setVariable["VEHICLE_SLOT",_slot,true]; private["_aa","_ab","_ac","_ad","_ae","_af","_ag","_ah","_ai","_aj","_ak","_al","_am","_an","_ao","_ap","_aq","_ar"]; if(!isNull _vehObj) then { _aa=_vehObj; // _ac=_vehObj getVariable["VEHICLE_SLOT","ABORT"]; // if(_ac !="ABORT")then{ _ad=format["%1:%2",(call EPOCH_fn_InstanceID),_slot]; _aj=[]; _ak=_aa call EPOCH_getHitpoints; { _aj pushBack(_aa getHitPointDamage _x); }forEach _ak; _wepsItemsCargo=weaponsItemsCargo _aa; if(isNil "_wepsItemsCargo")then{ _wepsItemsCargo=[]; }; _magsAmmoCargo=magazinesAmmoCargo _aa; if(isNil "_magsAmmoCargo")then{ _magsAmmoCargo=[]; }; _aq=[[],[]]; { _ar=_aq find(_x select 0); if(_ar >=0)then{ (_aq select 1)set[_ar,((_aq select 1)select _ar)+(_x select 1)];} else{(_aq select 0)pushBack(_x select 0);(_aq select 1)pushBack(_x select 1);}; }forEach _magsAmmoCargo; _al=[_wepsItemsCargo,_aq,getBackpackCargo _aa,getItemCargo _aa]; _ap=_aa getVariable["VEHICLE_TEXTURE",0]; _am=[typeOf _aa,[getposATL _aa,vectordir _aa,vectorup _aa],damage _aa,_aj,fuel _aa,_al,magazinesAmmo _aa,_ap]; ["Vehicle",_ad,EPOCH_expiresVehicle,_am] call EPOCH_server_hiveSETEX; //}; }; _vehObj call EPOCH_server_vehicleInit; }; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now