Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: kontakatilu on Sun 19/04/2020 10:25:12

Title: Missing Cursor while change room
Post by: kontakatilu on Sun 19/04/2020 10:25:12
I have a problema, while i change room, the mouse cursor disappear until the change is complete... and i cant cancel it..

i use:
player.EnterRoom(5, 302, 141, eDirectionLeft);

Can anyone help me Please?
Title: Re: Missing Cursor while change room
Post by: Cassiebsg on Sun 19/04/2020 10:36:41
Why do want the cursor to be visible and what do you want to cancel?
I'm not familiar with EnterRoom, is that a custom function you have created or something available from a template?

But in any case, if you fade in and out in the room transition then yes, the mouse cursor will disappear, since what AGS does is not render any images during the "blackness". If for some reason you want the cursor to show, change the transition method to instant and then code your own "fade effect" (just create a hole black GUI), if you even want a black screen in bettewn the scenes.

I'm not sure what you want to cancel, but if it's the changing rooms command, then I don't think there's anyway to cancel it. Room change events occur at the end of the function, so even if you have it placed in the middle of the function, it will only run after it's ended. Maybe there's a way to stop it happening, but why not just code it to change room when you want it to change room in the first place?
Title: Re: Missing Cursor while change room
Post by: kontakatilu on Sun 19/04/2020 10:58:52
Hi, im using TEMPLATE: 9-verb MI-style, i have a hootspot área, and i want click in it, and the character walk to it and then change the room, but if i click to another place, the character walk to it and cancel changing room, but when i try it with:

if (UsedAction(eMA_WalkTo)){player.ChangeRoom(5, 302, 141);}

the character no walk, and change the room immediately…

i dont know if there is another way to do this…

Thanks.
Title: Re: Missing Cursor while change room
Post by: Cassiebsg on Sun 19/04/2020 14:10:52
I'm not familiar with how this template is coded, as I never used.

But if you want the player to walk to the spot and then change room, and still be able to cancel the action (walk). Then you need to separate the code.

As in:
- make the character walk to the specified coords (x,y) using NoBlock (when you click the hotspot).
- then either use a region for the character to steep in, so you can trigger the ChangeRoom or you can check if the player has reached the coords you send it to in rep_exec, and if so execute the  ChangeRoom. I'm sure there's also other ways to code this, but these two seem to be the easiest I can think of, atm.

Title: Re: Missing Cursor while change room
Post by: Khris on Sun 19/04/2020 21:50:26
Check the manual PDF in the game folder. On the bottom of page 7 you'll find "Semi-blocking movement functions".

Use
Code (ags) Select
  if (Verbs.MovePlayer(120, 80)) player.ChangeRoom(5, 302, 141);
inside the UsedAction block.