NPC Give player objects after specific dialog (Solved)

Started by Duckbutcher, Wed 15/03/2006 16:30:54

Previous topic - Next topic

Duckbutcher

Hi, first post so don't annihilate me....

Just scripted my first conversation between my player and an NPC. This conversation has more than one outcome - after one outcome I'd like to give my player an item, but the other outcomes should leave them empty handed. I can't figure this at the moment, the only thing I can do is give the player the item no matter the outcome. can anyone help?

duckbutcher@hotmail.co.uk

DoorKnobHandle

Look up the "dialog_request" function in the manual that comes with AGS. You can add a line like this to the dialog script:

Code: ags

run-script 1


This will call the "dialog_request" function and pass a "1" as parameter. Now use this "dialog_request" function:

Code: ags

function dialog_request ( int parameter )
{
   if ( parameter == 1 )
   {
      // do what you want (ie. give the player an inv. item)
   }
}


Oh, and welcome to the forums.

Ashen

How have you tried doing it far?
As dhk said (as I was typing this) try using run-script and dialog_request (BFAQ Entry for more details) to give the item when you want to. An other way would be to use set-globaint in the dialog, and check it's value after the Dialog has been run.
I know what you're thinking ... Don't think that.

Duckbutcher


SMF spam blocked by CleanTalk