issue with hotspots?

Started by lilinuyasha, Tue 10/05/2011 03:13:12

Previous topic - Next topic

lilinuyasha

I'm trying to get a hotspot to become available only after a specific dialog choice has been made. however, when bringing this up:


@2
cWaiter1: Yes. If you go into the back kitchen you can see him for yourself.
    hHotspot1.Enabled=true;

i get that it's an undefined token (which i've used the same spelling and phrasing in global script). Do i make that part of the script global? Because it depends on a dialog. However, i'm at a loss.
I can Fluently speak Braille. I obtained a swiss army knife...From the Turkish Navy. My hands feel like rich brown suede. My blood smells like cologne. I AM Trey Love, The most Interesting Man in the World.

Khris

In global scripts (i.e. every script that's not a room script), you have to use the global array for room specific stuff:

Code: ags
  hotspot[1].Enabled = true;


There's also region[] and object[].

The arrays always point to the current room, so if cWaiter is present in more than one room, you have to check for the value of player.Room first.

lilinuyasha

So i need to call a dialog function in the global script?
I can Fluently speak Braille. I obtained a swiss army knife...From the Turkish Navy. My hands feel like rich brown suede. My blood smells like cologne. I AM Trey Love, The most Interesting Man in the World.

Sephiroth

#3
You can create a global var "hotspot_active" boolean default value "false" and use the room_before_fadein (where the hotspot is) like this:

Code: ags

if(hotspot_active)
{
  hotspot[1].Enabled = true;
} 


And in your dialog you could put:

Code: ags

player: blah
 hotspot_active = true;


If you only need to activate a hotspot in a different room than the one where the dialog happens , then this should work.

Edit: Btw, the command Khris gave you should work directly inside the dialog, but then the dialog must occur in the room where the hotspot is to be effective, because like he mentioned, the array always points to the current room.

Khris

Quote from: lilinuyasha on Tue 10/05/2011 03:36:35
So i need to call a dialog function in the global script?
Not sure what you mean here, you rather need to call a global function in the dialog script.

There are two separate issues here, namely enabling a hotspot in a different room and how to do that from a dialog. The second part should be clear by now, just indent the line and you can use any global script command.
The first part was just explained to you by Sephiroth.

Btw, both of these have been asked and answered multiple times and recently, please use the forum search before opening new threads.

lilinuyasha

yeah,m i figured it out. Just put a dialog function in the room script.
I can Fluently speak Braille. I obtained a swiss army knife...From the Turkish Navy. My hands feel like rich brown suede. My blood smells like cologne. I AM Trey Love, The most Interesting Man in the World.

SMF spam blocked by CleanTalk