Author Topic: PnP Coins for NWN1  (Read 1102 times)

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« on: May 07, 2011, 08:14:04 am »


               *Solved the problem*
               
               

               


                     Modifié par Mad.Hatter, 28 mai 2011 - 04:29 .
                     
                  


            

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #1 on: May 07, 2011, 09:05:38 pm »


               Let me preface my response by saying that I really do teach high school math...

The answer had nothing to do with complex float or percentage functions. I just had to divide nStack by the whole number gold:coin ratio rather than multiply by decimals. Gotta love simple solutions.

My only problem now is that the script still absorbs coin stacks that don't translate to whole gold pieces. For example, it takes 99 copper pieces, gives 0 NWN gold, and does not return them on store close. I suppose I just need to figure out where to put a conditional to make sure they don't get absorbed if they don't equal 1gp.

Oh, I also managed to get the coin base type working by adding the constant to zep_inc_main (saved an altered version in my test module) and including it in inc_coinage. I changed the coinbag from using BASE_ITEM_GEM to BASE_ITEM_COINS.

I am also toying with the encumbrance idea. It would take more work to add the OnAcquire and OnUnAcquire, but it may be worth it.
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #2 on: May 07, 2011, 09:33:17 pm »


               AS far as encumberance goes, the CEP coins do have some weight as is. You could just increase this in the Base Items 2da and slip it in your server's hak versions. Either replace whatever version is in your current top hak or put it in CEP 2's Custom hak and set that above the rest. Only builder's and the server would need the 2da changes, players wouldn't.
               
               

               


                     Modifié par kalbaern, 07 mai 2011 - 08:33 .
                     
                  


            

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #3 on: May 08, 2011, 02:22:49 am »


               Yeah, I checked that out this afternoon. It seems like I can use Tenthlbs to alter it. If I wanted to make a stack of 50 weigh 1 pound I suppose I would need to set tenthlbs to 0.2. A cursory glance at the 2da reveals that everything is either 0 or 1+ as a whole number. Does this field allow for fractions?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #4 on: May 08, 2011, 03:03:38 am »


               

Mad.Hatter wrote...

Yeah, I checked that out this afternoon. It seems like I can use Tenthlbs to alter it. If I wanted to make a stack of 50 weigh 1 pound I suppose I would need to set tenthlbs to 0.2. A cursory glance at the 2da reveals that everything is either 0 or 1+ as a whole number. Does this field allow for fractions?



No,  The entery is an integer so you can not use a float.   1 tenth of a pound is as low as you can go.

As to your stacks of coins getting destroyed without  having enough to make a whole stack, You will need to rewrite your functions to first loop through the inventory and count the coin,  Then destroy the coin after you know how many to destroy.  

With denominations of coins that are larger then 1gp you do not have to worrie aboit it, just create gold and destroy the coin in the first loop.  For the ones that are less I woud change the loop to just count them,  at the end of the loop I would use the TakeNumItems Function, from the nw_i0_plot include, to remove the coins then would give the PC the correct amout of gold.   
               
               

               
            

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #5 on: May 08, 2011, 08:10:27 am »


               Thanks for the suggestions and help LightfootB. I am a rather novice scripter so I have been muddling through by myself. I figured the integer issue on the 2da this afternoon. Sadness.

I'll check on the loop. Thanks. I was trying to add a conditional that would only convert from coin to NWN gold if nStack >= 100 for copper for example, but I didn't do it right.

I'll keep it up. I feel like I'm on the verge of a CEP independent coin system that is accurate.
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #6 on: May 10, 2011, 09:23:02 am »


               If you need some xtra info on encumberance I have a system that works with just the nwn gold, it auto adjust on aquire gold from ground or if its put in your invy by script, if you sell a item to shop. and if for some reason it doesn't adjust you can use a item that fixes.  I can post on the vault and post link here if you would like. its at least something you might be able to use with the cep. It requires no haks, and I belive other then hardcodeing, or runing a heart beat its the nicest way.
               
               

               
            

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #7 on: May 19, 2011, 09:54:36 am »


               Well, I worked all the problems out with the main coin function. I now essentially have a NWN1 version of PnP coins that is CEP compatible and only overrides one line on their baseitems.2da (I changed the coins to have 0.0 weight themselves and upped the stacking limit on the COINS base item).

Now my problem lies in the OnAcquire/OnUnAcquire encumbrance. I figure it's necessary to release a comprehensive package on the Vault. Do you all think it would be easier to add a new baseitem called something like "Weight" with TenthLBS = 10 and a high stacking limit (since I have a modified CEP baseitems anyway)? I added the entry but couldn't create the item in the toolset, sadly. I would then script it to count up the coins and give or take away weight items based on the quantity. Any help or suggestions on how best to do this would be greatly appreciated.
               
               

               
            

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #8 on: May 20, 2011, 03:35:57 pm »


               Fixed my own problem. When I added the line I left the name as ****, I just changed it to an existing string and found the duplicate entry in the item creation wizard. We will have PnP Coins for NWN1 in just a few days!
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #9 on: May 23, 2011, 09:56:04 pm »


               I look forward to the PnP coins I miss copper silver electrum platinum just doesn't feel like D&D I didn't see above, is there a No Hak(CEP) version?
               
               

               
            

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #10 on: May 23, 2011, 10:44:47 pm »


               http://nwvault.ign.c....Detail&id=8038
Non-CEP version coming soon.
               
               

               
            

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #11 on: May 24, 2011, 07:14:22 am »


               Non-CEP version is up. Faster than I expected. I also upgraded coins_inc.
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #12 on: May 24, 2011, 07:12:54 pm »


               I checked out the Non-cep version the module says its mising hak file pnpcoins_nocep, and the refrances you point to on platinum,gold,silver for the placeables are not there. ie appearance is iit_coin_46 for platinum but no placeable modle.  You may want to just copy all placeable models for the coins that you added with gem item hak. if not I managed to find you can replace appearances with iit_coin_32 =plat ,iit_coin_16=slvr, iit_coin_05=gold you had placeable models for those and that will cut down on hak size. so far no other issue except bad Strref thats due to no standard nwn ref to gem strref, moders can easly just put a discription.  And with the wieght item you made it also had bad strref wich again is just a default description.

WONDERFUL JOB

I'm truely intrested in a no hak version override version.  I glanced at your code it seems it doesn't realy require a hak file other then placeable models and appearances.  We can do the same thing with baseitem.2da adding weight and coin and stack size. well quickly off the top of my head.  I'm trying to offer as much as i can a module that uses no haks, just server side alteration.  Please let me know if you have any ideas that would help make a no hak version.

once again GREAT JOB I LOVE HAVING D&D COINS

Edit ADD:
I also had module crash several times if pc had to muchh gold over 500,000 when closing store.  I didn't have this issue with the no hack gem version but it allso did not use the cp/sp/ep/pp conversion I'm going to look into that when I have more time Real Life calls.  God Bless
               
               

               


                     Modifié par Greyfort, 24 mai 2011 - 07:30 .
                     
                  


            

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #13 on: May 24, 2011, 09:25:42 pm »


               Hmph. I must have messed something up during packaging. I apologize for the inconvenience and will look into it immediately. Thanks for bringing it to my attention.
               
               

               
            

Legacy_Mad.Hatter

  • Full Member
  • ***
  • Posts: 156
  • Karma: +0/-0
PnP Coins for NWN1
« Reply #14 on: May 24, 2011, 11:19:29 pm »


               I imported the non-CEP erf into the CEP module and vice-versa because I mislabeled them. Embarrassing mistake but not difficult to fix. It appears my CEP tlk also corrupted for some reason. Ill repost the corrected files shortly.

I also added yet another group of weight and coin variable modification conditions that now handle up to 100,000 coins and 1,000 pounds at a time. I don't recommend allowing your players to carry upwards of 1,000,000 coins anyway, but I added it for redundancy.