Jump to content
  • 0

Persistent mission vehicle spawn


Cubitron

Question

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

  • 0

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.

Link to comment
Share on other sites

  • 0

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!

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...