Modifié par Mad.Hatter, 28 mai 2011 - 04:29 .
PnP Coins for NWN1
Débuté par
Mad.Hatter
, mai 07 2011 07:14
#1
Posté 07 mai 2011 - 07:14
*Solved the problem*
#2
Posté 07 mai 2011 - 08:05
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.
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.
#3
Posté 07 mai 2011 - 08:33
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 .
#4
Posté 08 mai 2011 - 01:22
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?
#5
Posté 08 mai 2011 - 02:03
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.
#6
Posté 08 mai 2011 - 07:10
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.
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.
#7
Posté 10 mai 2011 - 08:23
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.
#8
Posté 19 mai 2011 - 08:54
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.
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.
#9
Posté 20 mai 2011 - 02:35
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!
#10
Posté 23 mai 2011 - 08:56
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?
#11
Posté 23 mai 2011 - 09:44
#12
Posté 24 mai 2011 - 06:14
Non-CEP version is up. Faster than I expected. I also upgraded coins_inc.
#13
Posté 24 mai 2011 - 06:12
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
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 .
#14
Posté 24 mai 2011 - 08:25
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.
#15
Posté 24 mai 2011 - 10:19
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.
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.
#16
Posté 24 mai 2011 - 11:05
Redownloaded CEP and corrected the mixed erf issue. It should work correctly this time. Let me know if you have any issues.
#17
Posté 25 mai 2011 - 03:53
Awesome, would be nice to have this with encumberance system.
#18
Posté 25 mai 2011 - 04:03
If you put coins_acqu and coins_unacqu in the appropriate module events (or merge them with your own) then every time you pick up 50 coins you get a 1lb item created on you as per the 3rd Edition PHB; when you drop them, these items are removed. Check out the demonstration module, I have encumbrance enabled.
#19
Posté 25 mai 2011 - 03:37
Thank you for response and foresight. Excellent.
#20
Posté 26 mai 2011 - 12:03
I made a simple reward system for giving players coins i will post link to vault when testing done
#21
Posté 26 mai 2011 - 01:49
Here is the scoop on the trouble shoot....
1) coin models missing for what you have set in tool set. iit_*_#
pp #46 missing replaced with #51, gp #58 missing replaced with #05,
ep #51 was replaced with #32,sp #33 missing replaced with #16,
cp #58. That will fix the missing model issue and they look good in your inventory.
2)Issue making change, picked up some extra coin from loot generator[see below] talked to merchant said i had 93973gp closed shop lost all coin over 50k stack, resulting in net loss of 41 gp. There seems to be a issue in making change. I looked at the original that used no haks and although theirs’ does not work like pp,ep, scale it makes change right and has no issue with amount of coins, it will even spill out of invy onto floor sue to 10stack size on platinum. Probably just minor math error.
3) if weight at 5126 thats 1 50k stack of each coin you cant pick up any more coins server freezes
I ask because with nwnx_funcs or linux_funcs PC chars can have abilities that allow for weight exceeding that I think the encumbrance 2da needs to be flushed out I think I have one from shadow. I placed it in my override and still got error
Well thats all I found, still if you keep the coin under 500k and stacks under 50k no issues.
although with the nwnx_funcs it makes a Player quite strong and with gear at max or custom made with the asbury forge a Items value is sometimes in the 10s of millions and the no hack version converts the millions over fine and with the base item 2da over ride I can set those stacks to 50k max
[I can send you module/erf, I have been working on for custom loot if you want to include with your coin system to help others get started at least]
1) coin models missing for what you have set in tool set. iit_*_#
pp #46 missing replaced with #51, gp #58 missing replaced with #05,
ep #51 was replaced with #32,sp #33 missing replaced with #16,
cp #58. That will fix the missing model issue and they look good in your inventory.
2)Issue making change, picked up some extra coin from loot generator[see below] talked to merchant said i had 93973gp closed shop lost all coin over 50k stack, resulting in net loss of 41 gp. There seems to be a issue in making change. I looked at the original that used no haks and although theirs’ does not work like pp,ep, scale it makes change right and has no issue with amount of coins, it will even spill out of invy onto floor sue to 10stack size on platinum. Probably just minor math error.
3) if weight at 5126 thats 1 50k stack of each coin you cant pick up any more coins server freezes
I ask because with nwnx_funcs or linux_funcs PC chars can have abilities that allow for weight exceeding that I think the encumbrance 2da needs to be flushed out I think I have one from shadow. I placed it in my override and still got error
Well thats all I found, still if you keep the coin under 500k and stacks under 50k no issues.
although with the nwnx_funcs it makes a Player quite strong and with gear at max or custom made with the asbury forge a Items value is sometimes in the 10s of millions and the no hack version converts the millions over fine and with the base item 2da over ride I can set those stacks to 50k max
[I can send you module/erf, I have been working on for custom loot if you want to include with your coin system to help others get started at least]
#22
Posté 26 mai 2011 - 07:15
Thanks for the testing and reply:
(1) The five models you mention are the original CRAP/CEP ones. I included the other icons to give builders options (especially if adding multiple types of currency to their modules). I suppose I could go change the assigned models.
(2) I don't follow. Are you saying that only the CEP version has issues making change and then only if the change being created is in excess of 50,000 coins? What do you mean by "theirs’ does not work like pp,ep" in reference to the NON-CEP version? Could you clarify for me? I'm gettin' old!
(3) I just barely tested this. You seem to be right. I'm not sure exactly what causes this freeze. I tried adding additional weight generation conditionals but it didn't seem to work. It seems that caching the coins_inc and the added conditionals did delay the freeze by a bit. I'll keep digging around.
It may just be that my system as written isn't near capable of handling modules where many hundreds of thousands of coins are processed by an individual player.
I'd like to see the custom loot script. I've been looking at CRAP/Accerak's and would like to see what you've conjured up.
(1) The five models you mention are the original CRAP/CEP ones. I included the other icons to give builders options (especially if adding multiple types of currency to their modules). I suppose I could go change the assigned models.
(2) I don't follow. Are you saying that only the CEP version has issues making change and then only if the change being created is in excess of 50,000 coins? What do you mean by "theirs’ does not work like pp,ep" in reference to the NON-CEP version? Could you clarify for me? I'm gettin' old!
(3) I just barely tested this. You seem to be right. I'm not sure exactly what causes this freeze. I tried adding additional weight generation conditionals but it didn't seem to work. It seems that caching the coins_inc and the added conditionals did delay the freeze by a bit. I'll keep digging around.
It may just be that my system as written isn't near capable of handling modules where many hundreds of thousands of coins are processed by an individual player.
I'd like to see the custom loot script. I've been looking at CRAP/Accerak's and would like to see what you've conjured up.
#23
Posté 26 mai 2011 - 09:06
So, I have figured out how to get rid of the locking up due to bajillions of coins. There were just too many calculations going on. I now just need to figure out how to effectively recalculate weight. I'll figure it out, promise.
*Edit* As a side note, the system still works perfectly well for PCs who will not be carrying around more than 250,000 coins at a time (besides this purported change issue that I haven't been able to reproduce... not NWN gold, custom coinage). For the vast majority of RP modules this will never be an issue.
*Edit* As a side note, the system still works perfectly well for PCs who will not be carrying around more than 250,000 coins at a time (besides this purported change issue that I haven't been able to reproduce... not NWN gold, custom coinage). For the vast majority of RP modules this will never be an issue.
Modifié par Mad.Hatter, 26 mai 2011 - 09:09 .
#24
Posté 26 mai 2011 - 07:18
I found the change creation problem you were talking about, Greyfort. The problem is that CreateItemOnObject wont create multiple stacks of items (as that would be Object*s* rather than Object). I solved it simply by adding:
Now I'll look into the weight locking issue. Thanks for your testing thusfar.
else if(iCoin* >= 50000)
{ CreateItemOnObject("coin_"+sType+"5", oTarget, iCoin*);
nCoinTotal = nCoinTotal - 50000;
iCoin* = iCoin* - 50000;
}Now I'll look into the weight locking issue. Thanks for your testing thusfar.
#25
Posté 27 mai 2011 - 04:19
v1.3 is in the works (yes, I do quick updates. Thanks me for being a teacher and this being summer...).
1.3 simplifies the weight code by a ton. It is faster at low coin counts and can now handle tons of coins without slowing. (I tested 1,880,000 NWN gold worth today with only 1 stack of platinum) I will also clean up the erfs and demonstration mods (somehow despite my double-triple checking the wrong weight item got in there).
Finally, if I have time I will start to work on the loot system so that this can be used out of the box in any module using default loot systems.
(In other words, I have fixed both the coding issues that Greyfort brought to our attention.)
1.3 simplifies the weight code by a ton. It is faster at low coin counts and can now handle tons of coins without slowing. (I tested 1,880,000 NWN gold worth today with only 1 stack of platinum) I will also clean up the erfs and demonstration mods (somehow despite my double-triple checking the wrong weight item got in there).
Finally, if I have time I will start to work on the loot system so that this can be used out of the box in any module using default loot systems.
(In other words, I have fixed both the coding issues that Greyfort brought to our attention.)
Modifié par Mad.Hatter, 27 mai 2011 - 04:20 .





Retour en haut






