Jump to content

Scripting Question


gasti89

Recommended Posts

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

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

@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

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

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 by gasti89
Link to comment
Share on other sites

Found this in QF_DialogueMarkarthIntroWorld_000AF75F:

 

 

  Reveal hidden contents

 

 

Also check out:

 

QF_MQ206_00036193

QF_DialogueMarkarthIntroWorld_000AF75F

SF_DialogueMarkarthWorldIntro_000AF760

SF_MS11CalixtoAttackLastVicti_0002B09B

 

EDIT: I just saw your edit :biggrin: Yes, looks like that's what Bethesda uses.

Edited by steve40
Link to comment
Share on other sites

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

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 by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

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