AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved [L4D2] Survivors with Special Infected Weapons? (https://forums.alliedmods.net/showthread.php?t=327961)

philipjfry 10-18-2020 15:45

[L4D2] Survivors with Special Infected Weapons?
 
https://www.youtube.com/watch?v=kqfv...nnel=Pelipoika

Anyone know what netprops need to be set for similar result after equipping 'weapon_tank_claw' or 'weapon_charger_claw' to be able to use SI abilities as a survivor?

Edit: I need to set the "m_customAbility" of an SI to a survivor client index, How to do so?

xerox8521 10-19-2020 15:14

Re: [L4D2] Survivors with Special Infected Weapons?
 
You probably need to create the ability first with CreateEntityByName.
Those are the abilities used by the game:

- ability_tongue
- ability_selfdestruct // Boomer Exploding
- ability_vomit // Actual boomer vomit
- ability_lunge // Hunter Pounce
- ability_spit
- ability_leap // Jockey Leap
- ability_charge
- ability_throw

Once created you can set them with SetEntPropEnt(client, Prop_Send, "m_customAbility", ability);

Not sure if you need to set more but this should do.

philipjfry 10-19-2020 17:32

Re: [L4D2] Survivors with Special Infected Weapons?
 
Quote:

Originally Posted by xerox8521 (Post 2721930)
You probably need to create the ability first with CreateEntityByName.
Those are the abilities used by the game:

- ability_tongue
- ability_selfdestruct // Boomer Exploding
- ability_vomit // Actual boomer vomit
- ability_lunge // Hunter Pounce
- ability_spit
- ability_leap // Jockey Leap
- ability_charge
- ability_throw

Once created you can set them with SetEntPropEnt(client, Prop_Send, "m_customAbility", ability);

Not sure if you need to set more but this should do.

Thanks, didn't seem to work from my test though (still can't charge with the charger claw weapon), here is what i tried:

PHP Code:

int wp_index GivePlayerItem(client"weapon_charger_claw");
if (
wp_index == -|| !IsValidEntity(wp_index))
  return;

EquipPlayerWeapon(clientwp_index);

int ability CreateEntityByName("ability_charge");
if (
ability != -1)
{
    
DispatchSpawn(ability);
    
SetEntPropEnt(abilityProp_Data"m_hOwnerEntity"client);
    
SetEntPropEnt(clientProp_Send"m_customAbility"ability);



BHaType 10-20-2020 03:03

Re: [L4D2] Survivors with Special Infected Weapons?
 
Perhaps, in order for some abilities to work, you still need to change the player model ( in particular, for the tank's ability )


philipjfry 10-20-2020 12:07

Re: [L4D2] Survivors with Special Infected Weapons?
 
Quote:

Originally Posted by BHaType (Post 2721976)
Perhaps, in order for some abilities to work, you still need to change the player model ( in particular, for the tank's ability )


Thx, this worked okay. what is the name of that 'VIRTUAL' address you are using btw?

BHaType 10-20-2020 19:20

Re: [L4D2] Survivors with Special Infected Weapons?
 
VIRTUAL is just a offset to get "CBaseAbility::OnCreate"


All times are GMT -4. The time now is 06:21.

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