VikasSanstha's Recent Forum Activity

  • You do not have permission to view this post

  • Pinbak, I was able to get the file to work and I just wanted to say thank you. You really put time and effort into this. It's very helpful and I really appreciate it. I might ask for a bit more guidance if you don't mind. Thanks again.

  • You do not have permission to view this post

  • It's two letters (numbers) overlapping each other.

  • It seems the overlapping or 'colliding with' condition is not available for text boxes, which is odd since they have a definite edge (they can be bound to layout for example). This is a real bummer for trying to make educational content. Can anyone suggest a way around this? I cannot pin the text to a sprite, that's not an option in this case.

  • It makes sense that if you pass 0 to the function it would do something strange.

    LoopIndex gives you a number as the loop moves from the start index to the end index.

    So in this case, if the start index = 0 and the end index = 0 - 1, then the for loop will be executed two times. The first time loopIndex will be 0 and the second time loopindex will be -1.

    If you plug those number in the calculation it is doing to place the bars, you will see it places the first one with no offset, and the second one to the left of the first.

    The function should have a special case for 0, so that it doesn't even go in the for loop and just exits early after destroying all the existing instances.

    Thanks so much for the detailed explanation!

  • Thanks for the explanation!

    I changed the round random to include zero, and when it generates a zero it's looking like this,with an initial bar in the normal place and then one to the left.

  • Hi Diego, this is great. Thanks very much. I'm not totally sure I understand what's going on:

    1) "Amount" looks like a local variable (icon), but it's actually a function parameter that you added?

    2) It's looping the create action for "amount" times, and I see amount is set to the GV "theNumber", but why could the number of loops not be set directly to the GV? Is that not allowed? It seems to work ok if I do that.

    3) I assumed the -1 was because I have the GV "theNumber" starting at 1, but that doesn't seem to be the case. If I make theNumber start at 0 and remove the -1, then there is one more bar than there should be, so I'm not quite clear on this.

    Thanks again!

  • I started out to try to figure out the most elegant solution, and due to my limited expertise I'm still trying to come up with any solution. The setup is simple.

    1. Click a sprite and it generates a random number

    2. Then a matching number of objects is created.

    In my case I want to use it to visualize arithmetic problems for teaching. I.E. the random number 4 is generated, and 4 bars (sprites) are created along with it to show the quantity. I assume the best approach for the bars is to have the system check the number, then create one bar, then make instances and offset them. I'm not clear on how to make it all happen. I have spent a lot of time trying. I'm sure I can figure out the offsetting, it's the creation of a certain quantity that matches the random number that I'm stuck on.

    This c3p shows the basic setup for my specific case.

    dropbox.com/s/lmpf3rrlx5os3jy/generateObjectsToMatchNumberCount.c3p

    Ideally the solution would accomodate larger numbers, say up to 50 at least, in which case I know I would have to deal with how to have a certain number of bars in a row, before going to a new row. Also, it's not really for just a single number, but for addition and subtraction problems, but cross that bridge later. I'd like to gain a basic understanding first.

    Many thanks for any assistance.

  • I read this story over and over and I still don't understand it, you're describing too many things we can't see. What do you need help with?

    Hi lionz, sorry, the first part got answered successfully, and the bit that I said I still could use help with, I made a separate post and that was successful too.

    The basic question was how do I click on something repeatedly and have it do something different each time, which was resolved by using the click count and making the click count a condition.

    Thanks for responding.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Tokens start at index 0 (0,1,2,3,4) , and your first var is 1 (1,2,3,4,5), so all variables are being reduced by 1.

    Thanks for that, now I understand. I plugged this method into the actual full project, where my first var is actually 0, and it worked fine after I deleted the -1, so that makes sense now. Thanks for taking the time to respond.

  • Can I ask what the -1 after the variable is doing? I don't really understand the token either, but I can read about that I'm sure.

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