Hopscript: Hopscotch Text Language (Concept)

Because it’s missing, I’ll do it for you

phew

phew

PHEW

Weeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee all hail -1

2 Likes

[nostalgia]

alright tri, you heard the man. this is how you do it

3 Likes

now time to

import python

anyways, how do you do it? Do you code it using ae’s hs tools?

or somehow just make a script and convert

3 Likes

I wrote some somewhat javascript code that parses the code (I use peggy to parse it from text) and creates a hopscotch project from it.

4 Likes

Hands down best custom block idk why they removed it

4 Likes

^^ must agree with that

4 Likes

secretly add it to the web explorer

4 Likes

Actually not a bad idea if I weren’t still trying to recover from 80 hours of doing stuff last week

4 Likes

You can see the actual code here: GitHub - petrichor-1/petrichorian-hopscript: hopscript concept but it’s not the most readable, just something i could get working quickly

7 Likes

I can set breakpoints and continue from them, though not really anything else yet

7 Likes

I can step through blocks now, but breakpoints don’t seem to work in the first frame

4 Likes

This is great so far!! I’m super curious, how do you handle framerules internally?

2 Likes

I don’t use the actual functions provided by the player, instead i copied out the important bits and put them in my own function which goes through each frame on a much smaller level. Basically it keeps track of how far through the frame it is (just starting? time to render? the 23rd block in the 5th rule?) and so I can just stop calling that function whenever to pause the project at a certain point. So normally, I run that in a loop until the frame has rendered, then I requestAnimationFrame to start it again next time.

So far it hasn’t noticeably impacted performance but I’ve only really used really small projects with it, and also I don’t know how changing the scene would impact it.
Width andheight also seems weird, with the orange traits returning the wrong value and I’m not quite sure why yet.
That’s how in my videos I was able to go through the pipes without dying.

2 Likes

Very interesting! So with that being said, are you writing an entirely new internal engine for .htn, or is it just the debugger that’s custom?

2 Likes

Just the debugger bit, it’s basically at this point just some extra code at the top of the webplayer and a change so that instead of calling its own animationTick method it calls mine

It compiles the htn to a hopscotch project with information about which line each block came from then the debugger mod understands that

1 Like

Oh awesome! :D

I obviously don’t know, so this is just a guess; assuming Game.height is your bugged height, maybe it’s grabbing from the wrong class or something? Does it change properly if you edit the JSON?

1 Like

No, it’s Self.height, Game.height is used to set the position of the objects at the top of the screen and those are correct.

It looks like all the object variables/traits are slightly messed up. After adding local variables and arguments to custom rules a whole lot changed and so what I suspect is that I’m somehow getting the width/height of a different object instead of the correct one.

Oh good call, I totally forgot to even check that, the json could be slightly incorrect, since I don’t include everything that the actual editor does. Although if it is the player has changed a lot since I last looked at that part of it.

I suspect that it’s probably this not being correct somewhere, or I am passing the wrong thing in the wrong place (since they added parameters to custom rules it passes around groups of rules instead of objects, so maybe that’s where the problem is?)

1 Like

Well here’s my second guess then: JS is a prototypal language, so maybe the reference to this.height is being grabbed from somewhere from up the chain (ie. the parent/superclass)? Or maybe the reference to this was written in the wrong place like you said. ¯\_(ツ)_/¯

Then again, maybe something’s missing from your JSON, but again idk.

1 Like

Interestingly, looking into it now, it’s getting the correct object and even the correct width it’s just not responding correctly. Now I suspect it might be something to do with the wait? But then why does it work if I get really close to the center lol

It’s not the json, when I let the editor do its thing (afaik mostly just duplicating traits to a place the player doesnt use) and used that it had the same issue, so it’s my player mod that’s doing it.

1 Like

I still can’t be sure, but for me this is a red flag that maybe your canvas’s (or your object’s) origin point isn’t where it’s supposed to be? But then again, your objects are generally being placed correctly on screen…

Another very vague guess, but if the data is right, then maybe that’s not the part that’s being mishandled; rather, it could possibly be how it’s manipulating the objects after the fact?