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.51k stars 469 forks source link

scenes behaving strangely after migrating from 1.2.1 to 2.0 #478

Open spacebot-interactive opened 4 years ago

spacebot-interactive commented 4 years ago

actor sprites not displaying properly and script not executing correctly in certain scenes after project has been migrated over from 1.2.1 - If you start in scene 5 of the project, you will notice that some of the actors that make up Ganondorf are not displaying properly, a music track should also play at a certain point in the script (towards the end) but this isn't happening on 2.0, I haven't done anything to script since migrating 22.08.20 GB Studio 1.2.1.zip 26.08.20 GB Studio 2.0.zip

chrismaltby commented 4 years ago

Thanks for sending this project through @tofa2403 I get the feeling its the timer script event that's the problem. GB Studio 2 runs Timer scripts as a background process rather than a foreground one so it shouldn't pause the game when you run them (or at least not as much). I think there's probably a bug in that implementation that this is triggering.

The files you sent through should be very helpful debugging this, will see what I can do.

chrismaltby commented 4 years ago

On further investigation it actually seems the issue is because the actors are offscreen and currently in GB Studio 2 offscreen actors don't become visible unless player movement causes them to come on screen or a script on the main context (a scene start script or interacting with an Actor, but NOT timer/input scripts) moves them.

It's a bit tricky to fix this properly so the events still work so it might take some time but short term you can fix this issue in your project by removing the timer script, which is a bit unnecessary and causes you to need to do the big deeply nested "If Actor At Position" and just move events directly onto the scene start script with a wait event between each frame (which is probably how I'd recommend scripting this anyway as it avoids all the nesting and you can group the different frames to collapse them). Here's a version of your project with that scene fixed: 22.08.20 GB Studio 2.0 Scene5Fix.zip

I'll leave this issue open while I figure out how best to fix this so that functionality is kept the same between 1.2.1 and 2.0

spacebot-interactive commented 4 years ago

Ok that’s great, thanks mate

Was the timer script causing the issue with the music track not playing when it should?

Cheers

Chris

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: Chris Maltbymailto:notifications@github.com Sent: 28 August 2020 18:00 To: chrismaltby/gb-studiomailto:gb-studio@noreply.github.com Cc: tofa2403mailto:chris.beach24@hotmail.com; Mentionmailto:mention@noreply.github.com Subject: Re: [chrismaltby/gb-studio] scenes behaving strangely after migrating from 1.2.1 to 2.0 (#478)

On further investigation it actually seems the issue is because the actors are offscreen and currently in GB Studio 2 offscreen actors don't become visible unless player movement causes them to come on screen or a script on the main context (a scene start script or interacting with an Actor, but NOT timer/input scripts) moves them.

It's a bit tricky to fix this properly so the events still work so it might take some time but short term you can fix this issue in your project by removing the timer script, which is a bit unnecessary and causes you to need to do the big deeply nested "If Actor At Position" and just move events directly onto the scene start script with a wait event between each frame (which is probably how I'd recommend scripting this anyway as it avoids all the nesting and you can group the different frames to collapse them). Here's a version of your project with that scene fixed: 22.08.20 GB Studio 2.0 Scene5Fix.ziphttps://github.com/chrismaltby/gb-studio/files/5143259/22.08.20.GB.Studio.2.0.Scene5Fix.zip

I'll leave this issue open while I figure out how best to fix this so that functionality is kept the same between 1.2.1 and 2.0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/chrismaltby/gb-studio/issues/478#issuecomment-682899315, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APMKOUOX7XDBGRLNKO77FOTSC7PDXANCNFSM4QLV2LHA.