VikasSanstha's Recent Forum Activity

  • The compact way is this:

    > TextBox set text to (self.var=1 ? "3" : self.var=2 ? "4.5" : self.var=3 ? "9" : self.var=4 ? "21" : "85")
    

    Another method:

    > TextBox set text to tokenat(".001,750,6,1000,.23", self.var-1, ",")
    

    This works great. Thanks so much. Very helpful! Token seems even more compact.

  • Thanks for your reply.

    No, there is only one original text box, then four instances. All five have an instance variable, from 1 to 5 (see c3p). I am using a click on a sprite to replace the values of all five at once. I click on the sprite and whatever I have typed in the event appears in the boxes, in order that they are listed. It could be anything:

    10, 20, 30, 40, 50

    3, 4.5, 9999, 21, 85

    .001, 750, 6, 1000, .23

    It currently works fine with 'choose', e.g.

    - Set text to choose (.001, 750, 6, 1000, .23)

    All five boxes get replaced with some number from the list, but I don't want choose, and I don't want random. I want all of them to fill the boxes, in the order that I list them.

  • Hello friends, please see the very simple attached example. I want the five text boxes to be replaced with 10,20,30,40,50 - in the order I typed them in the event sheet. I know I shouldn't be using choose, but I don't understand what to do.

    There is one text box, then four instances. All five have an instance variable, from 1 to 5.

    Many thanks for any assistance.

    dropbox.com/s/cssb1o2ib2nuh2y/test.c3p

  • I learned so much doing this. Very happy!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks very much to both of you. I got it working they way you see here. A bit of a hybrid, but it's using the click count, so that's a great new tool for me to have learned.

    Since the fundamental change I want to make is so simple (replacing some numbers), I shifted away from using a function for that.

    I'm making a simple arithmetic engine for my students, for visualization. They choose a first number (from a row with ten number choices), an operator and a second number, and it produces the result. This behavior, clicking an icon over and over again, is to allow them to change the sets of ten number choices for the first and second numbers in the equation. They repeatedly click a button and it presents them with new sets of ten numbers to use in the engine.

  • Hello friends,

    I have a sprite object, and each time I click on it I want it to call a function, or more specifically to cycle through a series of functions that all have the same name, with an increasing number on the end. I'm using C3 full version with built-in functions.

    SCENARIO

    1. I have a series of functions - funct_01, funct_02, etc., up to funct_10

    2. There is a sprite which is the trigger object. The first time I click on it, it calls funct_01.

    3. I would like each successive click to call the next function - funct_02, then funct__03, etc.

    4. After funct_10 it would loop back to funct_01 and continue the cycle.

    I know this is a specific case, but I am also interested to learn about this behavior in general. Say I wanted to click a text object over and over, and have it do totally different things each time (say, first click spawned an object, next click changed the font color, next click destroyed the text). I don't understand the basic concept.

    Many thanks for any assistance.

  • The user chooses numbers and operators, and the answer can be spoken. Everything works, but I can't understand how to account for negative answers. Basically when answer.text is less than zero, it should speak "Negative" before the answer, but otherwise follow the rule you see here, which is working fine. Many thanks for any help.

  • You do not have permission to view this post

  • TextUID is indeed a local variable.

    Use the system action: "Set global/local variable value".

    Thanks, I got it working, I was confusing local and instance variables.

  • Two answers, two different methods :

    Making use of the Pick All system condition:

    Making use of the Functions feature:

    Same result in the end.

    Thank you, this is working. I don't understand how to do the second example, but I got the first one working.

    Hello friends, here is a simple c3p file

    dropbox.com/s/jxrfoz2qg89ow73/Outline%20only%20one.c3p

    There is a text box, and an instance of it. I am using the BetterOutline effect, and I want to be able to click on either piece of text, and have only the one I just clicked on show the outline. As it is they both stay outlined.

    Many thanks for any assistance.

    Tagged:

  • Hello friends, here is a simple c3p file

    dropbox.com/s/jxrfoz2qg89ow73/Outline%20only%20one.c3p

    There is a text box, and an instance of it. I am using the BetterOutline effect, and I want to be able to click on either piece of text, and have only the one I just clicked on show the outline. As it is they both stay outlined.

    Many thanks for any assistance.

VikasSanstha's avatar

VikasSanstha

Member since 24 Jul, 2021

None one is following VikasSanstha yet!

Trophy Case

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

Progress

6/44
How to earn trophies