gaining inventory item based on dialogue option chosen- question (solved)

Started by myname, Fri 08/12/2006 00:32:24

Previous topic - Next topic

myname

I am having trouble scipting dialogue so that my player character recieves an item/object and that item leaves the room only when the player character chooses a specific option in the dialogue.Ã,  As of right now the player gets the object and it leaves the room as soon as the dialogue begins.Ã,  If anyone could help me that would be great.Ã,  Thankyou.

Khris

Do a forum/manual search for "run-script X" and "dialog_request".

The dialog command "add-inv X" might be all you need, though.

myname

Thanks for the help but I tried using the dialogue-request global script but I recieved the same problem with the player recieveing the item as soon as the dialogue starts instead of after choosing option 2.
This is what I put for the global script:
function dialog_request (int a) {
  if (a==1) {//cSteve.AddInventory (irestorder);
  }
}
and this is what I put in the dialogue script
@2  // option 2
"blah blah blah"
//run-script a;
@3  // option 3
NANCY: "...lovely."
stop

Khris

Here's how it should work:
Code: ags
function dialog_request (int a) {
  if (a==1) {
    cSteve.AddInventory (iRestorder);
  }
}

Code: ags
@2  // option 2
"blah blah blah"
run-script 1      // 1 instead of a, NO semi-colon
return          // return to dialog choice

@3  // option 3
NANCY: "...lovely."
stop

Don't forget to "return" after each choice, otherwise the script will just continue running through every option.


SMF spam blocked by CleanTalk