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.4k stars 466 forks source link

Actor script doesn't work when attach script to button in a custom script #1369

Open calamarik opened 5 months ago

calamarik commented 5 months ago

Describe the bug Can't use actors other than player when putting an attach script to button in a custom script.

To Reproduce Steps to reproduce the behavior:

  1. create a custom script
  2. put an "attach script to button in the custom script
  3. on the "on press" put any actor related script (like activate actor for exemple)

Expected behavior On the actor list, we should be able to chose the player and any other actor but only the player actor is available.

Screenshots Expected : image

BUG : image

Platform (please complete the following information):

marco-afonso commented 3 months ago

Also need this very badly for both actor parameters and variable parameters! Because the native on interact event is very limited for me and I always have to use triggers for my interactions and to avoid duplicate work I would like to use custom scripts for the triggers but this prevents me from doing so because I cannot assign parameters inside the attach script to button event. From what I know (I might be wrong tho) these attach scripts events don't persist between scenes, so references to variables and actors would not be a problem or would it? I actually have no idea hahah

To be more specific, my need for the triggers on my game is that I want a certain UI to show when the user is able to interact with something (for instance, "Press A to pick up") and hide when the user has interacted or is no longer able to interact because they have walked away. Perhaps there's another solution for my problem?