Jump to content

dimmu1313

Recommended Posts

Ok so I think I've gotten on the wrong side of something and I just can't figure this out. I think what I'm running into what we call in the electronics world a "race condition".

 

I'm instantiating an actor by using the placeactoratme() function. I want the actor to be dead, then resurrect. I'm doing this by having the player destroy a certain object with a certain spell, and in the script on that object, it runs placeactoratme(player) then kills the actor. That works fine. The actor appears and drops dead almost instantly. Then what I want is that actor to cast dunReanimateSelf on herself so that the resurrection visual effect etc happens and she comes alive and starts attacking. The problem is that the actor just plain won't cast the spell. What's strange is i've used this tactic of having a dead actor cast reanimate on itself in other places and it works fine, but it was always within the OnActivate event, like the player walks through an activator primitive that is the actor's activating parent, then i call the cast function to cast the reanimation spell. no problem.

 

here, the only events i have to choose from are things like, onload, oninit, oncelllattach, etc., and none of them work. i put debug.notification in all the events on the base actor script, and they all fire, but i think what seems to be happening is that the placeactoratme fires the oninit and onload events right away and then the kill function fires and it's too late to call the cast function inside the onload, etc events. I also tried the OnDeath event, and that did nothing. I'm thinking it didn't work there because the ondeath event triggers at the beginning of the death sequence, and the reanimate spells maybe doesnt recognize the actor as dead yet since the ondeath event hasnt completed yet.

 

anyway, bottom line, the actor isn't casting the reanimate spell, and i'm not sure when or how i can trigger it to cast. by the way, to further add complications, the player would have the object they are supposed to destroy in their inventory, so this process could take place anywhere, therefore i can't just have a disabled instance of the actor. they could trigger this whole sequence anywhere at all, so the placeactoratme function is required from what i can tell. i think there are ways to move pre-loaded actor and object instances within the same cell, but i don't know if that can be done from anywhere in the game to and from any cell.

 

help!

Link to comment
Share on other sites

First off, please show the script you're working on :)

Then, afaik know, the onInit() and onLoad() events can't be fired by the spell, but rather the first one is fired when the script, along w/ all its properties, is initialized, while the second should fire once all objects (including their 3d) within the parent cell are loaded.

Also, onDeath() does not fire at the start, but rather at the end of an actor's dying sequence. For the start of the dying sequence you might want to use onDying().

 

Are you using the reanimate spell because you need some kind of effect to show or just to revive the actor? In the latter case, you could also just call resurrect() within the actor's script and save yourself all the hassle with casting a spell etc.

Link to comment
Share on other sites

Thanks for the info. I knew someone would say something about the lack of code :p I don't actually have any code, I just have what i gave, which is simply different functions I tried.

 

What was really strange was the fact that events were definitely triggering, because i would put stuff in like notifications to show when the event triggered, and at least in what order. From everything I could see, the cast() function simply wasn't firing. Part of the issue seems to revolve around the fact that the placeactoratme function creates a leveled version of the actor base, and not the actor itself. I never created a leveled actor, i just made my actor. i set stats, etc. by hand right on the actor settings. i don't know if that messes things up. anyway i'll keep playing with it. in the mean time i just ran with a cheaper, less exciting method, which is simply to have the actor pop into existence at the correct moment with the placeactoratme, and i had the aggression on the actor set for the highest, so that the actor immediately attacks the player. kinda lacklustre though because you hit an object and then this npc just "pops" in, which looks wierd, but i guess it gets the job done :/

Link to comment
Share on other sites

  • Recently Browsing   0 members

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