logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
SetGoldPieceValue() Function

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Sat Aug 04, 2007 20:44    Post subject: SetGoldPieceValue() Function Reply with quote

Has the SetGoldPieceValue() function been developed yet? I am finding that I reallt need it now.
_________________
Jim (aka, Urlord)
Visit the Persistent World of Nymri
Back to top
View user's profile Send private message Send e-mail
GodBeastX



Joined: 09 Aug 2006
Posts: 65

PostPosted: Wed Aug 15, 2007 19:11    Post subject: Reply with quote

I'm not sure if it has been, but in the toolset you can set the value of items when being sold from merchants now. Something that wasn't possible in NWN1 toolset.
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Thu Aug 16, 2007 0:25    Post subject: Re: SetGoldPieceValue() Function Reply with quote

Urlord wrote:
Has the SetGoldPieceValue() function been developed yet? I am finding that I reallt need it now.


Careful here...
What you really want is AdjustGoldPieceValueBy() *semantics, but what really needs to be done.

The GetGoldPieceValue() is actually a calculation.
[Base + Mod(s)] + Adj

The base is set in the toolset (part of the blueprint), Mod(s) are values(multipliers?) in several 2DAs . Which leaves Adj (officially AdditionalCost). This is also set in the toolset, but it is the only 'static' field within the game-object.

Keep track of this, and you could feed it back via a toolset plugin on the next build.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Thu Aug 16, 2007 16:18    Post subject: Reply with quote

I am working on a Persistent Merchant system. Here is how it works:

- In the OnAcquire event, items are added to the master Items table. This is just to populate the databasee without having to type everything in (I'm lazy). I am storing ResRef (key), Name, MaxStackSize and GPValue in this table. I also have tables for "Stores", "Store_Purchase_List" and "Store_Inventory".

- When a store is first opened, it initializes by stocking the store with items from the Store_Inventory table, re-stocking quanties to a Minimum qty from the Store_Purchase_List table if needed. It is taking about 20-30 milli-seconds to stock a 100 item inventory but this only happens once per store.

- As things are bought, the Store_Inventory table is updated.

- When something is sold, it checks to see if the the store wants it by checking if the item is in the Store_Purchase_List table AND the store's Maximum qty for this item. This give me Item-Level control on what is bought and sold. If not, it returns the item to the PC and takes back the gold. If the store wants it, it updates the Store_inventoty table.

Since all the prices in my PW vary greatly from those in the base game, I have been creating copies of all the items and setting the gp values accordingly. This is required since currently, there is no way to adjust or set the GP value. From Gryphyn's post, it looks like I could make a new column in the Items table called PWValue and when the item is stocked into the store, apply PWValue-GPValue as an adjustment with the AdjustGoldPieceValueBy() function. If so, it would save a lot of work. I would love it if this function, or one like it could be developed. The sooner, the better Very Happy


Thanks a bunch!!!
Sorry for the Rambling.
_________________
Jim (aka, Urlord)
Visit the Persistent World of Nymri
Back to top
View user's profile Send private message Send e-mail
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Fri Aug 17, 2007 1:21    Post subject: Reply with quote

Urlord wrote:
I am working on a Persistent Merchant system. Here is how it works:

- In the OnAcquire event, items are added to the master Items table. This is just to populate the databasee without having to type everything in (I'm lazy). I am storing ResRef (key), Name, MaxStackSize and GPValue in this table. I also have tables for "Stores", "Store_Purchase_List" and "Store_Inventory".

- When a store is first opened, it initializes by stocking the store with items from the Store_Inventory table, re-stocking quanties to a Minimum qty from the Store_Purchase_List table if needed. It is taking about 20-30 milli-seconds to stock a 100 item inventory but this only happens once per store.

- As things are bought, the Store_Inventory table is updated.

- When something is sold, it checks to see if the the store wants it by checking if the item is in the Store_Purchase_List table AND the store's Maximum qty for this item. This give me Item-Level control on what is bought and sold. If not, it returns the item to the PC and takes back the gold. If the store wants it, it updates the Store_inventoty table.

Since all the prices in my PW vary greatly from those in the base game, I have been creating copies of all the items and setting the gp values accordingly. This is required since currently, there is no way to adjust or set the GP value. From Gryphyn's post, it looks like I could make a new column in the Items table called PWValue and when the item is stocked into the store, apply PWValue-GPValue as an adjustment with the AdjustGoldPieceValueBy() function. If so, it would save a lot of work. I would love it if this function, or one like it could be developed. The sooner, the better Very Happy


Thanks a bunch!!!
Sorry for the Rambling.


Have a look at my Vendors system. It's an older copy, but this does what you mention above AND allows you to maintain ownership details as well. (stack details retained)

The idea is that you sell items for an upfront amount (20% GPV) then when someone buys the item you are 'allocated' an amount for the sale (70% GPV) and the Vendor takes a cut (10% GPV) *GoldPieceValue %'s are adjustable.

(Not sure if it's included in the linked version)
I have Bughers who will take an extra cut (5%) who collect your sales profits from ALL the Vendors. Nothing worse than returning to each Vendor to claim your take.

Oh, the Vendors can even Walk-Waypoints. Very Happy (trade-routes)

Junk dumping can be an issue - next version will resolve this with dynamic pricing (needs NWNX4 access to Object 'streams') and - TAXes/FEEs
--which is where we started. We need to be able to get to the data of an object to make this bit work.

I've also got a 'dynamic' Vendor Agent system - for crafters (You get a contract to supply x number of goods (examples saved in Agents inventory) when you complete the order you get your reward *adjustable variables. [No Database required]

These are a bit stale (NWN1 ilk) but do the job.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Sun Aug 19, 2007 2:13    Post subject: Reply with quote

I looked at it and used it for a while in one of my NWN1 PWs. It just isn't quite what I wanted for this PW. Do you have the system working currently for NWN2?
_________________
Jim (aka, Urlord)
Visit the Persistent World of Nymri
Back to top
View user's profile Send private message Send e-mail
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun Aug 19, 2007 4:42    Post subject: Reply with quote

Urlord wrote:
I looked at it and used it for a while in one of my NWN1 PWs. It just isn't quite what I wanted for this PW. Do you have the system working currently for NWN2?

Sorry, no.
Held up by lack of Object stream-support, and NWN2 not being PW friendly.
Contemplating a 'no-custom-item' version, where I only need the TAG, and create the objects as required. <no tracking of 'buffed/crafted' items>

It might not help you anyway. I'll be using CLR stored-procs in a SQLServer database to do the work. My NWScript will only be a collection of CALL's - nothing to see in the module.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group