Looks like there's something in SWv4.2.5 that broke something - let me see what I can find
Printable View
Looks like there's something in SWv4.2.5 that broke something - let me see what I can find
I searched through the thread and oddly didn't find anything, but is there any way to get the inventory screen markup percentages to round numbers? I tried to sell a suit of armor for 420 gp and then it ended up being 381.8181818181818 gp or something on the characters inventory. Selling it back left him with 789.6364646464 gp, which is of course unusable. Not asking it to automatically figure out change, just put 382 instead of 381.8181818.
That rounding error is one that I've been struggling with. The problem is with the precision that the lua scripting code uses for all its mathematical operations (ie its inbuilt to the engine0. The question in automatically having a rounding function is "round it to what?" Sure, we could round to the nearest 0.01 for decimal systems, but if you're using 240 pennies to the pound, or even 20 silver to the gold or 5 gold to the platinum - well, they've all got different rounding values.
So I'm still trying to work out how to go about it - and yes, it is tied up with figuring out change :)
So, for the moment, round it manually (and I'd round it in the favor of the shopkeeper, obviously) - I'll try to get something sorted to do it automatically (when I figure out what needs to be done exactly).
Sounds like a plan! Pretty cool so far. Thanks!
What about just truncating? I know it's not perfect, but unlike today's world, would have they really been doing something like, "I'll give you 30% of list price, so that 281 gold, 4 silver and 3 copper."
Now, in a non-fantasy setting... my logic is bogus, but....
Maybe an option for number of decimal places? Or, how about you just write a sub-routine to read the GMs mind?
There's a quote I;ve heard a lot lately (must be some TV commercial), but it goes back to my early days of engineering "Perfect is the enemy of good enough."
Yeah, but what do I use as the "rounding factor" - that was the point of mentioning the different currencies in my previous post.
And as far as reading the GM's mind... My God, Mr Bigglesworth, they're on to us! Quick! To the secret volcano lair! Curse you, Lord E, I'll get you next time!
You're right that their is no good rounding factor, or even number of decimal places. That's why I would take a cheaters way out and just truncate the numbers (drop all decimal places).
p.s. have you notices I put Nair in Mr. Bigglesworth's shampoo?
Oh, I see you have...
https://animalia-life.com/data_image...phynx-cat1.jpg