Page 1 of 1
[Solved] Dialogue -> Conversations // Doubt!
Posted: Tue Jul 10, 2018 10:31 am
by Japtor
Hi all,
Inside the Dialogue -> Conversations... Is there any possibility to, for example, active a game object from the scene when reached a certain part of the dialogue?
Thanks,
Javier.
Re: Dialogue -> Conversations // Doubt!
Posted: Tue Jul 10, 2018 10:57 am
by Tony Li
Hi Javier,
Yes, use the
SetActive() sequencer command in the
Sequence field.
For example:
- Dialogue Text: "Activating the force field."
- Sequence: {{default}}; SetActive(ForceField)
The "{{default}}" keyword tells the dialogue entry node to play the default sequence defined on the Dialogue Manager.
The SetActive(ForceField) command finds a GameObject named "ForceField" and activates it. This GameObject should have a parent GameObject that is active.
Re: Dialogue -> Conversations // Doubt!
Posted: Tue Jul 10, 2018 4:25 pm
by Japtor
Hi,
Thanks for the answer
And what about if, for example, the object that I would like to active has attached a script which has a public variable of type int. It is possible to set it via Dialogue -> Conversation?
Thanks,
Javier.
Re: Dialogue -> Conversations // Doubt!
Posted: Tue Jul 10, 2018 4:41 pm
by Tony Li
Yes. Here are three different ways. You can choose the one you prefer.
1. Add a method to set the int. The method must accept a string parameter. For example:
Code: Select all
public int myVariable;
public void SetInt(string value)
{
myVariable = System.Convert.ToInt32(value);
}
Then use the
SendMessage() sequencer command:
Code: Select all
{{default}};
SetActive(ForceField);
SendMessage(SetInt, 99, ForceField)
2. Or write a
custom sequencer command.
3. Or
register a Lua function and use it in the Script field (not the Sequence field like the above 2 options).
Re: Dialogue -> Conversations // Doubt!
Posted: Wed Jul 11, 2018 3:29 am
by Japtor
Hi,
Ok, I will try one of them. Thanks for answering!
Regards,
Javier.