nickfelstone Posted December 30, 2016 Posted December 30, 2016 Okay, I need help now. I've gotten to a point where I'm confused as to how I'm doing this wrong. I'm defining the property the same as Rats in the Wall and as suggested in the original post, as well as applying the amputator function the same as rats in the wall and as suggested. Here's my script, which is attached to a referencealias for the player in order for the OnHit event to register properly. I know everything but my function calls are running properly due to the debug messages appearing as intended. This is how Haeretic described the hookup process: Add the Amputator script as a property to you script like this:AmputatorMainScript Property AMS AutoCall this Function to edit an actor:AMS.ApplyAmputator(Actor akActor, int morphType ,int bothLeftRight)morphType determines which bodypart to remove, the codes are:0 = Heal all Amputations1 = Feet2 = Lower Legs3 = Upper Legs4 = Hands5 = Forearms6 = UpperArmsbothLeftRight determines which side to remove0 = Both sides1 = Left2 = Right My script: Scriptname combatamputate extends ReferenceAlias{comments are in curly-que brackets}Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, \bool abSneakAttack, bool abBashAttack, bool abHitBlocked)int AmpChance = Utility.RandomInt()If(akSource as Weapon)If abPowerAttack == 1If abHitBlocked == 1Elsedebug.notification("You've been hit! AmpChance =" + AmpChance as Int)If AmpChance >= 50CombatAmputate()ElseEndIfEndIfEndIfEndIfEndEventFunction CombatAmputate()int LimbSelect = Utility.RandomInt(1, 6)int SideSelect = Utility.RandomInt(1, 2)If SideSelect == 1If LimbSelect == 1debug.notification("Your left foot has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 2debug.notification("Your lower left leg has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 3debug.notification("Your left leg has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 4debug.notification("Your left hand has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 5debug.notification("Your lower left arm has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 6debug.notification("Your left arm has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)EndIfElseIf SideSelect == 2If LimbSelect == 1debug.notification("Your right foot has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 2debug.notification("Your lower right leg has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 3debug.notification("Your right leg has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 4debug.notification("Your right hand has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 5debug.notification("Your lower right arm has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)ElseIf LimbSelect == 6debug.notification("Your right arm has been cut off!")AMS.ApplyAmputator(playerref, 3, 2)EndIfEndIfEndFunctionAmputatorMainScript Property AMS AutoActor property playerref auto I don't understand where I'm going wrong. It works in the case of Rats in the Wall, the WIP quest mod using the amputator framework. For some background, this code is supposed to apply the amputator on an unblocked power attack, randomly removing a hand/foot/limb. I know that the numbers in my ApplyAmputator function calls don't line up with the random values or the text, but it's because it was easier to copy-paste lines while troubleshooting this issue. CombatAmputationV05.7z
nickfelstone Posted December 31, 2016 Author Posted December 31, 2016 I'm sorry to bump this but I'm really quite lost on why this might not be working.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.