Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: zeta_san on Mon 03/08/2020 18:22:22

Title: Doubleclick on open doors instantly[solved]
Post by: zeta_san on Mon 03/08/2020 18:22:22
Hi everyone
I am Italian, I hope to write correctly.
I am using the Tumbleweed theme, I have modified and added.
Now it's how I like it but I don't like that you can enter the room without reaching the door.

Code (ags) Select

  // Doubleclick on open doors changes room instantly
  Verbs.VerbGuiOptions[eVerbGuiExitDoorDoubleclick] = true;


Even changing this value I don't solve
thanks
Title: Re: Doubleclick on open doors instantly
Post by: Khris on Mon 03/08/2020 19:30:35
Unfortunately, the template in the first room's script doesn't contain the wrapper to make the player character reach the clicked area first.

What you're supposed to do is
Code (ags) Select
function oDoor_AnyClick() {

  // walk to door first
  if (Verbs.MovePlayer(170, 134)) {

    // verb blocks in here
    if(Verbs.UsedAction(eGA_Use)) {
      // ...
    }

  }
}


This way the player will walk to the stated coordinates without blocking the game, and the commands for the verb will only run if they actually reach the door.
Title: Re: Doubleclick on open doors instantly
Post by: zeta_san on Tue 04/08/2020 06:48:37
thank you, I thought about it immediately after posting. I always use that solution for objects and hotspots

thanks