In the testing that I did with
HugePinball while he was working on http://www.fallout3nexus.com/downloads/file.php?id=11532, we found the http://geck.gamesas.com/index.php/GetSelf seems to always return 0 when called on a reference saved in the save game, such as one created via http://geck.gamesas.com/index.php/PlaceAtMe.
Taking this into account, I recognise surrounding code using the return value of http://geck.gamesas.com/index.php/GetSelf in a conditional block checking that it has returned a value, and (this is important)
only using it when absolutely necessary. This includes always calling functions implicitly (i.e. "
Function" instead of "
ref.Function") when possible.
The code that you've used only needs to use the return value of http://geck.gamesas.com/index.php/GetSelf when calling http://geck.gamesas.com/index.php/PushActorAway, and you could probably achieve the same effect by damaging the actor's fatigue. Here's some code that uses http://geck.gamesas.com/index.php/PushActorAway if http://geck.gamesas.com/index.php/GetSelf works, and damages the actor's fatigue otherwise.:
ScriptName PhalanxFoesSMBerserkerUnarmedSCRIPTref rSelffloat fFatigueBegin ScriptEffectStart set PhalanxFoesReworkedMisc.BerserkerHitCount to PhalanxFoesReworkedMisc.BerserkerHitCount + 1 if PhalanxFoesReworkedMisc.BerserkerHitCount > 2 set PhalanxFoesReworkedMisc.BerserkerHitCount to 0 if GetIsReference player ; This is more reliable than using "if GetSelf == player", and doesn't require use of GetSelf AddScriptPackage PhalanxFoesReworkedPlayerFallDown set PhalanxFoesReworkedMisc.PlayerFallDown to 1 ApplyImageSpaceModifier PhalanxFoesReworkedMQ08FadeInFromWhiteISFX PlaySound AMBRDunwichVoice elseif GetIsCreatureType 4 == 0 set rSelf to GetSelf if rSelf PushActorAway rSelf -1 else ; if rSelf == 0 set fFatigue to GetActorValue Fatigue DamageActorValue Fatigue fFatigue endif StopCombatAlarmOnActor StopCombat endif endifEnd
Cipscis