Games Support Forums BioWare Info My Account Login Community Sign Up Store
Neverwinter Nights 2 Forums

NWN2: Builders - NWN2 Scripting

New Topic    Post Reply


    Add this To My Topics

   Go To Bottom

Author Tracking gold?
Quilistan
Game Owner
Profile: QuilistanNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 29 Jul 2002
Posted: Tuesday, 03 November 2009 05:00AM
Is there a way to track the amount of gold a player has collected via increasing a variable?

Something similar to an "OnAcquireItem (gold)" script that each time a gold piece is gained it can then increase a variable on the PC?

So far my brain hasn't found a way, was wondering if any of you had an idea?
_________________
http://www.balarand.info Balarand: Frontiers of the Horde Lands
A PW set in a custom world, continued from our NWN1 server. Location: PW Action
  Profile: Quilistan   Send Message To: Quilistan
Lugaid of the Red Stripes
Game Owner
Profile: Lugaid of the Red StripesNWN 2


Joined: 14 Aug 2008
Posted: Tuesday, 03 November 2009 05:55AM
A crude way would be to do something on the module heartbeat. You would have two variables, one called 'iCurrentGP' and 'iNetGPGain'. Every heartbeat, the script compares the PC's gold to iCurrentGP. If PC gold is greater, the difference is added to iNetGPGain. Then iCurrentGP is reset to the PC's current GP level.

The player could get around it by using a store while paused, selling some items and using the money to buy other items before the heartbeat can count it.

Either that, or you get every source of GP in your mod to start issuing W2's.
_________________
The Last of the Danaan - SP Mod
Click Here
  Profile: Lugaid of the Red Stripes   Send Message To: Lugaid of the Red Stripes
Quilistan
Game Owner
Profile: QuilistanNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 29 Jul 2002
Posted: Tuesday, 03 November 2009 06:20AM
Quote: Posted 11/03/09 05:55 (GMT) by Lugaid of the Red Stripes
Either that, or you get every source of GP in your mod to start issuing W2's.

lol


The pausing wouldn't be an issue as this is for a PW, so players can't pause.

The next question is how resource expensive would this be?

I know I could do some sort of psuedo-heartbeat also to lessen the load. Would something like this be a problem though?
_________________
http://www.balarand.info Balarand: Frontiers of the Horde Lands
A PW set in a custom world, continued from our NWN1 server. Location: PW Action
  Profile: Quilistan   Send Message To: Quilistan
Lugaid of the Red Stripes
Game Owner
Profile: Lugaid of the Red StripesNWN 2


Joined: 14 Aug 2008
Posted: Tuesday, 03 November 2009 06:54AM
I don't know about PW's, it'll probably depend on the number of players you expect to have, and how you manage to keep track of the variables as players leave and join.

Generally, scripts, including heartbeats, don't really affect performance unless they start cycling through hundreds of different permutations, like a hundred creature heartbeats that each look at the hundred other creatures in the area. Compared with what it takes to rotate, shade, and texture a single polygon, scripts are pretty lightweight.
_________________
The Last of the Danaan - SP Mod
Click Here
  Profile: Lugaid of the Red Stripes   Send Message To: Lugaid of the Red Stripes
Quilistan
Game Owner
Profile: QuilistanNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 29 Jul 2002
Posted: Tuesday, 03 November 2009 05:39PM
Thanks a bunch for the info.
_________________
http://www.balarand.info Balarand: Frontiers of the Horde Lands
A PW set in a custom world, continued from our NWN1 server. Location: PW Action
  Profile: Quilistan   Send Message To: Quilistan

New Topic    Post Reply

What do these icons mean?
Where can I learn how to use the forums?

Jump To:

Search Forums | Forums FAQ | Forum Archives

 

 

  Visit the Official Site | Technical Support
Neverwinter Nights 2 Official Support
Hide/Show

English
Deutsch
Français
Español
Italiano

Hide/Show

5,052,741 Users
198 Online
41 Logged In

8,768,829 posts in forums

Newest Forum Topics:
1. Trying to unlock The Edge (BioWare Online Store Support)

2. Transfering Shepard's appearance (Mass Effect 2 General Discussion (No Spoilers Allowed))

3. Jade Empire's History (Jade Empire Xbox General Discussion (Spoilers Will Be Moved))

4. can't change language (Web Site Help)

5. which script launches the crafti... (NWN 1: Scripting)


Current time is: (set time)
Sun, 22 November 2009 09:42AM