Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Variable is Set When I Don't Want It to Be (Nor did I Program it to Be)
- Coder046
-
Scratcher
100+ posts
Variable is Set When I Don't Want It to Be (Nor did I Program it to Be)
https://turbowarp.org/639139411
Click on the items to show the crafting recipes. Use the 1, 2, and 3 number keys to switch between pages. On the third page, the three boats (jungle, acacia, and dark oak) will NOT show the recipes after the message is conveyed to the main sprite so that the main sprite can make the clones. I looked at the variable, and the culprit is: the item/block variable. It keeps being set to the last item put into the grid, as long as the item is a 3D block item (or one of the 2D items in-between the 3D ones). It's a really weird bug, and the code's right; I need to know how to fix it. I can't report it, though; I can't pinpoint it down to what's happening. It only occurs when one of the aforementioned items is in the bottom row of the grid.
Click on the items to show the crafting recipes. Use the 1, 2, and 3 number keys to switch between pages. On the third page, the three boats (jungle, acacia, and dark oak) will NOT show the recipes after the message is conveyed to the main sprite so that the main sprite can make the clones. I looked at the variable, and the culprit is: the item/block variable. It keeps being set to the last item put into the grid, as long as the item is a 3D block item (or one of the 2D items in-between the 3D ones). It's a really weird bug, and the code's right; I need to know how to fix it. I can't report it, though; I can't pinpoint it down to what's happening. It only occurs when one of the aforementioned items is in the bottom row of the grid.
- Thingied
-
Scratcher
1000+ posts
Variable is Set When I Don't Want It to Be (Nor did I Program it to Be)
Seems like the clones for the boats are somehow getting deleted even though the broadcast was sent earlier. Now I don't know why this is happening, but I do have an solution. This solution is to make a variable that is for this sprite only and tells whether the clone is on its first tick or not. If it is, don't delete the clone because it has just been made, if not delete it as it is old.


- Discussion Forums
- » Help with Scripts
-
» Variable is Set When I Don't Want It to Be (Nor did I Program it to Be)