Page 1 of 1

Scripting help

PostPosted: Wed Aug 31, 2005 4:47 am
Author: Anniko
I'm trying to make a basic fedex quest, but i cant figure out how to make it so some conversation options only come up when the PC has a certain item

Thanks

~Evangel

Re: Scripting help

PostPosted: Wed Aug 31, 2005 4:51 am
Author: Final Shinryuu
Anniko wrote:I'm trying to make a basic fedex quest, but i cant figure out how to make it so some conversation options only come up when the PC has a certain item

Thanks

~Evangel


In the conversation editor, there's an option on the bottom-right side where you can put in a script to govern when the selected conversation option appears.
There's also a button for the Script Wizard there. Click that, let it do the work for you. ;) It gives you a menu of things to select, and checking for an item is one of them.

PostPosted: Wed Aug 31, 2005 5:56 am
Author: Aloro
In short, you're looking for a conditional script.

Here's a sample script that checks to see if the PC has 100 gold:

Code: Select all
int StartingConditional()
{
    int iResult;
    object oPC = GetPCSpeaker();

    if (GetGold(oPC) >= 100)
    return TRUE;

    return FALSE;
}

This would go in the "Text Appears When" area for the conversation line in question. Replace the script with your own StartingConditional, and it should work fine.

- Aloro