Random NPC comment
Random NPC comment
Hi, is it possible to have an NPC make a random comment (from a list) or ask a random question (from a list)? Thanks.
Re: Random NPC comment
Hi!
In the current version, there are a few ways. They're described in this post.
The quickest way to do a random comment is the RandomElement() Lua function, such as:
In the current version, there are a few ways. They're described in this post.
The quickest way to do a random comment is the RandomElement() Lua function, such as:
- Dialogue Text: [lua( RandomElement("Nice weather.|How about them sports?|Howdy.|Move it, buddy.") )]
Re: Random NPC comment
That's cool. Will it be easy to implement though? Being new to this asset I'm wondering what having a new sequencer command means. Can I just click on a checkbox to make it work or is it node based?
Re: Random NPC comment
Looking forward to seeing the new improvements you added!!
Re: Random NPC comment
You'll just need to click the "+" next to the Sequence field, and select Randomize Next Entry from the menu.
Re: Random NPC comment
Great, I'm hoping the 'Trial' will have this feature so I can try to get things working before I buy.
Re: Random NPC comment
Absolutely. The evaluation version has all the features of the paid version. The only differences are that it doesn't come with source code, and there's a little watermark during play.
-
- Posts: 5
- Joined: Mon Feb 21, 2022 3:28 am
Re: Random NPC comment
Tony Li wrote: ↑Tue Oct 23, 2018 10:50 amYou'll just need to click the "+" next to the Sequence field, and select Randomize Next Entry from the menu.
Hi Tony,
I've been trying to use RandomizeNextEntry() but I'm having behavior that is not ideal. I would assume that this should pick the random entry from the linked entries, but instead it is picking an entry from ANYWHERE in the conversation.
In my example, I have used RandomizeNextEntry() on the <START> entry. There are only two entries that are linked from the start entry, and I want one of those linked entries to be randomly selected. However, ANY of the entries in the entire conversation are chosen, so it might go immediately from <START> to one of the END entries which aren't even linked to that start entry.
Is there any way to limit the randomized selection to only select from the entries with a link from the original entry that has RandomizeNextEntry() applied?
Thanks in advance!
Ben
Re: Random NPC comment
Hi Ben,
That shouldn't be happening. When you use RandomizeNextEntry(), it make a list of the valid links from the current entry. Then it randomly chooses one of those.
Would it be possible for you to send a reproduction project to tony (at) pixelcrushers.com?
That shouldn't be happening. When you use RandomizeNextEntry(), it make a list of the valid links from the current entry. Then it randomly chooses one of those.
Would it be possible for you to send a reproduction project to tony (at) pixelcrushers.com?