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

Custom Script does not send correct value from variable to Actor Set Animation Frame. #955

Open allogenes-zero opened 2 years ago

allogenes-zero commented 2 years ago

Describe the bug Custom Script does not send correct value from variable to "actor set animation frame".

I am using a custom script that has two parameters; a variable and an actor. I am using the variable to set the actors animation frame. After this I am printing out a debug message with the value of the variable. gbs-error-00

I am calling the custom script from inside the "attach script to down button" event and it passing: a local variable that is incremented between script calls as well as the actor that is intended to have it's frame updated. gbs-error-01

The inventory before the call to the custom script looks like this. gbs-error-02

After the "attach script to down button" event is activated we get this as our output. gbs-error-03 gbs-error-04

As can be seen from the debug output the variable is printing out the correct number passed to the script, but the fact that both sprites disappear means the "actor set animation frame" command must be receiving a zero, as that is the only transparent frame in the sprite sheet used for inventory items.

Platform:

SalvatoreTosti commented 2 years ago

I've also encountered this bug on OSX 12.2.1, GB Studio 3.0.3. I created a minimal reproducible case for this bug. https://github.com/SalvatoreTosti/gb-studio-issue-955

zapobyte commented 2 years ago

Hello people,

I've encountered the same bug on 3.0.3 on Windows 10. Can provide steps to reproduce also if needed, but there seem to be already 2 examples.

ricardobusta commented 7 months ago

I have encountered the same issue (3.2.0). Created a shared script to update a number actor in the menu, but it's not possible to set the frame with the variable (Set Animation Frame to $Variable not working inside script). The Dialogue with the $variable worked fine.

My solution was to copy just the event to set the animation frame on every number instance.