How can you get around HS timing system?

project
#1

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

13 Likes
#2

What do you mean? Do you mean limiting it to a single object while it is being performed?

7 Likes
#3

I want to use a when = rule that happens no matter if it’s currently being performed

How do u do that?

5 Likes
#4

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
#5

Yessir

4 Likes
#6

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
#7

What is in the when area? Is it a when bumps, when tapped, etc?

6 Likes
#8

Let me get back to you

3 Likes
#9

When = is the rule i was referring to

3 Likes
#10

Okay.

Give me a minute, I’ll make a thing.

5 Likes
#11

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.

7 Likes
#12

@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.

6 Likes
#13

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
#14

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

2 Likes
#15

I see

Thanks! This is amazing!

#16

Hmm, I’ll try that

Clones might lag the game

1 Like
#17

Don’t need clones for that

1 Like
#18

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

1 Like
#19

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:

2 Likes
#20

When the condition is met, the whole rule is run

1 Like