Jump to content

Script Issue


Highlord90

Recommended Posts

As some people may know when you reanimate a corpse with the Staff of Worms it usually attacks enemies for you but the guards seem to retain their faction loyalty and only attack you upon reanimation so I composed a script that I thought would fix this. The construction set accepts the script so I can assume its properly written but it doesn't have the desired effect of making guards not attack you and instead only attack enemies.

 

Here's what I have sdo far, I've been testing it on Imperial City guards only but to no avail, anyone able to spot a mistake?

 

 

SCN AAResurectionSCRIPT
short updateCount
Begin ScriptEffectStart
SetFactionRank ICFaction -1
SetFactionRank ImperialLegion -1
SetFactionRank ImperialWatch -1
SetFactionRank PlayerFaction, 1
Activate
End
Link to comment
Share on other sites

Just guessing (some thoughts) ,without knowing how reanimate works ,i havent complete mages guild quests in my current game

 

SCN AAResurectionSCRIPT

short updatecount
ref targetGref


Begin ScriptEffectStart

set targetGref to getself ;
if (targetGref.GetInFaction ImperialLegion && targetGref.GetDead == 1 );maybe without the second condition
set updateCount to 1
endif
end

Begin scripteffectupdate

if updateCount == 1
targetGref .SetFactionRank ICFaction -1
targetGref .SetFactionRank ImperialLegion -1
targetGref .SetFactionRank ImperialWatch -1
targetGref .SetFactionRank PlayerFaction, 0
targetGref.Moddisposition player 30
targetGref.SetIgnoreFriendlyHits 1
set updateCount to 0
endif
End

 

or

 

SCN AAResurectionSCRIPT

short introub
ref targetGref



Begin OnMagicEffectHit REAN

set targetGref to getself
if (targetGref.GetInFaction ImperialLegion && targetGref.GetDead == 1 )
set introub to 1
endif
end

Begin GameMode

If introub == 0
Return
Else

If introub == 1
targetGref .SetFactionRank ICFaction -1
targetGref .SetFactionRank ImperialLegion -1
targetGref .SetFactionRank ImperialWatch -1
targetGref .SetFactionRank PlayerFaction, 0
targetGref.Moddisposition player 30
targetGref.SetIgnoreFriendlyHits 1
Set introub to 0

endif


endif

End

 

Edited by kastano
Link to comment
Share on other sites

  • Recently Browsing   0 members

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