Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Jojowl80 on Thu 28/05/2020 02:24:04

Title: Is it possible to have a different hotspot on same part of room
Post by: Jojowl80 on Thu 28/05/2020 02:24:04
I made a closet door that opens and when it opens I added an object to show the door open with new objects behind it. Now I dont see a way to interface with the new items. is this even possible?
Title: Re: Is it possible to have a different hotspot on same part of room
Post by: Crimson Wizard on Thu 28/05/2020 02:42:11
Make the door unclikable after it opens (myObject.Clickable = false). Or, if you still want to be able to close the door, move it aside (depends on how it's opening) by setting new X and Y coordinates.

Title: Re: Is it possible to have a different hotspot on same part of room
Post by: Khris on Thu 28/05/2020 08:48:48
My 2 cents:
Try to model your game world after how the real world works: draw the closet without doors as part of the (immobile) background, then use an object to show the closed door. Interacting with that door will change its .Graphic (and position, unless you draw the sprites in a way the hinges are at the same spot in both sprites). Transparent areas of objects don't catch clicks, so you can now interact with objects behind the door object.
Title: Re: Is it possible to have a different hotspot on same part of room
Post by: Jojowl80 on Thu 28/05/2020 21:06:18
so forgive me as I have been only doing this for 2 days, but here is the code I have so far


function oClosetdoor_AnyClick(){
if (Verbs.UsedAction(eGA_WalkTo)) {
}else if(Verbs.UsedAction(eGA_Open)) {

{oClosetdoor.Move(64, 85,  eBlock);
oClosetdoor.Clickable = false;
}
}}


Game starts,but the closet door does not visibly move to the desired location. Also it might be worth noting that the door slides slightly to the left, not on "hinges"
Title: Re: Is it possible to have a different hotspot on same part of room
Post by: Khris on Fri 29/05/2020 00:19:57
Check the parameters again, the 3rd is speed. Try something like

Code (ags) Select
  oClosetdoor.Move(64, 85, 4, eBlock);
Title: Re: Is it possible to have a different hotspot on same part of room
Post by: Jojowl80 on Fri 29/05/2020 00:33:12
well Its working now, thanks for all the help, and thanks for the speed tip!