Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: eshiel on Thu 14/01/2016 02:27:10

Title: hotspots not active?
Post by: eshiel on Thu 14/01/2016 02:27:10
i'm running into a couple of problems.

1) So originally, I had a handful of hotspots with Look interactions that worked fine. I tried to add some objects but ultimately decided I didn't need them as I'm not utilizing any inventory system, removed them from the room/script, and switched to putting them in as hotspots drawn into the background (since the only thing I need from them is the "look" function with displaying some flavor text). But now only a handful of them will work.  Specifically, the first 4 work fine, and all after that don't? I'm not sure if I'm hitting some hotspot limit there or not. Here's my code (don't mind my filler text):
Code (ags) Select

function hStank_Look()
{
Display ("this is text i cant believe im redoing this");
gSaveGame.Visible = true;
}


function hBrochure_Look()
{
Display ("hi");
}

function hNet_Look()
{
Display("hi again");
}

function hDress_Look()
{
Display ("boo");
}

function hTank_Look()
{
Display("BIG TANK");
}


function hNotepad_Look()
{
Display("stuff here");
}


function hPic_Look()
{
Display ("pic");

}

function hBooks_Look()
{
Display("boo");
}


function hBox_Look()
{
Display("nothing");

}

function hScepter_Look()
{
Display("who knows");
}


I also have a code running to make the cursor switch automatically when hovering over hotspots in repeatedly_execute-
Code (ags) Select

  int mm = mouse.Mode;
  int nm;  // new mode
  Hotspot*h;
  Object*o;
int lt = GetLocationType(mouse.x, mouse.y); // what's under the cursor?

  if (mm != eModeUseinv) {
  if (lt == eLocationNothing) nm = eModeWalkto;
  if (lt == eLocationHotspot) {
        h = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
        nm = h.GetProperty("def_curs");
    }
        if (lt == eLocationObject) {
        o = Object.GetAtScreenXY(mouse.x, mouse.y);
        nm = o.GetProperty("def_curs");
    }
     if (lt == eLocationCharacter) {
  nm = eModeTalkto;
  }


2) I'm using Sierra-style with background for dialogue, however I have one line that's set to lucasarts using speech.style=eSpeechLucasArts; - however, her talksprite keeps popping up in the middle of her text anyway. i didn't think talksprites displayed with lucasarts style, so maybe that's just a misunderstanding of the functionality on my part, but is there a way to temporarily disable her talk sprite?
(you can see why it's a little awkward: (https://i.gyazo.com/1d083f6a7d44b740044d2418897fa425.png))
ha! nevermind, got it, sorry!
thanks,
-e


Title: Re: hotspots not active?
Post by: Snarky on Thu 14/01/2016 10:48:12
For your first problem, the cause is almost certainly that you haven't linked them from the "Look" event in the hotspot properties. (In the "Room" tab, show hotspots, go to the property panel in the bottom right, select the hotspot you want from the dropdown, and switch to the event view with the thunderbolt button. Enter the function name into the appropriate event field.)
Title: Re: hotspots not active?
Post by: eshiel on Fri 15/01/2016 06:26:07
Unless I'm misunderstanding you, I do have them linked there?

Here's hNotepad to show my hotspot properties (all of them are set up this way, including the ones that work):
(https://i.gyazo.com/e4cf9f4e4f98541d9f0940c1e745be6c.png)
Title: Re: hotspots not active?
Post by: Snarky on Fri 15/01/2016 08:29:53
Hm, weird. Does the hover work over all the hotspots?

If it's like the hotspot doesn't exist at all, you should check the "enabled" value. You might also want to confirm that the objects are really truly gone and not just sitting there invisibly covering up the hotspots.
Title: Re: hotspots not active?
Post by: eshiel on Sat 16/01/2016 17:29:39
ha, got it!
apparently the default cursor on the new hotspots was set to interact rather than look, which is why they weren't coming up. all good now!