Pocket Plane Group

Miscellany, Inc. => Infinity Engine Modding Q&A => Topic started by: Bill Bisco on August 22, 2015, 05:15:56 PM

Title: Detecting Item Values in Script
Post by: Bill Bisco on August 22, 2015, 05:15:56 PM
Dear all,

I couldn't find anything at: http://gemrb.org/iesdp/scripting/triggers/bg2triggers.htm

I'd like to detect if the party has items worth up to a certain amount of gold.  And then give the party the option of losing those items (instead of losing gold).  Any script or other function that could do that?  Or is this a pure engine limitation?


Title: Re: Detecting Item Values in Script
Post by: Angel on September 03, 2015, 02:14:00 PM
There's no built-in function that can do this.  Theoretically you could probably have WeiDU loop over all available items in the game, look up their value and construct the dialog options on the fly from those, but the number of possible combinations would be astronomically high, so I doubt it would be very practical.

Your best bet is probably to make a selection of a few viable items that the party is likely to have, and give the player a choice of giving up a certain item if they have it.  Or just simply have an option for the player to say they don't have that much gold at the moment and have the character direct them to the nearest store.  Or you could create a special shop that only buys things and doesn't sell any, like Officer Vai in BG1, and let the character open that through dialog.