KiCHo666 Posted March 20, 2017 Share Posted March 20, 2017 (edited) Hello!darthbdaman made a script for me that removes kill impulse from all weapons. I modified the script so that unarmed/melee have random kill impulse with 2 handed melee having the highest kill impulse.This produced a problem where Power Fist has very weak kill impusle since it's Unarmed weapon, so I tried to use GetWeaponAttackAnimation to detect if weapon uses Attack5. (Power fist and its variants use Attack5)Here's part of the code that bugs me: scn KillImpulseNullScript array_var Entry ref rWeap float fRandNum begin GameMode if GetGameRestarted foreach Entry <- (GetLoadedTypeArray 40) let rWeap := *Entry if (GetWeaponType rWeap == 0) && (rWeap.GetWeaponAttackAnimation != 3) <---------- This line should get all weapons that are of type Unarmed and are NOT using Attack5 animation. let fRandNum := Rand 5, 10 SetWeaponKillImpulse rWeap fRandNum elseif (GetWeaponType rWeap == 0) && (rWeap.GetWeaponAttackAnimation == 3) <---------- Same as previous, but only get Unarmed weapons that use Attack5 animation let fRandNum := Rand 30, 50 SetWeaponKillImpulse rWeap fRandNumBut this doesn't work in game. Kills made with Powerfist still use weak 5 to 10 kill impulse value. Help would be appreciated. Edited March 20, 2017 by KiCHo666 Link to comment Share on other sites More sharing options...
Ladez Posted March 20, 2017 Share Posted March 20, 2017 You're calling GetWeaponAttackAnimation using reference syntax, but the list returned by GetLoadedTypeArray contains base forms. This explains the difference. Since you don't have a reference to work with, you need to use base form syntax: if (GetWeaponType rWeap == 0) && (GetWeaponAttackAnimation rWeap != 3) Link to comment Share on other sites More sharing options...
KiCHo666 Posted March 21, 2017 Author Share Posted March 21, 2017 Thank you! It works now. :) Link to comment Share on other sites More sharing options...
mccrackin77 Posted May 17, 2017 Share Posted May 17, 2017 thank you this helped me as well Link to comment Share on other sites More sharing options...
Recommended Posts