chrismaltby / gb-studio

A quick and easy to use drag and drop retro game creator for your favourite handheld video game system
https://www.gbstudio.dev
MIT License
8.43k stars 467 forks source link

Random Dialogue Box is presented when B is pressed #484

Open TheManTheGifTheLegend opened 4 years ago

TheManTheGifTheLegend commented 4 years ago

Describe the bug In this code, when pressing "B", a random piece of dialogue will pop up. This was, in 1.2.1 regular build, a random piece of dialogue from anywhere else in the game, but in the dev build it is now random characters (see screenshots)

To Reproduce Steps to reproduce the behavior: 1)run project 2) avoiding all triggers apart from scene changes necessary, walk Left, left, up, left, on the map (changing scenes on the leftmost part of the screen twice, then topmost, then leftmost), staying on the road as that is where the scene changes are. 3)Walk onto the door of the central-top of the 6 houses on the lower half of the scene 4)Press B

Expected behavior The player sprite changes to a mouse cursor (player was hidden, hitting B increments value $11$ by 1, the script calls the change of player sprite based off of $11$, nowhere is a dialogue mentioned.

Screenshots (and gameboy studio files attached in .zip) image

ForGitHub.zip

Platform (please complete the following information):

RichardULZ commented 4 years ago

Unfortunately, your project file didn't make it into the attached project zip, all other assets are present. There is a built rom in builds, but that seems to be from 1.2.1, so won't help to reproduce the bug.

TheManTheGifTheLegend commented 4 years ago

Unfortunately, your project file didn't make it into the attached project zip, all other assets are present. There is a built rom in builds, but that seems to be from 1.2.1, so won't help to reproduce the bug.

I'll try again, sorry.

TheManTheGifTheLegend commented 4 years ago

ForGitHub2.zip here is the new .zip with the .gbproj inside

RichardULZ commented 4 years ago

https://discord.com/channels/554713715442712616/570925559346102273/748323358336090122 Ahh, this is continued from discord, thank's for getting it into the issue tracker.

The issue is said to be present in 1.2.1, and develop, for your project. Pautomas has suggested an undiscovered too many script ptrs, or text, But it could also be a simple oversight in scripting somewhere, deep in the project.

Found it, Label define error with no error logging, attempted to access a defined label in the init script from the attached script on B, The attach script to b is considered a separate script entirely.

image

This issue has been a not so uncommon problem for many users trying to use define and go to.

Ideas, Create an error message "Defined label out of reach, are you calling from an attached script?" If defined or go to is not within the same attached script or base level of a script.

Create a GoTo Long or GoTo Global that stores Bank, Bank pointers, And Script start, to jump long distances across a script, basicly actor invoke but anywhere, could get out of hand just as easily.