Adventure RPG "confirm button" for advancing in dialogue

0 favourites
  • 5 posts
From the Asset Store
Template for a generic save / load system, fully documented in comments and video
  • I am a total newbie with construct and

    I'm trying to create a game where the player

    mostly just walks around collecting things,

    talking to NPCs and doing puzzles with key items.

    They should also be able to select and choose items to buy/equip/use.

    Now before anyone points me to existing tutorials,

    I already raided the entire forum and tutorials section,

    even youtube over the entire weekend,

    but I have not found a working solution for me yet

    and it's getting really frustrating.

    Either things are too basic to work for my game

    or too advanced for me to understand.

    I have ever only had experience with RPGMakerMV

    and I know next to nothing about programming languages

    so I want to ask for a visual scripting solution.

    Or something that involves as little coding as possible.

    So I want my player to be able to press a button, say spacebar,

    when they talk to an NPC to advance in the next part of the dialogue

    and also be able to use spacebar as a confirm button for menu selections etc,

    whenever they are not engaged in a conversation with an NPC.

    EXAMPLE:

    Player overlaps NPC > Spacebar > show text for dialogue1, line 1

    "Welcome to the shop!"

    Spacebar again > show text for dialogue1, line 2

    "What can I get you?"

    Spacebar again > show text for line 3, so on soforth

    Spacebar again > closes dialogue and reset this chain of actions so that next time the player overlaps this NPC and presses space bar again, this chain of actions can be re-initiated again.

    How can I event a keyboard key to trigger different actions ONE AFTER ANOTHER?

    I mean so that you press the trigger once, action 1 happens,

    and ONLY AFTER action 1 has happened and you press the trigger AGAIN would action 2 happen.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I’m still a novice with C3 but I would guess to add a short “wait” between presses, and instance variables.

    Give the npc an instance variable something like “chat” and set the value to 0. When you overlap the npc, press Space, add 1 to the instance variable. Then do a event that checks for the instance variable chat value 1 and if true, show dialogue.

    It’s late so I’m sure there’s some steps missing but give that a try, it should be a good starting point.

    Here’s mare about instance variables. construct.net/en/tutorials/beginners-guide-construct-1/using-instance-variables-6

  • I tried many similar things to what you described but wasn't able to make it work as the last line of dialogue just appears whenever trigger was pressed, overriding anything before it.

    However,

    I found my mistake was in the way I tried executing those instance variable triggered events as sub-events for literally the same key press event.

    The way it should work is to make an entirely different block of key press event.

    Conclusion: I have not gotten used to the way construct handles events yet.

    Thank you for repping!

  • Here is the working example for anyone else that's struggling,

    I tested it and it works smooth like butter.

    The solution was so simple smh

  • Glad you got it working! That’s what i was describing to you earlier. Isn’t C3 wonderful?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)