gasti89 Posted May 30, 2012 Share Posted May 30, 2012 Hey there, since i always find this cumminity very helpful, i'm asking something again :) Here's my situation: - i have a PullChain scripted to call a SetStage() when activated - then i have a NPC running a UseMagic package with a GetStage() condition (stage just set) My problem is that the NPC takes from 4 to 10 seconds to start the package (depending on what?!) Is there a way to make him run it almost suddenly? I've found EvaluatePackage() on Ckwiki, will it do the work? Link to comment Share on other sites More sharing options...
steve40 Posted May 30, 2012 Share Posted May 30, 2012 My guess is that that would be the way to do it. Alternatively, if you simply want the npc to cast a spell immediately, you could just force him to Cast it in your script? Link to comment Share on other sites More sharing options...
dfac364 Posted May 30, 2012 Share Posted May 30, 2012 using a scene might help Link to comment Share on other sites More sharing options...
gasti89 Posted May 30, 2012 Author Share Posted May 30, 2012 @steve40: i've read that calling Cast() won't let the NPC play all the cast animations. It will just simply cast the spell. It says "if you want a complete spell casting, use the package instead". That's why i don't use the script, wich will make things easier ;) @dfac364: yes, i was thinking about that too. From what i've seen, scripted stuff is processed faster that the rest. So calling a Scene.Start() may definitely make the NPC suddenly start the package. Let's see ;) Link to comment Share on other sites More sharing options...
steve40 Posted May 30, 2012 Share Posted May 30, 2012 Ah, I didn't realize that. Btw, there is a setting in the CK under the Gameplay->Settings menu called "iEvaluatePackageTimer" with a value of 15. I presume that is 15 seconds, which would account for the delay that you're experiencing. This makes me think that the purpose of the EvaluatePackage() function is to cause immediate evaluation, as you suggested. Link to comment Share on other sites More sharing options...
kryptopyr Posted May 30, 2012 Share Posted May 30, 2012 I use EvaluatePackage() with my Better Stealth AI script and it seems to work very well. As far as I can tell, it causes the NPC package to change almost immediately. Link to comment Share on other sites More sharing options...
gasti89 Posted June 4, 2012 Author Share Posted June 4, 2012 (edited) Thanks to everyone, the EvaluatePackage() stuff worked flawlessly! I'll post another question here to avoid opening tons of topics. Now i need the player to perform a KillMove on a NPC after finishing a dialogue. The only thing i've found is SendAnimationEvent(), but it hasn't got a Target as parameter. Do you guys know something that would work? Also, do i have to call a DisablePlayerControls() while performing the animation? EDIT: I've found PlayIdleWithTarget(). I think this would be better? Edited June 4, 2012 by gasti89 Link to comment Share on other sites More sharing options...
steve40 Posted June 4, 2012 Share Posted June 4, 2012 (edited) Found this in QF_DialogueMarkarthIntroWorld_000AF75F: Reveal hidden contents ;BEGIN FRAGMENT Fragment_5 Function Fragment_5() ;BEGIN CODE ;Weylin has attempted to kill Margret ;if Alias_Weylin.GetActorRef().PlayIdleWithTarget(KillMove, Alias_Margret.GetActorRef()) ; ; Debug.Trace(self + "Weylin plays his backstab animation") ;else ; ; Debug.Trace(self + "Weylin's paired animation failed to play") ;endIf ;END CODE EndFunction ;END FRAGMENT Idle Property KillMove Auto Also check out: QF_MQ206_00036193QF_DialogueMarkarthIntroWorld_000AF75FSF_DialogueMarkarthWorldIntro_000AF760SF_MS11CalixtoAttackLastVicti_0002B09B EDIT: I just saw your edit :biggrin: Yes, looks like that's what Bethesda uses. Edited June 4, 2012 by steve40 Link to comment Share on other sites More sharing options...
gasti89 Posted June 4, 2012 Author Share Posted June 4, 2012 Hey Steve, thanks as always! Since that script is called on a NPC (so it will obviously do only that idle), do you think i should disable the player controls while playing the idle (since my script will be called on the player)? It came to my mind since, for example, when you play the WoodCut animation, if you press any movement control, the player stops the animation. I would test it myself, but i don't have the CK right now :P Link to comment Share on other sites More sharing options...
steve40 Posted June 4, 2012 Share Posted June 4, 2012 (edited) In one of the script examples in my last post, I think they ghosted the npc so that the animation would not be disrupted. So yeah, it wouldn't do any harm to disable the player controls. It would be pretty easy to test in-game whether it is necessary or not anyway. In my Jaws mod I disable the player controls when they run the Configurator script to disable/enable the Jawfish. I did that because I was concerned that the player might do something that might interrupt the script (it does a While loop that can take a minute or so to complete) :biggrin: I haven't had any complaints :thumbsup: Edited June 4, 2012 by steve40 Link to comment Share on other sites More sharing options...
Recommended Posts