Jump to content

Help with basic sexlab script hook setup


Recommended Posts

Posted (edited)

Hi, could someone suggest reasons why the actor isn't being tracked?

isActorTracked always returns false when run.

 

Running 1.5.97

Sexlab framework v163

and Sexlab Framework PPLUS 2.12.0
 

ScriptName foo extends activemagiceffect


SexLabFramework Property SexLab auto
Actor selfRef
String cb

Event OnEffectStart(Actor Target, Actor Caster)
	selfRef = caster
	name = getName()
	cb = name + "_cb"
	SexLab.TrackActor(selfRef, cb)
EndEvent

Event OnHit(...)
	debug.Notification("isTracked: " + SexLab.IsActorTracked(selfRef))
EndEvent

 

Edited by Relevant Halo
Posted (edited)

name = getname()   ;from what ?

name = selfRef.getname()

 

Maybe formcast needed , as actor

Edited by Tlam99
Posted

The reason why GetName works like that is because some (or all?) functions and events from the Actor the ActiveMagicEffect is attached to are available within the MGEF script itself. See the 2nd paragraph at the top here. Since Actor inherits from Form, the GetName function being called here is the one in Form.GetName, not Alias.GetName. Alias does not inherit from Form.

 

Now what happens if you cast this spell on a door for instance, that I do not know. I would assume that does not create an instance of the MGEF script, but I've never tested it. I've had soultrapped doors and such before. One location where it happens practically every time is the quest where you get throw into Azura's Star. Nelacar always hits the star itself trying to soultrap me, making it glow and emit weird noises. Could also be a gimmic/bug of the soul trap archetype.

Posted (edited)
36 minutes ago, traison said:

MGEF script

Thats the point. Inherited. 

It's defined like coincidently. I prefer the definition by assigning the alias via reference to avoid a not defined

reference which is prone to cause issues, even ctd.

Because references of MGEF will not be inherited if effect ends and it cannot be tested if the effect is active.

 

 

Example

Player and npc (followers) are handled completely different on cell change.

Player keeps the effects, npc appear like resurrect and the effects will be reapplied. 

(ever wondered why naked followers appear dressed up on cell chage ?)

If now a follower has the MGEF xxx without clear defined reference, the effect will not be reapplied.

This appearance of followers on cell change will even fire the onequip() event.

(useful for some scripts)

But the MGEF without clear reference is quit dangerous for saves (load saved game).

Edited by Tlam99

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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