The most reasonable way to make a working telephone?

  • #1, by saintandsimonThursday, 17. October 2013, 23:29 7 years ago
    Sitting here, losing my hair steadily while trying to figure out the best way to make a telephone.

    Basically in my scene, there is a telephone. And I wanted to make it register each button in the order they are pressed:

    Like: 131213 or something. The numbers occur more than once as you see.

    Anyone has any ideas on how to make this work? Tried playing around with a lot of conditions but I couldn't get it to work. Seem that the logic is far beyond my small brain. smile

    Newbie

    85 Posts


  • #2, by SimonSThursday, 17. October 2013, 23:46 7 years ago
    No way around Lua.

    You need a value called "telephone".
    Make a definition script like that:
    function add_char(c)
    local text=getObject("Values[telephone]"):getStr(VValueString)
    getObject("Values[telephone]"):setValue(VValueString, text..c)
    end
    1
    2
    3
    4
    5


    If you press a button now, you can execute a script like that:
    add_char("0")
    1
    2


    You can show the value if you use the tags in your text <vs=telephone>

    Thread Captain

    1368 Posts

  • #3, by saintandsimonThursday, 17. October 2013, 23:48 7 years ago
    damn, I've never done Lua at all, or anything advanced with codes at all. Where do I start, adding this definition script into a specific object that gets called and checks?

    Newbie

    85 Posts

  • #4, by SimonSThursday, 17. October 2013, 23:54 7 years ago
    If you go to scripts on the left side, you add the script there. Definition scripts get called, when your app starts.

    Then you can add the script add_char("0") as an action part for left click or whatever.

    After that doing an call to that, you must update the text using the show text action part.

    Thread Captain

    1368 Posts

  • #5, by saintandsimonThursday, 17. October 2013, 23:58 7 years ago
    Thanks for your knowledge in these things. I'll try it tomorrow and cross my fingers something happens at least. smile

    Newbie

    85 Posts

  • #6, by denis-the-menphisFriday, 18. October 2013, 08:21 7 years ago
    Hi Slajmboll
    If you download my game in the shop All for a Cola you find my "Telephone" (in the toilet room of course) all made in visionaire (i hate LUA he he)
    It' work good (i think)

    Newbie

    73 Posts

  • #7, by saintandsimonFriday, 18. October 2013, 11:51 7 years ago
    Hello denismarani, is there an explanation how this work in particular? Downloading it right now, does it include a visionaire-file which I can look into in the editor?

    Newbie

    85 Posts

  • #8, by denis-the-menphisFriday, 18. October 2013, 15:27 7 years ago
    I have made a group of numbers at 0 to 9 (pictures of digits) for each position (my display have 7 positions) and set all the conditions in false
    I made another condition where every time you press the key in the keypad the value increase by 1 (val=val+1) for every number and set the conditions " if val(1)=1 then change conditions "number one visible" = true..if val(1)=2 then chande condition number two visible"= true do this for all the numbers (0-9)...
    for the position about digits in display i have created a "call action" -->(check position) ...every time you press the key increase of 1 the value ...then if check position is=1 show the digits (0-9) in first postion...if=2 show digits(0-9) in group 2 and so on for all your display digits positions...(remember... 7 in mine)
    complicated but it works !

    Newbie

    73 Posts

  • #9, by saintandsimonFriday, 18. October 2013, 16:47 7 years ago
    Thanks for the explanation. I've gotten some tips on how to solve it LuA-wise and will try that at first, and if not, I'll try your method. smile, since I'm basically after many desired working phonenumbers, LuA might be a more convenient way of making it work. But I have to make things work anyhow. ^^

    Newbie

    85 Posts

Write post