Possible to force an actor OUT of an idle or animation?

Post » Wed Jun 20, 2012 8:43 pm

I have an actor parked at Dead Man's Drink in Falkreath on a sandbox package that's valid to stage 40. If the player agrees to escort him to Helgen, the stage gets set to 50 making the sandbox invalid, but making a follow player package valid for that stage so my actor will follow the player to Helgen. Once they safely get to Helgen, another stage is set making the follow package invalid but also making another sandbox in Helgen Keep package valid. Everything works as intended with the exception of one minor thing:

If my actor is in the middle of an idle animation and the player initiates the dialog that sets the follow package to run, my actor doesn't drop what he is doing to follow the player immediately. He will always finish the animation he's running before he will actually equip his weapon and follow the player. For most of the idles like eating or whatever, that's not a huge deal as they finish pretty quickly, but if the idiot bard is singing and my actor is locked into the audience marker, he takes forever to get out of that idle and actually equip and follow the player. I have the following fragment entered for when that stage is set, but I think there's something I'm missing with the EvaluatePackage() command.

Alias_Marcus.GetActorRef().SetOutfit(MarcusSteelArmor)
Alias_Marcus.GetActorRef().EvaluatePackage()

So, what can I do to force him to drop whatever he's doing and immediately follow the player? Or am I stuck with him having to play out any animations/idles he is locked into when the player initiates the dialog? Like I say, it works as it is, but I know how impatient people are, and most will complain that my mod don't work if they have to wait for my actor to finish an animation. So it needs some polish.

Thanks!
User avatar
Kelsey Anna Farley
 
Posts: 3433
Joined: Fri Jun 30, 2006 10:33 pm

Post » Wed Jun 20, 2012 7:44 pm

you can try using alias-based packages instead of quest stage conditions.

ForceRefTo() and Clear() functions on the alias will both force the idles to stop immediately
User avatar
GLOW...
 
Posts: 3472
Joined: Thu Aug 03, 2006 10:40 am

Post » Wed Jun 20, 2012 11:13 pm

Thanks Amethyst, I'm reading the wiki, and picking Hadvar apart since trying to learn how to set this up. There's so much going on with him at the beginning of the game I figured looking at his setup might help me. It looks to me like Hadvar has a ton of packages in his alias reference that all have various conditions set like mine, although mine is much more simple, lol. In his Actor properties, he only has a couple of sandbox packages, so it looks like all but the most basic of his AI is handled by his alias packages. (I hope I am getting the terminology right, lol.) Also, picking through all the quest stages of MQ101 (Unbound) it looks like they call for him to evaluatepackage quite a bit, but I don't see it being cleared. But it seems that the EvaluatePackage does in fact correspond with the package conditions for his various packages.

So, putting all this together (crosses fingers) I need to simply remove the AI packages from my actors properties, but add them to his alias properties with the same conditions they currently have? I think I read somewhere that alias packages take precedence over all others or was that something in scenes. if this is so, when the alias package becomes valid, it should work, right?

You may have to explain a little more in depth on how to use the Clear() function as I'm a little fuzzy on that. man, I feel just like I did when I started trying to learn all this stuff for the GECK. I'm off to test this out, brb.

And thank you!
User avatar
JR Cash
 
Posts: 3441
Joined: Tue Oct 02, 2007 12:59 pm

Post » Wed Jun 20, 2012 10:06 am

forceRefTo is used to fill an alias that is set to optional, clear() is used to remove the actor from that alias (as well as any packages that are assigned to the alias)
User avatar
Sebrina Johnstone
 
Posts: 3456
Joined: Sat Jun 24, 2006 12:58 pm

Post » Wed Jun 20, 2012 3:27 pm

OK, sorry to be so ignorant, but I'm not understanding something. I did as I mentioned above about switching his packages around, and everything works fine. Actually it works exactly as before that he still waits for the idle in progress to finish before he follows you. I tried adding the following to the stage that makes his follow package valid:

Alias_Marcus.GetActorRef().Clear()

That wouldn't compile. I guess I need something inside the () after clear?

I looked up ForceRefTo on the wiki and it showed: Alias_JohnDoe.ForceRefTo(self)

So I tried Alias_Marcus.ForceRefTo(self) and that wouldn't complie either. So I'm definitely missing something. I'm not sure what or where I need to force my reference to, or exactly what I need to clear if that makes any sense.

edit: Trying to understand what you said:
forceRefTo is used to fill an alias that is set to optional, clear() is used to remove the actor from that alias (as well as any packages that are assigned to the alias)

My alias is not set to optional, do I need to do so? If I remove my actor from his alias, wont that screw things up later as that alias is used over and over throughout my quest? Would I need to make a new alias for him or something?
User avatar
SWagg KId
 
Posts: 3488
Joined: Sat Nov 17, 2007 8:26 am

Post » Wed Jun 20, 2012 10:34 pm

clear is an alias function, so you would not cal it on an actor (getactorref is not needed).

and yes you would need to create a new alias with optional ticked as well as specific reference set to none.

add the desired packages to that alias


then somewhere in your code you would use WhateverRefAlias.ForceRefTo(YourNPC)

which would force your NPC into filling the new alias, and will take on the new package stack.

when you are done with the packages and you want to remove them from the actor, you would use WhateverRefAlias.Clear() and he would go back to doing whatever he was doing previously before being forced into the new alias.
User avatar
michael danso
 
Posts: 3492
Joined: Wed Jun 13, 2007 9:21 am

Post » Wed Jun 20, 2012 9:29 am

Thanks, I believe I “get it” now, lol. I’ll try this out tonight when I get home from work.

I also appreciate your patience, as I know trying to teach someone something new can be as hard as the learner trying to learn something new. There’s a lot of stuff I’ve been able to figure out on my own either by studying stuff on the wiki, browsing other topics here or just picking stuff apart in the CK and anolyzing how the devs did certain things. So if it’s not in a tutorial or I can’t mimic something similar already set up somewhere, some of this stuff is hard to figure out on your own for beginners. Sometimes we don’t even know where to begin, and unfortunately, some of these function pages on the wiki don’t explain anything well enough for a beginner to comprehend.

Thanks again.
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Wed Jun 20, 2012 10:08 pm

The best wait to cut an idle animation is to make the actor play the idleStop_loose animation
(aRef.PlayIdle(IdleStop_Loose))

Then it stands to normal position.
User avatar
Stacy Hope
 
Posts: 3391
Joined: Thu Jun 22, 2006 6:23 am

Post » Wed Jun 20, 2012 11:20 pm

OK, thought I'd post an update that might help anyone else possibly in this situation. Amethyst, I tried your suggested method (after you cleared it up for me) and unfortunately, while it worked very well, it seems that once an actor is locked into that Bard Audience idle (which I found is controlled by a quest) they have to finish it before doing something else. The packages worked every time, they just worked like I originally had it set up. So I dug a little deeper, and found a faction I can add to my actor that excludes them from the bard audience quest, which is totally fine with me. So now my actor simply ignores the bard so all is well. Once again, I appreciate your and McGuffin's help because I definitely learned something new, and that's always a good thing! Hopefully what I learned about the faction I found can help someone else.
User avatar
YO MAma
 
Posts: 3321
Joined: Thu Dec 21, 2006 8:24 am


Return to V - Skyrim