SOLVED - Hotspost (room2) is not working after leaving room1 (using dialog)

Started by lemonpeu, Sun 11/08/2024 23:51:36

Previous topic - Next topic

lemonpeu

Hello people, so I'm using AGS for the first time in my life to do a game for a jam. So, after saying this I'll also say that I've read all the tutorials/documentation and watch all the videos available out there but I can't find a solution to my problem.

So:

In room1 you can select two options, after selection one from a dialog, you go to room 2. The problem is that room 2 has a hotspot and I can't interect in any form with it, look, interact, grab, it doesn't matter. I can't log a Display(), nothing.

My dialog used in room 1 looks like this:

// Dialog script file
@S  // Dialog startup entry point
return
1
cMimi: Debería apurarme
cMimi: Debo ir a la casa de quien pidio esto
  StopDialog();
  player.ChangeRoom(2, 336, 500);
  player.ManualScaling = true;
  player.Scaling = 20;
return
2
cMimi: No tengo prisa, creo que antes de ir iré a hacer las compras
stop


Hostpost from room 2 is:

function hHouse_Interact(Hotspot *theHotspot, CursorMode mode)
{
  cMimi.Walk(343, 104, eBlock, eWalkableAreas);
}


Names are correct. I really don't understand what I'm missing. Thanks in advanced.

-----

Solution: I'm dumb. I was adding a Gui to the first room and changed its transparency to 100 to hide it. The problem is that it was still there when I changed it to room 2, so when I clicked on my hotspost I was clicking on the gui, I just couldn't see it.

Eon_Star

Hi,

Please check if the hotspot was "drawn" inside the room. If not the player will not be able to interact with it. The dialog should not be affecting it.
Maybe you can send us the room 2 script or the game file, so we can check in detail.

Thanks.

Crimson Wizard

QuoteThe problem is that room 2 has a hotspot and I can't interect in any form with it, look, interact, grab, it doesn't matter. I can't log a Display(), nothing.

In 99% cases this would be because you did not register hHouse_Interact in the list of hotspot's events.
https://adventuregamestudio.github.io/ags-manual/images/acintro3_03.png
so that's the first thing to check.

lemonpeu

Quote from: Crimson Wizard on Mon 12/08/2024 00:22:13
QuoteThe problem is that room 2 has a hotspot and I can't interect in any form with it, look, interact, grab, it doesn't matter. I can't log a Display(), nothing.

In 99% cases this would be because you did not register hHouse_Interact in the list of hotspot's events.
https://adventuregamestudio.github.io/ags-manual/images/acintro3_03.png
so that's the first thing to check.



Hi, thank you for replying. I do have that :) I hate being that 1% haha that would make my life easier.



Quote from: Eon_Star on Mon 12/08/2024 00:07:02Hi,

Please check if the hotspot was "drawn" inside the room. If not the player will not be able to interact with it. The dialog should not be affecting it.
Maybe you can send us the room 2 script or the game file, so we can check in detail.

Thanks.

Of course, is just this function:


function hHouse_Interact(Hotspot *theHotspot, CursorMode mode)
{
  //cMimi.Walk(343, 104, eBlock, eWalkableAreas);
  //cMimi.ChangeRoom(3,  500,  300, eDirectionLeft);
  cMimi.Say("Hello");
  cMimi.Walk(343, 104, eBlock, eWalkableAreas);
  Display("Interacción con el hotspot funciona cordddrectamente.");
}


Im not sure what you mean by "Please check if the hotspot was "drawn" inside the room.". In my room 2 I drew a hotspot. In another project I could make it work, after adding a dialog it doesn't :(

Crimson Wizard

I suppose you may clarify if this depends on dialog at all. Set the starting room for the player character to room 2 and see if hotspot interaction works if game begins there.


Then, I'm not sure if this is relevant to the problem, but I noticed that you use "StopDialog" in your dialog script and "return" after ChangeRoom. You don't have to use "StopDialog" inside the dialog script at all, instead use "stop" command in the end:

Code: ags
cMimi: Debo ir a la casa de quien pidio esto
  player.ChangeRoom(2, 336, 500);
  player.ManualScaling = true;
  player.Scaling = 20;
stop


lemonpeu

Quote from: Crimson Wizard on Mon 12/08/2024 01:01:50I suppose you may clarify if this depends on dialog at all. Set the starting room for the player character to room 2 and see if hotspot interaction works if game begins there.


Then, I'm not sure if this is relevant to the problem, but I noticed that you use "StopDialog" in your dialog script and "return" after ChangeRoom. You don't have to use "StopDialog" inside the dialog script at all, instead use "stop" command in the end:

Code: ags
cMimi: Debo ir a la casa de quien pidio esto
  player.ChangeRoom(2, 336, 500);
  player.ManualScaling = true;
  player.Scaling = 20;
stop




I added the stopDialog function to test to see if that solved my issue and forgot to remove it to send it here. But yeah, without it it also doesn't work.
Is there something else I can send/add here to help?

lemonpeu

Quote from: Crimson Wizard on Mon 12/08/2024 01:01:50Set the starting room for the player character to room 2 and see if hotspot interaction works if game begins there.

Sorry for quoting your answer again, but this time I did this and second room worked just fine. This is making me believe x2 that the problem is reharding adding a dialog and functionality inside of it.

Khris

The only way a dialog disables a hotspot is by explicitly calling
Code: ags
  hotspot[1].Enabled = false;
inside its script.

Please do not believe weird things without good cause.

As for the actual reason, I'm going with the mouse.Mode for now. The function only gets called if you eModeInteract with the hotspot. Try adding an AnyClick handler that displays the cursor mode.

Something else you can do is add a small GUI with a label and set its text to "@OVERHOTSPOT@". The label will now show the hotspot's description if you mouse over it.

SMF spam blocked by CleanTalk