How do I simplify this codewise?

Get help using Construct 2

Post » Sun Nov 06, 2016 10:38 am


I'm making some sort of dialogue / message system with triggers. It works like so.

I add a key to the dictionary.

On overlapping with a trigger and pressing a key - Spawn a bubble text, text and set text to Dictionary key. I set the size of both with tokenat.

Now, I made this work as intended. The problem comes when I want to expand this to multiple characters and triggers, because I will end up with 1 event per each trigger.

If I want the same "character" to have multiple dialogues I came up with the idea of just adding an instance variable to that character to use it on the event as a condition if variable = speech1, speech2, etc.

Is there a way I could make a few functions to simplify this? These are my current events.

Posts: 252
Reputation: 1,713

Post » Sun Nov 06, 2016 1:51 pm

Depending on what you want to achieve, here are some guides extracted from the How Do I FAQ:

Popup on overlap

Dialogue system

Dialogue system with XML
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
Posts: 528
Reputation: 7,091

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests