Jump to content

Question regarding dialogue in the CK.


Deathmaw

Recommended Posts

Posted

I'm currently in the process of making a follower mod. 

 

I am having an issue with idle lines I have 5 audio lines that are set to be randomly spoken they each have a 1 hour cool down. However they all seem to fire off one after another in the space of like 5 minutes then she is silent until the 1 in game hour is up.

 

I was wondering if it was possible to make it so they all share the same cool down? So like Every 30 in game minutes it picks one randomly from the pool and she says it. Rather than it picking each one randomly in like 5 minutes as they all have separate cool downs that refresh at almost the same time.

Posted

There may be an easier way, but in case there isn't, I can think of a method.

 

You can create a spell (just one with a dummy magic effect that lasts 30 minutes) and give each of the dialogue lines a script that has the NPC cast the spell on themselves. Then, add a dialogue condition on each dialogue line specifying that the Actor must not have that magic effect.

Posted

In each Dialogue Info (that would be the NPC's response/dialogue line), there are two boxes near the bottom where you can have up to two scripts fire, one when they start talking and one when they're done. I would put have a script fire when they begin; no sense waiting. Having the spell cast on the NPC is not difficult - it's one line of code.

 

But putting it in the box can be annoying. This is because, when you type something in the box, if you have a Property (which we need here), and you just type in your code, the CK will tell you that it can't find that Property. "But that's because you haven't given me an opportunity to define my Property!!!"

 

So, step by step:

1) Type ";". This semicolon indicates a comment. Literally, your script does nothing now, but at least it will compile. You'll notice that a new script name has appeared in the lower-right had corner. Ignore it for now; you can't really do anything useful with this yet.

2) Hit OK. Then open up that same dialogue line again. Sounds stupid, but you can't do the next part without doing this.

3) Double click on the script name that appeared before. You can now add a Property. You want to hit "Add Property", then create a new "SPELL" property which we'll name "MySpell" (choose a more descriptive name if you would like). Of course, set your new Property to refer to your spell.

4) Once you hit OK to exit that Property window, go back to the script with the semicolon, and replace it with "MySpell.Cast(akSpeaker, akSpeaker)". It does what it looks like: the dummy spell is cast from the speaker to the speaker (so basically on him/herself).

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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