Page MenuHomeFeedback Tracker

moduleRespawnVehicle: deserted vehicles respawn only first time
New, NormalPublic

Description

When we synchronise moduleRespawnVehicle with vehicle and use the option desertedDistance,
only vehicles created during game starting can respawn when they are deserted.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 8 x64
Operating System Version
1.98.146373
Category
Scripting
Steps To Reproduce

Synchronise an empty vehicle with the module moduleRespawnVehicle_F,
use following settings:
Delay = 1
DesertedDistance = 5
RespawnCount = -1
Init = ""
Position = 0
PositionType = 0
Wreck = 0
ShowNotification = 1
ForcedRespawn = 0
RespawnWhenDisabled = true

Additional Information

When we put in Init this code, we soluce problem.

/*
	**** Made by Tequiller ****
*/
params [
	["_newVehicle", objNull, [objNull]],
	["_oldVehicle", objNull, [objNull]]
];
//Old Vehicle Remove Handlers
_oldVehicle removeMPEventHandler ["mpkilled", _oldVehicle getvariable ["BIS_fnc_moduleRespawnVehicle_mpkilled", -1]];
_oldVehicle removeMPEventHandler ["mphit", _oldVehicle getvariable ["BIS_fnc_moduleRespawnVehicle_mphit", -1]];
_oldVehicle removeEventHandler ["getout", _oldVehicle getvariable ["BIS_fnc_moduleRespawnVehicle_getout", -1]];
_oldVehicle removeEventHandler ["getin", _oldVehicle getvariable ["BIS_fnc_moduleRespawnVehicle_getin", -1]];
//New Vehicle Init Variables
{
	_newVehicle setvariable [_x, nil];
} forEach [
	"BIS_fnc_moduleRespawnVehicle_cannotMove",
	"BIS_fnc_moduleRespawnVehicle_getin",
	"BIS_fnc_moduleRespawnVehicle_getout",
	"BIS_fnc_moduleRespawnVehicle_mphit"
];
([_newVehicle] + (_newVehicle getVariable "BIS_fnc_moduleRespawnVehicle_data")) call BIS_fnc_moduleRespawnVehicle;

This code should be writed in [BIS_fnc_moduleRespawnVehicle.sqf] just after the following lines

			//--- Unflag killed event
			_newVeh setvariable ["BIS_fnc_moduleRespawnVehicle_mpkilled", nil];

Event Timeline

Tequiller created this task.May 8 2020, 3:53 PM
Tequiller updated the task description. (Show Details)May 8 2020, 3:55 PM
Tequiller edited Steps To Reproduce. (Show Details)
Tequiller edited Additional Information. (Show Details)
Tequiller edited Additional Information. (Show Details)May 8 2020, 6:55 PM
Tequiller edited Additional Information. (Show Details)May 8 2020, 7:15 PM