Jump to content

Scripting Help


tdx73

Recommended Posts

Looking for anyone who could help me write a script for a knock back effect like in this mod

Obnoxious Cicada by MadCat221 and CaBaL120 and AJ Camp

http://newvegas.nexusmods.com/mods/49795

 

Only for npc's. If it is even possible. My goal was to have my child companion have the knock back effect when shooting certain weapons like shotguns and heavy weapons. I contacted the author and he said feel free to dissect his script but I don't even know if it is possible and my scripting ability is lacking. I would think there should be some way to use a list form to identify the weapon equipped and add the effect through a script. Anyone who thinks they may be able to help would be greatly appreciated and credited when I upload the new companion.Thanks.

 

Link to comment
Share on other sites

You can create a custom version of the Shotgun Surgeon perk for your companion, stripping it from all the conditions on weapon type.

Then add the following code to your companion's script (under GameMode block):

if rWeapon != YourCompanionREF.GetEquippedObject 5
	set rWeapon to YourCompanionREF.GetEquippedObject 5
	if (GetWeaponType rWeapon == 8) || (GetWeaponType rWeapon == 9) || (ListGetFormIndex WeaponShotgunList rWeapon >= 0)
		if HasPerk YourKnockbackPerk == 0
			AddPerk YourKnockbackPerk
		endif
	elseif HasPerk YourKnockbackPerk
		RemovePerk YourKnockbackPerk
	endif
endif

 

This will monitor the weapon your companion has equipped, adding/removing the perk, accordingly.

Note:

WeaponShotgunList contains all the shotgun-type weapons in the game.

I assumed that by "heavy weapons" you mean weapons such as the Minigun, Gatling Laser, Grenade Machinegun, Missile Launcher etc. GetWeaponType rWeapon == 8 (or 9) will detect those weapons.

 

I hope that's what you're looking for.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...