Jump to content

[Solved] Can't get a simple Calm spell to work.


Guest

Recommended Posts

Posted

I'm trying to apply a simple Calm spell to a list of actors however I can't get the spell itself to stop the actors from attacking me. I'm currently testing with a hostile Giant.

 

  • I know the spell is being applied to the actors. I checked this using the in-game console and the hasspell command.
  • I've been analyzing other mods such as Submit and how they do their Calm spells but see no obvious faults.

 

The spell is being added to actors through a quest script. I'd imagine this part is working because the spell is confirmed to have been added to the actors.

While actorId < actors.length
    actor this = actors[actorId]
    
    ; Add calm spell to everyone except the player
    If (this != PlayerRef)
        this.AddSpell(RzCalmSpell)
    EndIf
    
    ; Increment actor id
    actorId += 1
EndWhile

I attached screenshots of the relevant forms in Creation Kit here:

Spoiler

spell.jpg.518c209ef2c03e86c30ecca1428f32ac.jpg

spell_effect.jpg.b29e988ca01a1bafd536b13445f08980.jpg

mgef.jpg.14a581112442892de8623b222fd89ef6.jpg

 

Posted

Got it to work now. The Calm spell in Random Sex is different than the other examples I looked at. New code and forms below:

While actorId < actors.length
    actor this = actors[actorId]
    
    ; Add calm spell to everyone except the player
    If (this != PlayerRef && this.is3DLoaded())
        ;this.AddSpell(RzCalmSpell)
        RzCalmSpell.cast(this, this)
    EndIf
    
    ; Increment actor id
    actorId += 1
EndWhile
Spoiler

mgef.jpg.09e2bb1399443272accaa56419cfaf2a.jpg

spell.jpg.c54d2804a51a313631d6412ba3ef7373.jpg

spell_effect.jpg.9cfec7fed829a9cf39b96d5f35ff2d78.jpg

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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