Forum rules - please read before posting.

Check Inputs

Hi, I'm trying to create a game feature, such that when a value is input, it is checked against a pre-set value. If it matches the pre-set value, then a certain dialogue ("Correct") is played and otherwise, another a dialogue is played ("Wrong"). I have followed this tutorial, and have managed to make the input menu come up when i click on a hotspot. In my action list, after turning on the hotspot, it is supposed to run a variable checker to see if the global variable entered value is equal to 3. However, before I can enter the values into the input part of menu, the action list runs, and I am returned "Wrong". Also, after I input the value I want, I don't get an updated response of "Correct" or "Wrong". Anyone knows how I can fix this? Thanks a lot!
https://ibb.co/Pm3cQsL

Comments

  • Welcome to the community, @yssg.

    The logic that processes the input variable is being run prematurely - as soon as your "Rank" menu is turned on. You need to delay it until after the user has entered something into the Input box, and been set to a Variable value.

    This could either be from a "Submit" button's ActionList within the menu itself, or you could try having the Hotspot interaction wait until the Menu is closed before continuing:

    You'll also need to have your "Rank" variable be set to the Input box's entered value, using the Variable: Set Action. See the tutorial's use of this above halfway down.

  • Hi Chris! Thanks a lot for responding. I've managed to solve the problem of the "yes" and "no" appearing prematurely by placing the check state loop in my button action list.

    However, despite using the variable set option, it seems like the variable value is not being updated. I tried using the playername code (so I followed exactly as per the tutorial). At the start of the game, the hotspot will say hey there player! but once i change my name, it becomes hey, there!, as though the entire variable has just become blank. Are there any ways to solve this? Thank you!

  • edited February 19

    Make sure that the variable is being updated after the input's been entered by the player, and that the names of menu/input box referenced by "Variable: Set" are correct (its case-sensitive).

    If you can share images showing the variable, the Action that updates it from the Input element, and how that ActionList is called, I'll see if I can spot the issue.

  • Hi Chris, I've checked and the name seems correct. I've included the screenshot links below here. Thanks a lot :)

    Variable: https://ibb.co/2kfbVJq
    ActionList that updates from input: https://ibb.co/X2KJwsJ
    ActionList called: https://ibb.co/L5c3wrD
    Hotspot Use Interaction that opens the menu: https://ibb.co/26ry77L

  • Thanks for the details. What's your AC version?

    Are you running the game in the default language, or have you added any translations?

    The Variables Manager lists each variable's current value at runtime - what's the variable's value displayed as here when the OK button is clicked, and is there a difference if Values can be translated? is unchecked.

  • Hi Chris! I'm using version 1.79.3.

    Nope, I'm not using any translations, my whole game is in English.

    When I click the OK button, the variable becomes an empty string, and there is also no difference when I uncheck the values can be translated box.

  • OK, thanks.

    I can't reproduce the issue on my end, so I'll need to examine the exact files you're using.

    Could you PM me your game's Managers, along with the "Store Player Name" ActionList asset file? I'll take a look directly.

  • Hey Chris, thanks for helping me to solve the issue. For anyone else who might have the same difficulty, it turns out I had a trailing space.

    I refer to the screenshot you attached on 18 Feb in this discussion thread. I tried using the engine wait by -1, but as a result, I can't press the "OK" button, and it seems like my action list is just permanently stuck at the delay scene. Is there something I'm missing? In addition, if I already use Set Value in the action list for my button, must I have another value for set value in the hotspot?
    Hotspot Action List: https://ibb.co/6rynT66
    Menu Button Action List: https://ibb.co/Bnt5VDR

  • If your ActionList blocks gameplay, then it will do so indefinitely if it runs on a loop.

    In its properties box, set its When running field to Run In Background to prevent this.

    In addition, if I already use Set Value in the action list for my button, must I have another value for set value in the hotspot?

    As in, a Variable: Set Action? No - as the Variable is global, setting it from the Menu will affect its usage in the scene.

  • Oh i see, okay thanks Chris!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.