License from €75
DE EN FR ES IT CZ

Key Input (technical demo)

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 13 years ago
    Please read the readme.txt file included in the root folder of the .ved file before opening the key_input_demo.ved file.

    If you lack patience &/or hate repetition then I recommend not attempting to create any key input based puzzles for your game as this thing took me almost 2 days (approx) to finish & debug. I could have made it simpler, sure... but I wanted to create an example of what can be done with a bit of creative thinking & scripting.

    Regards,
    Lee.

    P.S: This is for advanced users of Visionaire Studio; or crazy people, who like to jump ass backwards into the deep end first...
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Forum readers get the Indie Bundle 15 % off with the code FORUM15: €84.15 instead of €99, valid until 31 Dec 2026.

    Get 15 % off Try it for free
  3. · 13 years ago
    That's really impressive. A lot of work to program all the buttons and scripting the crap out off it!!! Master Lee has done it again. smile Thanks!!!

  4. · 13 years ago
    Cheers smile

    Was a mixture of loads of all the mentioned things. The lua part was relatively small & simple though. Few lines for each function.

    1. add() -- added character to end of variable which then updates a vs value.
    2. remove() -- removes last character from vs value
    3. updateStr() -- updates vs value with current result string
    4. clear() -- reset both vs values back to nil
    5. checkAnswer() -- compared current string value of str_txt to answer of current active table index.a & return true/false actions.

    All in all it was very boring to create.

    Hopefully the devs will sort out true key input at some point so that all we have to do is enable a condition to switch between regular key input actions & true key input. Not sure how it would work at the minute though. In theory I believe we would have to focus on some kind of input box which is linked to a value to input text to it which would be displayed with object text. I'm not sure how else it could be done.

  5. · 13 years ago
    Well done mate! smile
  6. · 11 years ago
    Very great example! Possible to input a text (to a string variable) without defining every character key in the key actions section? I need a thing like: "Input your name: _"
  7. · 11 years ago
    I made this before the Lua key input event handler / listener was implemented into Visionaire Studio. I believe it would be a lot faster & easier to create with the key event handler as it can simply return whatever key was pressed & you can also listen out for special keys too.
  8. · 11 years ago
    Can I find an example with the Lua key input event handler?
  9. · 11 years ago
    http://wiki.visionaire-tracker.net/wiki/RegisterEventHandler - example 3 at the bottom of the page. It's a bit of a complicated example as it covers various different types of key input. The only thing you really need to do is check if it's a character & return that. If it's space bar then you insert a " " empty character & if it's delete / backspace then I guess you would remove the last character stored inside of a variable or values string field. You could probably sort it all out in 10 to 20 lines or so - I can't really say how many off the top of my head.

    * edit: just thought about a method of making it more global. You would create a variable that you set as nil to begin with. This would be added as an if query inside of the key event function to check when key event handler should function. To use the handler you would update the variable to the name of a VS value you want to add a string to & then whenever characters are released it would add that character to the end of the values current string. When you submit it with a button or enter you would reset the variable back to nil to kill the key event handler.

    Sorry if it's not that clear. Just theorizing off the top of my head (again).

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?