Page 1 of 1
RandomizeNextEntry that never plays the same entry twice in a row
Posted: Tue Mar 26, 2024 5:59 am
by lgarczyn
RandomizeNextEntry is extremely useful, and I've made quite a large usage of it, however it causes a lot of accidental repetitions.
In FMOD, the default randomization behavior is to avoid repetition.
There isn't even a great need for complexity, just avoid playing the last entry that was randomly selected. Because the problem is mostly noticeable when a conversation is played twice in a row, this would solve 90% of the issue.
Re: RandomizeNextEntry that never plays the same entry twice in a row
Posted: Tue Mar 26, 2024 9:07 am
by Tony Li
Hi,
I'll look into writing a separate function/script for that. It will require each instance of RandomizeNextEntry() to remember the most recently-chosen entry so it doesn't repeat it next time.
Re: RandomizeNextEntry that never plays the same entry twice in a row
Posted: Tue Apr 16, 2024 12:08 pm
by lgarczyn
That would be the most extreme case, but realistically, we just want to avoid the last entry to replay.
Simply storing the previous result globally is enough
The problem is that RandomizeNextEntry is *not* a normal sequence instruction.
It's handled by the Sequencer itself, setting a static flag on the conversation controller, which is consumed when the subtitles finish.
I don't think it can be implemented as a custom sequencer instruction, but only by modifying the ConversationController itself.
Re: RandomizeNextEntry that never plays the same entry twice in a row
Posted: Tue Apr 16, 2024 12:31 pm
by Tony Li
You could technically do it with variables and conditions (e.g., using the built-in 'thisID' Lua variable) but it'll be cleaner for me to add a Lua function like RandomizeNextEntry() that doesn't repeat.