Hello,
Currently I'm using the Dialogue System with Corgi Engine.
What I want to do is My Player Character(PC) can use double jump after the conversation(event?).
--------------------------------------------------------------------------------------------------------
So this is How I tried for the function.
I made 2 game object.
1. My PC with components named Character Jump(Corgi Engine Script)
2. Event Trigger with component named Conversation Trigger(Dialogue System), Box collider 2D(for trigger).
First.
I set the variable named Number of Jumps in Character Jump script to 1 for single jump. (if the value is 2, PC can use double jump)
After that, I made a conversation work when my PC pass the Event trigger.
-----------------------------------------------------------------------------------------------------
Here's the problem
I tried the Sendmessage sequence and Dialogue System Events function but, it doesn't work.
(I just read document to make it, but probably I don't understand how to use it and I wonder is it right way to make what I want.)
Is there's a way solve the problem?
How can I change the value with sequence?
How can I change the value with sequence?
- Attachments
-
- 2.png (156.94 KiB) Viewed 701 times
Re: How can I change the value with sequence?
Hi,
Here's an example scene: CorgiSetJumpsExample_2017-09-23.unitypackage
I wrote a small sequencer command. (I'll also post the code below.) To use it, I added a dialogue entry to Dude 1's conversation that uses this sequence:
Here's an example scene: CorgiSetJumpsExample_2017-09-23.unitypackage
I wrote a small sequencer command. (I'll also post the code below.) To use it, I added a dialogue entry to Dude 1's conversation that uses this sequence:
- Dialogue Text: "Abracadabra! Now you can double jump!"
- Sequence: SetJumps(2); Delay({{end}})
Code: Select all
using UnityEngine;
using System.Collections;
using PixelCrushers.DialogueSystem;
using MoreMountains.CorgiEngine;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandSetJumps : SequencerCommand
{
public void Start()
{
var maxJumps = GetParameterAsInt(0);
Debug.Log("Setting player max jumps to " + maxJumps);
foreach (var player in FindObjectOfType<MoreMountains.CorgiEngine.LevelManager>().Players)
{
player.GetComponent<CharacterJump>().NumberOfJumps = maxJumps;
}
Stop();
}
}
}
Re: How can I change the value with sequence?
Sorry for late reply.
It worked well!
Thanks for the help!
It worked well!
Thanks for the help!
Re: How can I change the value with sequence?
Happy to help!