Character dialogue changes changes

Started by Pixelton, Tue 30/03/2010 16:04:53

Previous topic - Next topic

Pixelton

Hey I was thinking.

I'm curious how dificult it is to set up a change in a character's dialogue after the player has done a number of tasks.

Say....my first NPC is using Dialog01 and I have Dialog02 which I want to display after the player has completed an event (could be collecting a particular item, intereactive with a hotspot or chat to a second character), when the player returns to the first NPC how would I kick of dialog02?

Any help is appreciated.
MB
Please follow our progress on IndieDB!

<a href="http://www.indiedb.com/games/dustbowl-a-wasteland-adventure" title="View Dustbowl - A Wasteland Adventure on Indie DB" target="_blank">Dustbowl - A Wasteland Adventure</a>

Khris

Use a variable. Create a bool in the Global variables pane, initial value false.

When the player did whatever triggers the second dialog, call variable_name = true;

Code: ags
// talking to NPC

  if (!variable_name) Dialog01.Start();
  else Dialog02.Start();

Danman

Damn you beat me Khris

There is 2 ways this could be done.

Way 1: Use global variables. ( MY way) ( It is in the manual)

Way 2: Just use the if statments like

Code: ags


if (player.hasinventory == "Invname" ) // This is just a guess on the script names.
{
dialog02.start();
}
else  dialog01.start(); 


Something very similar. Hope this helps.  :P







Pixelton

Ah cheers guys I'll need to play around when I reach that point, for some reason I'm always alittle apprehensive when doing stuff in the Global script.....I'm not sure why, I'm still alittle fuzzy with scripting.

Alittle off topic but I also have an idea for a new dialogue system (I'm going to be working with a forum frequenter called Def on this hopefully). About like Desnming's Gabrial Knights dialogue system with portraits but as you chat to NPC's around the world you collect 'Keywords' which can be used to ask other NPCs. For example you might chat to someone and in their start conversation "Hitmen" might be a keyword which will allow the player to ask other NPC's about Hitmen etc. (almost like dialogue items that can be collected).

But anyway thats another problem for another day. Thanks guys.

MB.
Please follow our progress on IndieDB!

<a href="http://www.indiedb.com/games/dustbowl-a-wasteland-adventure" title="View Dustbowl - A Wasteland Adventure on Indie DB" target="_blank">Dustbowl - A Wasteland Adventure</a>

aedwards00

Just to make a minor correction to Danman's solution, I think the correct syntax for the function in question is

Code: ags

if (player.HasInventory(iKey)) {  // where iKey could be any relevant item
    Dialog01.Start();
}
else Dialog02.Start();

Danman

Yea I don't have AGS on me so that was just a guess of the solution.
I always get confused with the Activeinventory function.

Anyhow thanks aedwards00 for correcting that.



SMF spam blocked by CleanTalk