Unconnected's Forum Posts

  • Thanks that was what I needed. I read of using '|' to do it, but I have never been able to format it right so I thought it was wrong.

    I wasn't putting x= in the first variable and I wasn't using a boolean in the second value. Thanks again

    x=0 | x=3 | x=8 | x=9 equals 1 works perfectly.

  • Just wanting to know how to compare X to many values at once with one condition. I don't mean 'Make or Block'. I would like a string of values and not a condition for each value. I need to compare X to quite a bit of values that require the same actions and I don't want a huge list of conditions. Also 'between values' won't work because not all of the values are consecutive.

    Compare X to 0,3,...8 or 9

    Instead of

    X=0 or X=3 or X=8...

    ***Solved***

    dropbox.com/s/1v415k8h85jp2wa/Tutorials.c3p

  • I will edit my post to be clear. The wait was to reduce how many times function Y was called while waiting for function X to finish.

  • Function X:

    Create 1000 objects

    Function Y:

    If object count is less than 1000. -Wait 1 second. -Call Function Y

    Else Destroy all objects

    By calling Function Y inside of Function Y it gives you a loop that you can easily control. You have to be careful though that you don't create an endless loop. You can check this by adding a global variable and each time Function Y runs it can add 1 to the variable. This allows you to check in debugger how many times Function Y runs. When you confirm Function Y is acting how it should then delete the global variable. dop2000's would be more efficient though, but I think it has to do with how the logic is set up. I never messed with asynchronous yet.

    ***edit***

    The wait in Function Y was just to reduce how many times Function Y is called while waiting for Function X to complete. It isn't needed unless you just want a very small performance increase.

  • You do not have permission to view this post

  • I understand, that is what I needed.

    If you start at 100 and loop to 3 then the space isn't counted when it is added.

    If you start at 3 and loop to 100 then the spaces are counted and then the loop doesn't get to run enough times.

    You were right, you did answer that already. I must have been missing something before because it passed right by me.

  • I understood that once I knew you couldn't update start/end index once the loop starts. I was asking why the total of loops ran isn't the same in 'len(s) to 3' and '3 to len(s)'. I thought both would run the same amount of times. How is one giving more than the other?

    I wish how things worked were in the manual in more detail, it would prevent a lot of posts. It would be great to know how it works, but I can just use a while.

  • I tested and you are right.

    Changing either value once the loop starts doesn't change how many times the loop runs. I thought the start/end index could be updated in loop. I know they can't now, I sadly still have the same question though.

    I am confused on why 'len(s) to 3' and '3 to len(s)' is different. '100 to 3' or '3 to 100' would both result in 97. I figured the only difference is counting up or counting down. Neither start/end index get updated once loop starts, so I don't see how many times the loop runs is different. I feel I bothered you to much on this topic though.

  • Okay, so what I am getting is the start index gets checked each loop and the the end index does not.

    So 'len(s) to 3' works because len(s) is the start Index.

    ***edit***

    This post is incorrect. Both the Start index and the End index are only read once. Changing their value after the loop starts doesn't change how many times the loop runs.

  • I thought that was it, but I wasn't fully understanding it.

    It seems len(s) to 3 is in a feedback loop.

    So why wouldn't 3 to len(s) be in a feedback loop?

    I figured you would want the self adjusting number to be last instead of first.

  • Sorry to bother you again.

    Can you explain why

    For "n" from len(s) to 3 works

    and

    For "n" from 3 to len(s) doesn't.

  • That is perfect. Thank you for going out of your way. I will save the images and update a c3p soon so it has both. I need to add this to a c3p tutorial anyway. I understand all of the steps and I just wasn't sure how to go about it. I will be sure to give you credit in a comment and post the c3p link to the original post.

  • I made a base converter. I was going to offer an easier way for the user to read this "11100011010111111010100100110001100111111111111111". I was thinking an option to put spaces in it.

    I can read and understand Line 1 and Line 2, but I would like to be sure. You are comparring len(TextInput.text) modulo 3 to Zero? Are you going off of the fact that the spaces will be set when the string is being entered?

    I was wanting to take "1110001" and convert it to "111 0001". I should have been clearer, but what you did is a great idea if I understood that correctly.

  • Yes, that solved it. I always feel silly when the solution is that simple. Do you happen to know how to add a space or a comma every 3 character spaces? A 50 character string can be hard to read.

  • I have a read-only TextInput object. I am trying to fit in a 50 character string, but I need all of it to be visible, I can only see about 24 characters. Is there any way I can see all 50 characters at once without changing font size? I figured if I adjusted the height size of the TextInput it may character wrap but it didn't. I also tried using a text object. I can't highlight it to copy/paste it though, like I can with a TextInput object.

    I am open to other suggestions, as long as the user can manually copy and paste the string.

    ********************

    Solution example is in this c3p.

    dropbox.com/s/1v415k8h85jp2wa/Tutorials.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads