|
|
Home Forum Index Neverwinter Nights 2 NWN2: Builders - NWN2 Scripting Tracking gold?
NWN2: Builders - NWN2 Scripting
Quilistan
Game Owner
NWN 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 |
|
Lugaid of the Red Stripes
Game Owner
NWN 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 |
|
Quilistan
Game Owner
NWN 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 |
|
Lugaid of the Red Stripes
Game Owner
NWN 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 |
|
Quilistan
Game Owner
NWN 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 |
|
|
Search Forums |
Forums FAQ |
Forum Archives
|
NeverWinter Nights 2, Forgotten Realms and the Forgotten Realms logo, Dungeons & Dragons, D&D, and the Dungeons & Dragons logo, and Wizards of the Coast and its logo are trademarks of Wizards of the Coast, Inc., in the U.S.A. and other countries, and are used with permission. © 2004 Wizards. Software © 2004 Atari Interactive, Inc. All rights reserved. HASBRO and its logo are trademarks of Hasbro and are used with permission. Windows is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries. Manufactured and marketed by Atari, Inc., New York, NY. All other trademarks are the property of their respective owners.
Powered by BioBoards Version 3.00.0 10.1.12.21
Web Site Help
Jobs | Website Terms of Use Agreement | Privacy Policy
Rules of Conduct | Copyright and Trademark Information
|
|