Object based convo topics

Started by strangechicken, Tue 08/03/2011 14:44:23

Previous topic - Next topic

strangechicken

Ok, basically what I want will seem probably simple to most of you wizz-kids, but me being a noobus had no idea, how can I make an option appear in the dialogue, after the player has observed something, (IE. Look  at a poster, gain a dialogue option to talk to NPC about poster, See a flower pot vase, gain an option to ask about flowers)

Any help or advice would be awesome.

Aaron.

Khris

What exactly is the problem?

Add the option, uncheck Show, then turn it on if they look at the object.
All you need is Dialog.SetOptionState().
After the player has chosen the option, turn it off forever so it won't reappear if they look at the object again.

strangechicken

#2
Quote from: Khris on Tue 08/03/2011 15:24:12
What exactly is the problem?

Add the option, uncheck Show, then turn it on if they look at the object.
All you need is Dialog.SetOptionState().
After the player has chosen the option, turn it off forever so it won't reappear if they look at the object again.

So how do I say If the player, because i'm talking about Hotspots here, so how do i make the game identify that the play has examined a hotspot? (the poster is on the wall of a teacher class room, and the Main character talks to said teacher about it), I just don't know how to script this.  so i probably Mis titled this thread with the term "object" i apologise it, I didn't mean object as in a scripting sense, because its really hotspots i'm talking about, sorry if this confused you at all.

Matti

Quote from: strangechicken on Tue 08/03/2011 15:54:12
so how do i make the game identify that the play has examined a hotspot?

That's probably the most basic thing in AGS. Just choose "look at hotspot" in the events pane and the necessary function is created for you.



You should probably go through the tutorial.

strangechicken

#4
Quote from: Matti on Tue 08/03/2011 16:08:29
Quote from: strangechicken on Tue 08/03/2011 15:54:12
so how do i make the game identify that the play has examined a hotspot?

That's probably the most basic thing in AGS. Just choose "look at hotspot" in the events pane and the necessary function is created for you.



You should probably go through the tutorial.
Yeah I know how to do that, however i dont' know how to use it within the Dialogue script, to enable a dialogue option, because i know global script/room script, and dialogue scripts are two different things,  what i'm asking is, if Player has looked at a hotspot in the room, it will enable a certain dialogue option with a NPC that wasn't there prior to his examining of said hotspot, i've read the tutorials.

monkey0506

Code: ags
function hHotspot1_Looikat()
{
  dDialog1.SetOptionState(3, eOptionOn);
}

Khris

???

You don't need to do "if player has looked at hotspot x, turn on option y" inside the dialog script; all you do is turn on the option in the "player looks at hotspot" event code, the command you use is Dialog.SetOptionState.

To repeat myself, I don't get what the problem is here. It doesn't matter at all whether the player looks at a hotspot or object.

If you had to do it inside the dialog script you'd use a global bool variable and turn that to true in the interaction, then turn the option on after @S using standard script commands, just indent the lines so AGS doesn't expect dialog code. But, like I said, all this is unnecessary.

Also, please don't quote the complete previous post, it's pointless and irritating. It's right above yours anyway, right?

strangechicken

#7
Ok, i think I got it now, sorry its been a while since i've actually got back into scripting, The reason being i've done most of it, i just gotta polish up a few things, like incorperating this, so it makes logical sense to the player. i've spent most of the last few months doing animation stuff, so excuse my rustiness and confusion! Gotta start somewhere.  Hopefully get to release this very very soon

monkey0506

#8
Quote from: Khris on Tue 08/03/2011 16:39:36If you had to do it inside the dialog script you'd use a global bool variable and turn that to true in the interaction, then turn the option on after @S using standard script commands, just indent the lines so AGS doesn't expect dialog code. But, like I said, all this is unnecessary.

Off-topic: This actually makes me realize that in my verbcoin template that I've created a couple of unnecessary global booleans..:= I needed two of them for a "this-and-that" type of thing involving two different objects, but somehow that skewed my logic later on for a couple of individual items. Ah, it probably doesn't matter, I doubt anyone's going to look that deeply into the demo code for my template. :)

Back on-topic:

So, with the code snippet I posted and the explanation from Khris, this is solved, yes? Also, it's an interesting title for your thread when what you are dealing with apparently has nothing to do with Objects or dialog topics but rather has to do with Hotspots and dialog options. Good job. :P

strangechicken

Quote
Also, it's an interesting title for your thread when what you are dealing with apparently has nothing to do with Objects or dialog topics but rather has to do with Hotspots and dialog options. Good job.

That what Desperate cries for help at 3 am can do to a man!

SMF spam blocked by CleanTalk