AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved [L4D2]How to add damage sources to flying objects (containers, cars, truck) (https://forums.alliedmods.net/showthread.php?t=334349)

a2121858 09-17-2021 10:09

[L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
I want that characters other than tanks can calculate the damage caused by hitting flying objects, etc. (containers, cars, trucks).

For example, when I use this Plugins
https://forums.alliedmods.net/showthread.php?t=126831

In versus mode, when the charger hits the car and hits the survivor, the panel will not calculate the damage.:3

I try to add
PHP Code:

SetEntPropEnt(i_TargetProp_Send"m_hOwnerEntity"client); 

But it didn't work, can anyone help me?:)

Marttt 09-17-2021 11:24

Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
Can't understand what you are trying to say, be more clear.

Check if this is what you are looking for l4d2_hittable_control

This plugin allows changing the damage from hittables

If you want to block the damage from charger hittables then I think you need to store somewhere which infected did the last hit, and check if is a charger, ignore the damage.

a2121858 09-17-2021 12:12

Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
Quote:

Originally Posted by Marttt (Post 2758031)
Can't understand what you are trying to say, be more clear.

Check if this is what you are looking for l4d2_hittable_control

This plugin allows changing the damage from hittables

If you want to block the damage from charger hittables then I think you need to store somewhere which infected did the last hit, and check if is a charger, ignore the damage.

Sorry, my English is not good.
When i use this pluginCharger Power.

In versus mode:

Charger uses its abilities to move cars and cause damage to survivors. The Tab panel does not calculate this damage score, But if the tank fist moves the car and causes damage to the survivors, the Tab panel calculates the damage score.

I need to move the car in charger, and the Tab panel will calculate the damage score.

Thank you for your reply, Mr. Marttt.:)

Silvers 09-17-2021 12:24

Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
You set the "m_hPhysicsAttacker" to the client who last hit it, or maybe "m_hLastAttacker" but I believe it's the former. Then it should credit who hit the object with kills/damage. Some datamap variable like that. Don't have time to check.

a2121858 09-17-2021 12:41

Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
Quote:

Originally Posted by Silvers (Post 2758039)
You set the "m_hPhysicsAttacker" to the client who last hit it, or maybe "m_hLastAttacker" but I believe it's the former. Then it should credit who hit the object with kills/damage. Some datamap variable like that. Don't have time to check.

Thank you for your help, Mr. Silvers.
But after testing, I got this error.
Code:

Exception reported: Property "m_hPhysicsAttacker" not found (entity 116/prop_physics)
Exception reported: Property "m_hLastAttacker" not found (entity 108/prop_physics)

PHP Code:

SetEntPropEnt(i_TargetProp_Send"m_hPhysicsAttacker"i_Client); 
SetEntPropEnt(i_TargetProp_Send"m_hLastAttacker"i_Client); 

:shock:

Silvers 09-17-2021 12:45

Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
datamap not sendprop. Prop_Data.

a2121858 09-17-2021 13:12

Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
Quote:

Originally Posted by Silvers (Post 2758041)
datamap not sendprop. Prop_Data.

sorry sir. I am stupid.

Should it be used like this?
PHP Code:

SetEntPropEnt(i_TargetProp_Data"m_hPhysicsAttacker"i_Client); 

There is no error, but no effect, "m_hPhysicsAttacker" or "m_hLastAttacker", I don't know if it is my problem.:oops:

Silvers 09-17-2021 14:25

Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
Yeah, where are you putting the code?

Edit: I do this in one of my plugins:
PHP Code:

elay)
{
    
SetEntPropEnt(entityProp_Data"m_hPhysicsAttacker"client);
    
SetEntPropFloat(entityProp_Data"m_flLastPhysicsInfluenceTime"GetGameTime()); 

I think that last line might be required, I see it in a few of mine like this.

a2121858 09-17-2021 22:31

Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
Quote:

Originally Posted by Silvers (Post 2758048)
Yeah, where are you putting the code?

Edit: I do this in one of my plugins:
PHP Code:

elay)
{
    
SetEntPropEnt(entityProp_Data"m_hPhysicsAttacker"client);
    
SetEntPropFloat(entityProp_Data"m_flLastPhysicsInfluenceTime"GetGameTime()); 

I think that last line might be required, I see it in a few of mine like this.

I did this, before moving the object.
PHP Code:

float f_Velocity[3], f_Power;

GetAngleVectors(f_Anglesf_VelocityNULL_VECTORNULL_VECTOR);
f_Power g_h_CvarChargerPower.FloatValue;
f_Velocity[0] *= f_Power;
f_Velocity[1] *= f_Power;
f_Velocity[2] *= f_Power;
SetEntPropEnt(i_TargetProp_Data"m_hPhysicsAttacker"i_Client); 
TeleportEntity(i_TargetNULL_VECTORNULL_VECTORf_Velocity); 

I will try the new method later, thank you.:)

Silvers 09-17-2021 22:37

Re: [L4D2]How to add damage sources to flying objects (containers, cars, truck)
 
Yep that seems right, just add in setting float and give it a go. I remember I fixed this in some 3rd party plugin, guess it wasn't this. Hmm.


All times are GMT -4. The time now is 01:34.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.