Hi,
I'm currently working on a visual novel style game.
Sometimes I need to do custom actions, like change background, or do some others customs actions.
First I though that sequence could be perfect, with custom sequencer commands I could do whatever I like !
But as soon a I type a single letter in sequence field, the node is passed in a matter of milliseconds !
I later found that when I added something in this field, the default seqence was override, I now understand that it's not for customs action but for stylish purposes.
Then I tried the script field, but it's only for lua scripting. I could do something if the lua could call unity methods, but I really don't know lua and I didn't find anything interresting.
Finally I found the On Execute Event, but it's a special one, I can't call my function, I tried to make it static but no change.
At this point I'm a bit blocked, a bit of help could really boost my project
Thx for reading !
Call custom actions without breaking default sequence
Re: Call custom actions without breaking default sequence
Hi,
The node passes immediately because the sequence only lasts for as long as all of its commands last.
In the Sequence field, use {{default}} to include the Dialogue Manager's Default Sequence.
The Dialogue Manager's Default Sequence starts as:
The Delay command tells the Dialogue System to delay for a duration based on the text length.
If you set a dialogue entry node's Sequence field to this:
It is the same as this:
Let's say your player has a C# script with a method like this:
Then you can set up a Sequence like this:
The SendMessage command runs a method on any scripts on a GameObject. The method can accept no parameters or a string parameter.
Sequences are very useful. You can read more about how to write sequences here.
The node passes immediately because the sequence only lasts for as long as all of its commands last.
In the Sequence field, use {{default}} to include the Dialogue Manager's Default Sequence.
The Dialogue Manager's Default Sequence starts as:
Code: Select all
Delay({{end}})
If you set a dialogue entry node's Sequence field to this:
Code: Select all
Camera(Closeup);
{{default}}
Code: Select all
Camera(Closeup);
Delay({{end}})
Code: Select all
public void DropEverything() {
// Example. Your code here to make the player drop everything.
}
- Dialogue Text: "Here's everything I have."
- Sequence:
Code: Select all
SendMessage(DropEverything); {{default}}
Code: Select all
SendMessage(DropEverything);
Delay(5)
Sequences are very useful. You can read more about how to write sequences here.
Re: Call custom actions without breaking default sequence
Ok, thanks a lot
I just found out how to add my function on the On Conversation Line with the Dialogue System Event Script.
So I now have 2 solutions.
As always thanks for your support !
I just found out how to add my function on the On Conversation Line with the Dialogue System Event Script.
So I now have 2 solutions.
As always thanks for your support !