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
Look up the "dialog_request" function in the manual that comes with AGS. You can add a line like this to the dialog script:
run-script 1
This will call the "dialog_request" function and pass a "1" as parameter. Now use this "dialog_request" function:
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.
How have you tried doing it far?
As dhk said (as I was typing this) try using run-script and dialog_request (BFAQ Entry (http://americangirlscouts.org/agswiki/index.php/Scripting%2C_Code_%26_Interaction#Running_regular_code_inside_dialog) 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.
Thanks guys, sorted it out.