VertexZero's Recent Forum Activity

  • My bad, sorry about that. It should be ok now.

    And I need to format a phone number to (555)-555-5555

    We use the phone number of an user as userID to connect with a mobile app (chatbot).

  • Hey guys,

    I've been fiddling with trying to understand Regex and so far I managed to format a part of a phone number.

    But problems arise when I try to format the last block of the number.

    Any ideas?

    Thanks!

    Below a small .c3p file of what I have so far

    https://drive.google.com/file/d/1-Hvn2LAgtfOoMqcOhjp7jCv5ucHinRF8/view?usp=sharing

  • Actually I found a solution to that:

    RegexReplace(TextInput.Text, "[^0123456789-]", "g", "")

    So I match any character not included in [].

    The problem now is that users can type the "-" symbol as well.

    So I need to figure out how to allow users to type only numbers, and the system format the phone number.

    e.g. (555)555-55555

  • dop2000 For some reason, that didn't work.

    Finally I opted for:

    RegexReplace(TextInput.Text, "\D", "", "")

    But when I try to format the phone number as xxx-xxxx, the symbol "-" is deleted since On Text changed I'm using RegexReplace.

  • Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi guys,

    I did a search but I couldn't figure out how to do this.

    I need to be able to enter only numerical values into a text input field (phone number)

    So whenever an invalid character its added (letters or symbols) I need the system to throw a warning.

    Thanks in advance for any ideas.

  • Actually I found the solution. Instead of AJAX on "Value" completed, I set everything to every tick.

  • Hi guys,

    If this question was already asked, my apologies.

    Currently at the company I work, we have connected Construct 3 to our in-house RCS chatbot.

    Now, the link between both it's working well, but I have a small issue:

    Our script updates data sent by the chatbot into our servers and then to Construct 3.

    In c3, we update the data received every tick for now for testing purposes.

    The debug text correctly displays the changes of data, but the basic inventory system I build it's not loading the item into one of the slots. Previously I had tested the Inventory system separately, so I know that works.

    I'm leaning towards the idea that somewhere I'm not parsing or converting the data properly.

    Thanks in advance!

  • Thanks!

  • Hi,

    my current js code is as it follows:

    chatbotJsonObject = JSON.parse(chatbotData);
    m_Int = parseInt(chatbotJsonObject.m_Int);
    

    I'm trying to parse data similar to the events below, which work fine.

    Any pointers of what I'm doing wrong would be really helpful, thanks!

  • Ah great, I'll check that out, thanks!

  • Hey guys, currently we are working in connecting our server to an app built in C3.

    So when I retrieve values sent by a chatbot, I obtain a value in the form of:

    {"m_Int":"1"}

    How can I type cast this string into a numerical value in C3?

    Thanks!

VertexZero's avatar

VertexZero

Member since 13 May, 2013

Twitter
VertexZero has 1 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies