Actor scripts driving me nuts

Post » Thu Jun 21, 2012 3:31 pm

So I have tried again and again to have an actor disintigrate when it dies or fade out instead of "popping" out of existence, and I cannot get it to work. I have an actor, and I tried putting an ability that looks for OnDying and I have tried sticking a script directly on the actor. Nothing seems to work.

SetAlpha(0.0, true)
Utility.Wait(3.0)
DisableNoWait()
Delete()


Does not work.

DisableNoWait(True)
Utility.Wait(3.0)
Delete()

Does not work.

SetCriticalStage(CritStage_DisintigrateStart)
Utility.Wait(3.0)
SetAlpha(0.0)
SetCriticalStage(CritStage_DisintigrateEnd)

Does not work.



The actor just POPS out of existence and it looks really poor. Has anyone had success with this at all? It works just fine when such a script is attached to the reanimate archetype, but doesn't seem to work on actors created with placeatme().
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Thu Jun 21, 2012 8:41 am

excerpt from the ReanimateAshPile script:

bool function TurnToAsh()  trace("victim just died")  victim.SetCriticalStage(Victim.CritStage_DisintegrateStart);  victim.SetAlpha (0.99,False)  if MagicEffectShader != none   MagicEffectShader.play(Victim,ShaderDuration)  endif  if bSetAlphaToZeroEarly   victim.SetAlpha (0.0,True)  endif  utility.wait(fDelay)	  Victim.AttachAshPile(AshPileObject);  AshPileRef = AshPileObject;  AshPileRef.SetAngle(0.0,0.0,(Victim.GetAngleZ()))  utility.wait(fDelayEnd)  if MagicEffectShader != none   MagicEffectShader.stop(Victim)  endif  if bSetAlphaZero == True   victim.SetAlpha (0.0,True)  endif  victim.SetCriticalStage(Victim.CritStage_DisintegrateEnd)endFunction
looks like "SetCriticalStage" has some weird parameters. They use Victim.CritStage instead of just CritStage.
User avatar
josie treuberg
 
Posts: 3572
Joined: Wed Feb 07, 2007 7:56 am

Post » Thu Jun 21, 2012 10:40 am

That is the script I have tried to work off of, but it doesn't work. At the very least setalpha(0.0, true). Should be fading the actor out and its not doing squat, it is like my actors are impervious to shaders and fading.
User avatar
luke trodden
 
Posts: 3445
Joined: Sun Jun 24, 2007 12:48 am

Post » Thu Jun 21, 2012 3:38 pm

hmm and you're sure the script is running on them? is the script attached to the actor itself or a spell?
User avatar
Elena Alina
 
Posts: 3415
Joined: Sun Apr 01, 2007 7:24 am

Post » Thu Jun 21, 2012 3:09 pm

The actor itself, but I tried it as an ability too. I know its running because the script is supposed to do other things too and it is doing those things, such as removing the actor from the world, the actor just willnot fade.
User avatar
Chloe Botham
 
Posts: 3537
Joined: Wed Aug 30, 2006 12:11 am

Post » Thu Jun 21, 2012 7:37 pm

according to the wiki, http://www.creationkit.com/SetCriticalStage_-_Actor will automatically remove it from the world, so you shouldn't need to use disable/delete, just SetCriticalStage?

Maybe post the whole script sos we can have a look?
User avatar
Tammie Flint
 
Posts: 3336
Joined: Mon Aug 14, 2006 12:12 am

Post » Thu Jun 21, 2012 3:02 pm

Weird, I tried SetAlpha(0, 1) and it works properly on the player, but not on other NPCs. I suppose you can fake it like this:

Event OnEffectStart(Actor akTarget, Actor akCaster)    int index = 100    while (index > 0)        index -= 1        akTarget.SetAlpha(0.01 * index)    endwhileEndEvent

The numbers might be different depending on the computer though... Perhaps it would be better to use OnUpdate().
User avatar
kirsty joanne hines
 
Posts: 3361
Joined: Fri Aug 18, 2006 10:06 am

Post » Thu Jun 21, 2012 7:22 pm

I just found another annoying bug. Effectshaders and visualeffects do not work on the first actor to exist in the game. So say I create a new actor. I put a script on him either directly on his actor form that says OnInit() shader.play(self). Or, I make a magic effect with OnEffectStart() shader.play(caster)

In either scenario, if you use placeatme() to put the actor in the world, and there is currently no other actor in existence of the same type, the shaders will not play. If you place a second actor while the first is still loaded, it will play the shaders and visual effects. If you place a second actor but kill the first one yo u placed and delete it, then the second one will not play the shaders either. I am going to try putting actors in an empty cell somewhere to see if that fixes the problem. If not, I will try forcing them to be persistent by loading them up in a dummy unused property on some quest script.

feels like EVERYTHING that I try to do in this damn Creation Kit is some sort of gigantic shortcoming that forces me to come up with a new idea or create stupid workarounds. Maybe I just svck and modding and should give up.
User avatar
Loane
 
Posts: 3411
Joined: Wed Apr 04, 2007 6:35 am

Post » Thu Jun 21, 2012 8:33 am

feels like EVERYTHING that I try to do in this damn Creation Kit is some sort of gigantic shortcoming that forces me to come up with a new idea or create stupid workarounds. Maybe I just svck and modding and should give up.
I hear that. Really wish we had access to the developer's knowledge base and bug list so we knew exactly what is and isn't possible from within the CK. But hey! What we have is better than nothing. Despite issues I still enjoy making this game do new things. And the more I learn about how the internals work the more amazed I am at how stable the game is.

I am going to try putting actors in an empty cell somewhere to see if that fixes the problem. If not, I will try forcing them to be persistent by loading them up in a dummy unused property on some quest script.
Exactly what I was going to suggest. This is what's done for couriers and other "official" NPCs, iirc. Hope it works. I'd like to use a shader on some NPCs to make statues since I have zero ability in 3d software.
User avatar
Nomee
 
Posts: 3382
Joined: Thu May 24, 2007 5:18 pm

Post » Thu Jun 21, 2012 8:16 am

first idea was a no go. A utility.wait(0.5) did the trick though.

So, just do oninit() or oneffectstart() then put utility.wait(0.5) right before you start the shader.
User avatar
IM NOT EASY
 
Posts: 3419
Joined: Mon Aug 13, 2007 10:48 pm

Post » Thu Jun 21, 2012 1:24 pm

first idea was a no go. A utility.wait(0.5) did the trick though.

So, just do oninit() or oneffectstart() then put utility.wait(0.5) right before you start the shader.
LOL! Really? That's ... pretty interesting. I am getting tired of making dummy quests for stuff like this though. But whatever works. *shrug*

Thanks for following up.
User avatar
(G-yen)
 
Posts: 3385
Joined: Thu Oct 11, 2007 11:10 pm


Return to V - Skyrim