Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: miguel on Mon 26/12/2011 14:41:48

Title: change hotspot[x].name
Post by: miguel on Mon 26/12/2011 14:41:48
Hi guys,
Is there a workaround for changing hotspot names during script? Without replacing them with objects?
I've checked the forums but it was inconclusive and the manual does say it isn't possible...

Thanks


I guess I can duplicate hotspots with the name I want and just enable them on and off...
Title: Re: change hotspot[x].name
Post by: Khris on Mon 26/12/2011 15:13:41
You can't duplicate them because two hotspots can't occupy the same pixels.

The only workaround is to replace @OVERHOTSPOT@ depending on a variable.

  // rep_ex

  lblOH.Text = "@OVERHOTSPOT@";
  var hid;
  if (GetLocationType(mouse.x, mouse.y) == eLocationHotspot) {
    Hotspot*h = Hotspot.GetAtScreen(mouse.x, mouse.y);
    hid == h.ID;
    if (player.Room == 3) {
      if (hid == 4 && carpet_is_wet) lblOH.Text = "wet carpet";
    }
    ...
  }
Title: Re: change hotspot[x].name
Post by: miguel on Mon 26/12/2011 16:58:12
Okay, I understand what you're saying. Should be easy to do it.

Thanks Khris, merry xmas.