ENabling hotspots through a dialog

Started by lilinuyasha, Sun 20/07/2014 16:35:19

Previous topic - Next topic

lilinuyasha

Hey there. it's been a long time since I've used AGS, and I've significantly decreased in my skill level.

I want a particular hotspot (hHotspot2[for all intents and purposes]) to be enabled only after I click on my character (cPinkie in script) with the hand. (IE Interact).

I've tried writing a hHotspot.enabled=true; command within the dialog (Properly tabbed of course) but it said something about an undefined token.
In order to try and get around this, i tried doing a Game.DoOnceOnly function to only do that dialog once, then enable the hotspot after. I kept getting some weird errors there, too. Currently, the hotspot is disabled (That much of the code works)but I want it to be enabled after dialog dTutorial2 finishes. I don't think a "Hasoptionbeenchosen" command would work since there's no option in the second dialog.

Anyways, if there's a way you could help me figure out how to run that dialog once, enable the hotspot for the rest of the game, and get me a girlfriend I'd greatly appreciate it.
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.

AprilSkies

If you need to enable it from a dialog, use the hotspot ID, not its name in the room.
if your hotspot ID is 1, use   hotspot[1].Enabled = true;

www.apemarina.altervista.org

lilinuyasha

I suppose I include the brackets as well?
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.

AprilSkies

Yes, as I wrote... atm i don't remember if hotspot[...] has the lower case, but i'm quite sure ys... anyway use the AGS smartness in completing words ;-)

www.apemarina.altervista.org

lilinuyasha

#4
Thanks. I'll probably post a question in here about if/then statements later. I've forgotten everything ._.

[edit]

Yes, I remember my questions now. DoOnceOnly. How do I make clicking on a character run the dialog once? WHat's the proper syntax? I tried (If click on character Game.doOnceOnly(dTutorial2.start) but it gives me weird errors.
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.

AprilSkies

It happens because it's not that the way to use DoOnceOnly!

DoOnceOnly check if you already did something... relating the "check" to a "string".... it's easier to do than explain... so if you want to fire up a dialoge only once write:

if (Game.DoOnceOnly("Mickey_mouse")) dTutorial2.start;

"Mickey_mouse" is a word used to check if you did before ... it's like a variable... DON'T USE THE SAME WORD in other places in the game... so chose a weird word (LOL).. I Always use cartoons characters...

This way the dialogue is fired up only the first time.

www.apemarina.altervista.org

Khris

Ideally you should use a short sentence that describes the situation:

if (Game.DoOnceOnly("tutorial part 2")) dTutorial2.Start();

(I figure it is much easier to accidentally use a cartoon character twice. Also, please look up commands in the manual before asking how they are used.)

SMF spam blocked by CleanTalk