Jump to content

[LE] Disabling Havok on objects with spell


Recommended Posts

This one's going to be confusing, but I'll try my best to explain.

 

I recently created a pair of spells (Havok freeze and Havok unfreeze) that, as their names suggest, turn Havok off and on respectively for NPC's. They do work for infinitely paralyzing NPC's, as they disable the AI and they can't move until unfrozen, even when cells reload, which is what sets this apart from the Paralysis effect, which clears when the cell reloads.

 

However, they are not perfect, and I can't improve them any more on my own. The issues are twofold. First, they don't work on objects. This is no surprise considering that they are coded with akTarget and akCaster. (They do affect doors, gates, and one specific rock in Whiterun that, when hit, becomes a gate, which is weird since I have Open Cities and the gates are just that- gates. They don't load a new cell, but this random rock does.) Does anyone know how I can edit the code to make it work on objects like weapons, chairs, baskets, etc?

 

The second issue is this: when I use the spell, the NPC becomes impossible to move when killed, despite the motion type being (1, false), which means they are mobile when hit. Using (1, true) does not fix the issue.

 

Here's the code from both; if anyone sees what's causing the second issue, please tell me. If anyone knows how to rewrite the code to fix the first, also please tell me.

 

Havokstart (the one that unfreezes them)

Scriptname havokstart extends activemagiceffect  
Event OnEffectStart(Actor AkTarget, Actor akCaster)
AkTarget.EnableAI(true)
AkTarget.SetMotionType(1, true)
EndEvent
Havokstop (the one that freezes them, and the one that's broken)
Scriptname havokstop extends activemagiceffect  
Event OnEffectStart(Actor AkTarget, Actor akCaster)
AkTarget.EnableAI(false)
AkTarget.SetMotionType(1, false)
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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