Cubitron Posted May 24, 2016 Report Share Posted May 24, 2016 Hello all after a few month i be back and im working an some Scripts but i think i forgot something ?! Vehicle disapear after restart but i want it persistent _wreck = createVehicle ["B_MRAP_01_EPOCH", _pos, [], 0, "NONE"]; clearWeaponCargoGlobal _wreck; clearMagazineCargoGlobal _wreck; clearBackpackCargoGlobal _wreck; clearItemCargoGlobal _wreck; _wreck call EPOCH_server_setVToken; _wreck call EPOCH_server_save_vehicle; _wreck call EPOCH_server_vehicleInit; _wreck setDir (random 360); _wreck setPos _pos; Link to comment Share on other sites More sharing options...
0 rvg?! Posted May 24, 2016 Report Share Posted May 24, 2016 Could collide with max vehicles. And after several restarts you have a lot more vehicles on the map. Could cause vehicle loss for existing vehicles. Just a guess. Link to comment Share on other sites More sharing options...
0 Cubitron Posted May 24, 2016 Author Report Share Posted May 24, 2016 The Vehicles get deleted after failed mission so its not the Problem with to much Vehicles but maybe youre right with the Max Vehicles. Another funny thing is i cant sell the Mission Vehicle Link to comment Share on other sites More sharing options...
0 rvg?! Posted May 24, 2016 Report Share Posted May 24, 2016 Cant sell even if they are in the pricelist? (cfgpricing.hpp) i am on my mobile. Will have a look later if the Greyskull boy isnt faster Link to comment Share on other sites More sharing options...
0 Cubitron Posted May 24, 2016 Author Report Share Posted May 24, 2016 They are in Pricelist, if i spawn it via Infistar i can sell but not with Script spawn Link to comment Share on other sites More sharing options...
0 He-Man Posted May 24, 2016 Report Share Posted May 24, 2016 Can't sell, if the Vehicles have no slot! It is not recommendable to make mission Vehicles persistent, because the max. count of Vehicles is limited by the Vehicle Spawn list. If you have more Vehicles then in the list, new vehicles will override an old one (or will not get a slot and are not persistent) If you really want mission vehicles persistent, you should use an own database entry (independent from the Epoch Vehicles). And you should make a cap of total Vehicles or you will get endless Vehicles on your map. rvg?! 1 Link to comment Share on other sites More sharing options...
0 Cubitron Posted May 24, 2016 Author Report Share Posted May 24, 2016 ok thanks, persistent is not important. Vehicle have no slots? ok. How i add Slots or where i can look for a example? Link to comment Share on other sites More sharing options...
0 He-Man Posted May 24, 2016 Report Share Posted May 24, 2016 Vehicle have a slot -> Vehicle is persistent. Your Problem is: - If you have no slot, you can not sell it. - If you have a slot, it is persistent - To get a slot, you must have free vehicle slots. According to the Vehicle Spawn of the Trader-Code you can try this: Spoiler _veh = "B_MRAP_01_EPOCH"; if !(EPOCH_VehicleSlots isEqualTo[]) then { _lockOwner = ""; _position = !!! YOUR SPWAN POSITION !!!; _vehslot = EPOCH_VehicleSlots select 0; EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_vehslot]; missionNamespace setVariable ['EPOCH_VehicleSlotCount', count EPOCH_VehicleSlots, true]; _vehObj = [_veh,_position,random 360,true,_vehslot,_lockOwner,"NONE",false,false] call EPOCH_spawn_vehicle; } else { diag_log "DEBUG: no slots found to spawn vehicle"; }; But it only spawn a Vehicle, if a Vehicle slot is available! Cubitron 1 Link to comment Share on other sites More sharing options...
0 Cubitron Posted May 24, 2016 Author Report Share Posted May 24, 2016 Thanks, i play a bit with this code Link to comment Share on other sites More sharing options...
0 Grahame Posted May 25, 2016 Report Share Posted May 25, 2016 I've been dealing with this too with SEM (whose mission vehicle code is recent enough to work, unlike WAI). Players do not have a problem spawning vehicles from the Black Market traders, nor do they have a problem with admin spawned vehicles from InfiStar. It seems to only be the mission vehicles that cannot be saved to the DB nor sold to the traders. This issue alone is the single biggest gripe reported to me. Before I made them "savable" the biggest gripe was why can't I have the vehicles from a mission - I've just killed 18 AI with X-ray vision and all I got is this cargo crate. The vehicle limit issue is another thorny issue with me. Fine, there can be performance issues, but if you clean the traders, use Halv's BM trader system (that does not save vehicles to the DB) and encourage players not to horde you can deal with it. In addition, it should be up to the server owner, not imposed by the mod! What would be good, as has been said in the past, would be the ability to specify a maximum number of vehicles in the DB and a spawn list as currently instituted. Server owners, depending on player/vehicle numbers could then play with those numbers to suit the performance needs of the server. I really should be a decision for us, not the mod itself, especially as we head into 0.4? arc7r7 1 Link to comment Share on other sites More sharing options...
Question
Cubitron
Hello all after a few month i be back and im working an some Scripts but i think i forgot something ?!
Vehicle disapear after restart but i want it persistent
_wreck = createVehicle ["B_MRAP_01_EPOCH", _pos, [], 0, "NONE"];
clearWeaponCargoGlobal _wreck;
clearMagazineCargoGlobal _wreck;
clearBackpackCargoGlobal _wreck;
clearItemCargoGlobal _wreck;
_wreck call EPOCH_server_setVToken;
_wreck call EPOCH_server_save_vehicle;
_wreck call EPOCH_server_vehicleInit;
_wreck setDir (random 360);
_wreck setPos _pos;
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now