Discuss Scratch

LG125
Scratcher
500+ posts

Hotbar item decoding no work?

https://scratch.mit.edu/projects/604058830/editor

The problem is in the hotbar sprite. You’ll find a lot of useless code there because its from one of my games, and this project is a test for the game.

Edit: enter 2 when it asks you “1 or 2?” for decoding (where the problem is at). 1 is encoding, and it works fine. You can find the problem at the comment attached to a script in the hotbar sprite.

Last edited by LG125 (Nov. 29, 2021 18:14:54)




bSpyder
Scratcher
100+ posts

Hotbar item decoding no work?

Have you shared it? I can't access the link

idk what im doing
LG125
Scratcher
500+ posts

Hotbar item decoding no work?

bSpyder wrote:

Have you shared it? I can't access the link
Oh yeah, i forgot to tell you.

Put it through turbowarp.



LG125
Scratcher
500+ posts

Hotbar item decoding no work?

Is it too early for me to bump?

Actually i dont think it is.



bSpyder
Scratcher
100+ posts

Hotbar item decoding no work?

Anyways I looked into the code, and it seems that some variables arent resetting when you click green flag. Make sure you set them at 0? Maybe that's the problem

Last edited by bSpyder (Nov. 24, 2021 17:48:11)


idk what im doing
LG125
Scratcher
500+ posts

Hotbar item decoding no work?

bSpyder wrote:

Anyways I looked into the code, and it seems that some variables arent resetting when you click green flag. Make sure you set them at 0? Maybe that's the problem
All the necessary variables are being reset, whether its at the beginning or at the part of the script where its necessary. Some are blank because the code wont work properly any other way

Edit: I updated the thread. Looks at it so you know what to do now.

Last edited by LG125 (Nov. 29, 2021 19:04:50)




LG125
Scratcher
500+ posts

Hotbar item decoding no work?

I think I can bump this again.



gatgatcode
Scratcher
100+ posts

Hotbar item decoding no work?

switch costume to (held item)? ::looks

Profile!
My browser: MS-Edge
My os: Windows 11
bSpyder
Scratcher
100+ posts

Hotbar item decoding no work?

I really don't know how. I suspect it has something to do with clones though.

idk what im doing
bSpyder
Scratcher
100+ posts

Hotbar item decoding no work?

I figured it out I think…
It's to do with the variable “CloneID”

I logged everything and it seems that only clone id “5” is running, however in the code letter 5 of “Item2” is 0- which doesn't do anything.

idk what im doing
LG125
Scratcher
500+ posts

Hotbar item decoding no work?

gatgatcode wrote:

switch costume to (held item)? ::looks
But how to determine the held item?

I already accomplished this, the problem is not the costume switching, the actual list doesnt change.

bSpyder wrote:

I figured it out I think…
It's to do with the variable “CloneID”

I logged everything and it seems that only clone id “5” is running, however in the code letter 5 of “Item2” is 0- which doesn't do anything.

0 isn’t supposed to do anything. It represents an empty slot, and all slots are empty before the item 2 decoding starts.



bSpyder
Scratcher
100+ posts

Hotbar item decoding no work?

Hmm I logged some more stuff…

And the item id check is never equal to the clone id.
Therefore it never gets updated.

I think.

idk what im doing
LG125
Scratcher
500+ posts

Hotbar item decoding no work?

bSpyder wrote:

Hmm I logged some more stuff…

And the item id check is never equal to the clone id.
Therefore it never gets updated.

I think.
But i set it to 0 and changed it in the repeat loop?



LG125
Scratcher
500+ posts

Hotbar item decoding no work?

When the bump



bSpyder
Scratcher
100+ posts

Hotbar item decoding no work?

I literally don't know welp.

idk what im doing
deck26
Scratcher
1000+ posts

Hotbar item decoding no work?

Why not create a copy of the project with as much as possible removed and share it on Scratch. It's much easier for those helping to look at something on Scratch and remix. Tidying up scripts on Scratch, for example, gives an arrangement of scripts that is easier to me to quickly scroll through looking for things rather than the Turbowarp arrangement where I have to scroll horizontally and vertically.

Make sure all variables are of the right type. CloneIDs need to be local but if you're using those to access a list that list needs to be global - you don't want each clone to be updating its own copy of a list.
LG125
Scratcher
500+ posts

Hotbar item decoding no work?

deck26 wrote:

Why not create a copy of the project with as much as possible removed and share it on Scratch. It's much easier for those helping to look at something on Scratch and remix. Tidying up scripts on Scratch, for example, gives an arrangement of scripts that is easier to me to quickly scroll through looking for things rather than the Turbowarp arrangement where I have to scroll horizontally and vertically.

Make sure all variables are of the right type. CloneIDs need to be local but if you're using those to access a list that list needs to be global - you don't want each clone to be updating its own copy of a list.
https://scratch.mit.edu/projects/612405500/



LG125
Scratcher
500+ posts

Hotbar item decoding no work?

LG125 wrote:

deck26 wrote:

Why not create a copy of the project with as much as possible removed and share it on Scratch. It's much easier for those helping to look at something on Scratch and remix. Tidying up scripts on Scratch, for example, gives an arrangement of scripts that is easier to me to quickly scroll through looking for things rather than the Turbowarp arrangement where I have to scroll horizontally and vertically.

Make sure all variables are of the right type. CloneIDs need to be local but if you're using those to access a list that list needs to be global - you don't want each clone to be updating its own copy of a list.
https://scratch.mit.edu/projects/612405500/
Nvm, bug fixed.

Just magically happened after some more tweaking.



Powered by DjangoBB