gb-studio icon indicating copy to clipboard operation
gb-studio copied to clipboard

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

Open allogenes-zero opened this issue 3 years ago • 3 comments

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:

  • OS: win10

allogenes-zero avatar Jan 01 '22 10:01 allogenes-zero

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

SalvatoreTosti avatar Mar 23 '22 22:03 SalvatoreTosti

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.

zapobyte avatar May 26 '22 18:05 zapobyte

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.

ricardobusta avatar Feb 02 '24 21:02 ricardobusta