Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Kurtka on Sun 17/03/2024 23:12:41

Title: how do I make a changeroom function by just clicking a hotspot?
Post by: Kurtka on Sun 17/03/2024 23:12:41
I am currently trying to make a game  in AGS 3.6.0 that simply has you move from one place to another by simply clicking on a hotspot, similar to something like Daymare Town or Covert Front. I initially tried to do this by creating a hotspot to with the event for "any click on hotspot" set to "player.ChangeRoom(2)", but on attempting to run it, clicking the hotspot incurs the error "RunScriptFunction: error -18 () trying to run 'player.ChangeRoom(2)' (Room 1)
Title: Re: how do I make a changeroom function by just clicking a hotspot?
Post by: Khris on Sun 17/03/2024 23:16:32
You don't write the command into the events table field.
Empty the field, the click the ellipses button at the end. This will create and link the function and take you to it. Now put the command(s) inside the function.

This process is explained in the tutorial:
https://adventuregamestudio.github.io/ags-manual/acintro3.html
Title: Re: how do I make a changeroom function by just clicking a hotspot?
Post by: Kurtka on Sun 17/03/2024 23:28:21
I may be stupid...