Petrichor, since you are among one of the most elite Hopscotchers in the world, I want to ask you a question:
How do you get around Hopscotch’s timing system where if a rule is being performed, you can’t perform it again until it’s finished
This is because i need to make a function for The Quick Flex where I need functions to be able to happen at any time
@CodeHelp @Awesome_E
16 Likes
What do you mean? Do you mean limiting it to a single object while it is being performed?
7 Likes
I want to use a when = rule that happens no matter if it’s currently being performed
How do u do that?
5 Likes
You’d need to somehow assign multiple objects (For example clones) to do the rule at different times.
@FearlessPhoenix this discussion would be best as a separate topic.
6 Likes
Lol sorry I was gonna rename it to “How to get around HS timing system?” or smth but I ran out of edits oop
5 Likes
What is in the when area? Is it a when bumps, when tapped, etc?
6 Likes
When = is the rule i was referring to
3 Likes
Okay.
Give me a minute, I’ll make a thing.
5 Likes
I think I may know of a better way than I did, so I’ll link that and explain it then go and test out my new way.
This is not the way to do it for when tapped, that’s just what I thought of for the example.
Basically, it has an object create clones and it has a counter which counts which clone should be doing this rule.
Because the counter starts at zero and clones at 1, clones do the rule when the condition is met and counter = clone index -1.
8 Likes
@UTheDevHS Start by reading this
Functions in Hopscotch - abilities with inputs and outputs
However, T1s function “function abilities” sometimes took numerous frames to execute. This example & explanation (maybe similar to what you were showing, @Petrichor?) used clones instead for a much faster calculation. However, this function method can only be called once per frame.
https://forum.gethopscotch.com/t/factorial-f-nction-and-combinations-f-nction/35533/7?u=thinbuffalo
7 Likes
A “better” way to make a function, now that we have custom rules, would probably be to make a custom rule with a bunch (however many you need) of rules that execute when a function variable does not equal 0 (or some “off” value). However each rule must have only 1 block.
That technique should allow you to put the “function” in the rule order, as often as needed, so it executed “in line” with the rest of your code
6 Likes
Oh check out my iOS passcode system, I’m not sure it will work in your scenario, but it might. Basically I have a while loop checking if the status idle and the animation will restart on a button press because the status has been updated. You could do while action == 0 continue, and set an action to 1, 2, 3 and assign different things
3 Likes
Hmm, I’ll try that
Clones might lag the game
1 Like
Don’t need clones for that
2 Likes
I was referring to Petrichor’s amazing example
But since 50 clones might lag the game when finished, i will use your method
If that works, then I will credit you in the credits button
2 Likes
Do you know if blocks that are in a repeat block will keep going no matter if the rule is not met in a when =
rule?
If so, would the rule need to apply for a function to happen if the block isn’t in the repeat block:
3 Likes
When the condition is met, the whole rule is run
3 Likes