Scripting help

Moderator: Event DM

Post Reply
Anniko
Scholar of Fools
Posts: 313
Joined: Mon May 24, 2004 10:50 am
Location: Australia, Brisbane (GMT +10)

Scripting help

Post by Anniko » Wed Aug 31, 2005 4:47 am

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
<Fuzz> thankfully, no one quotes me
<GairusWHO> I think so... but don't quote me on that.
<NWDuneAuron> in other news, study proves studies don't prove anything!
User avatar
Final Shinryuu
Sage
Posts: 2060
Joined: Thu Jun 24, 2004 3:20 am
Location: http://hades.mercuric.net/

Re: Scripting help

Post by Final Shinryuu » Wed Aug 31, 2005 4:51 am

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.
User avatar
Aloro
Team Member; Retired with Honors
Posts: 12805
Joined: Sat Dec 28, 2002 5:11 am
Location: Rainbow's End
Contact:

Post by Aloro » Wed Aug 31, 2005 5:56 am

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
Aleksandr Solzhenitsyn wrote:The meaning of earthly existence lies, not as we have grown used to thinking, in prosperity, but in the development of the soul.
Post Reply