• 0
Vondu

A way to reduce player damage while on quad

Question

I'm sure this has been asked before but for the life of me I can't seem to find it.

Is there a way to reduce the collision damage a player takes while driving a specific quad?  Or has anyone already written a script for this?  For instance the one I call for the deploy quad app on the xm8.  Not bullet damage but collision damage.  Not trying to make the quad an indestructible ramming device was thinking about map objects like the death bushes.

I could probably write a script but why re-invent the wheel right?

Share this post


Link to post
Share on other sites

11 answers to this question

  • 0

Do you use Infistar? If so... Line 633 that should do the trick.

/*
		block damage completely if the source of the damage is NULL
		(for example if you crash into a bush the source is NULL)
	*/
	BlockNullSource = "true";

 

  • Like 1

Share this post


Link to post
Share on other sites
Advertisement
  • 0

OK I have it so players don't take damage while on a deployed quad.  Now I would like to take it one step further.

I use ExAd Deploy Quad.  I would like to modify the deployvehicle function to include the allowdamage false but I cant figure out where to put it.

Here is the code:

Spoiler

 

params ["_playerNetId","_configClass","_player","_spawnPos","_spawnDir","_usePositionATL","_vehObj"];

_player = objectFromNetId _playerNetId;

_spawnPos = _player modelToWorld [0,2,1];
_spawnDir = direction _player;
_usePositionATL = true;

_vehicleClass = getText(missionConfigFile >> "CfgXM8" >> _configClass >> "vehicleClass");

_vehObj = [_vehicleClass, _spawnPos, _spawnDir, _usePositionATL] call ExileServer_object_vehicle_createNonPersistentVehicle;

if( getNumber(missionConfigFile >> "CfgXM8" >> _configClass >> "packable") > 0 ) then {
    _vehObj setVariable ["ExAd_DV_Packable", true, true];
};

if( getNumber(missionConfigFile >> "CfgXM8" >> _configClass >> "autoCleanUp") > 0 ) then {
    [_vehObj] spawn {
        private ["_wait","_tick", "_vehObj","_driver"];
        _wait = true;
        _tick = 0;
        _vehObj = [_this,0,objNull] call BIS_fnc_param;
        while {_wait} do {
            UISleep 1;
            if(isNull _vehObj)exitWith{_wait = false};
            
            _driver = driver _vehObj;
            if(isNull _driver)then{
                _tick = _tick + 1;
            }else{
                _tick = 0;
            };

            if(_tick >= ExAd_DV_DESPAWN_IDLE_TIME)exitWith{_wait = false};
        };

        moveOut (driver _vehObj);
        _vehObj call ExileServer_system_vehicleSaveQueue_removeVehicle;
        _vehObj call ExileServer_system_simulationMonitor_removeVehicle;
        deleteVehicle _vehObj;
        
    };
};

true

 

I'm thinking it needs to be in this sectoin maybe?

Spoiler

if( getNumber(missionConfigFile >> "CfgXM8" >> _configClass >> "autoCleanUp") > 0 ) then {
    [_vehObj] spawn {
        private ["_wait","_tick", "_vehObj","_driver"];
        _wait = true;
        _tick = 0;
        _vehObj = [_this,0,objNull] call BIS_fnc_param;
       while {_wait} do {
            UISleep 1;
            if(isNull _vehObj)exitWith{_wait = false};
            
            _driver = driver _vehObj;
            if(isNull _driver)then{
                _tick = _tick + 1;
            }else{
                _tick = 0;
            };

            if(_tick >= ExAd_DV_DESPAWN_IDLE_TIME)exitWith{_wait = false};
        };

        moveOut (driver _vehObj);
        _vehObj call ExileServer_system_vehicleSaveQueue_removeVehicle;
        _vehObj call ExileServer_system_simulationMonitor_removeVehicle;
        deleteVehicle _vehObj;
        
    };

Any ideas?

Share this post


Link to post
Share on other sites
  • 0

What exactly are you trying to do? Is the vehicle blowing up when spawned? Are you trying to completely remove all damage detection from the vehicle class?

Share this post


Link to post
Share on other sites
  • 0

I'm trying to make it so the quad doesn't take damage.  The player hits a bush or a wall.  I prefer it to negate environmental damage like damage source was null.  If it gets hit with an RPG then I would like it to blow up.  If that is too difficult then they will just have to drive safer.

 

Share this post


Link to post
Share on other sites
  • 0

Messing around with allowdamage will basically put it and possibly the driver in godmode, so I wouldn't go about it that way.

You can add in additional code into infiSTARs damage handlers for vehicles if the player is in the vehicle. So something using the vehicle player condition. Look at EXILE_AH.sqf on line 1284 or just search infiSTAR_handleDamage and recreate the player Event Handlers but add in vehicle player and test it. It's not fancy but it's a start.

Edited by Beowulfv
  • Like 1

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, NFGCaboose-1 said:

@Vondu That's why I use the RHS MRZ brother:)

That vehicle is amazing, however it is broken. Ram it into any roaming AI vehicle and you will see.

Share this post


Link to post
Share on other sites
  • 0
15 hours ago, NFGCaboose-1 said:

@Vondu That's why I use the RHS MRZ brother:)

@NFGCaboose-1 Yeah, I was trying to avoid adding RHS if possible.  Trying to keep the server with as few mods as possible.  BTW, thank you for all your help!

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.