lately I wanted to sell 25 damaged plasma torches (pours a tear for the torched ferians ) to a tinker.
According to code the tinker has 15k crds.
I didnt sell them anything, I rather gave them money to repair armor.
The tinker offered to buy 3 torches.
3600 crds per torch * 3 = 10800
but 3600 * 4 = 14400 ...
the curiosity does not stop here
After I sold them 3 torches, I dropped 21 torches.
Now the tinker offered 1800 for this torch. ?_?
I took another torch and redocked. 1800 crds for only one torch. ok
I took up about 10 torches.
"Tinker offers 3600crds for only one torch." O_o
Took all the torches up again.
"Tinker cant afford to buy any torch." wtf ?
For some other items I sold one by one the price did not drop.
The station suddenly said that they dont accept any more.
I looked in the code before and thought the price should drop first.
strange bug with station money
I can't explain why he didn't offer to buy four in the first place, but I think I do know why he offered less when you dropped them.
From what I understand of the new pricing system, a station doesn't just lower their price based on their stock, but also how many of the items are in the system, available for looting. By dropping those torches, you increased the number in the system, and so decreased your price. I have no idea why he bought another one once you picked them up, though.
The new system needs a bit of tweaking. Specifically, if you're going to look at system abundance, you also need to take into account how many of the items the player has on them at any given time. That will also eliminate the "sell all at once for a better price" exploit. Additionally, stations need to accept more before they are no longer interested in the item- even if the price starts to diminish at an increased rate as they have more and more of an item.
From what I understand of the new pricing system, a station doesn't just lower their price based on their stock, but also how many of the items are in the system, available for looting. By dropping those torches, you increased the number in the system, and so decreased your price. I have no idea why he bought another one once you picked them up, though.
The new system needs a bit of tweaking. Specifically, if you're going to look at system abundance, you also need to take into account how many of the items the player has on them at any given time. That will also eliminate the "sell all at once for a better price" exploit. Additionally, stations need to accept more before they are no longer interested in the item- even if the price starts to diminish at an increased rate as they have more and more of an item.
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
What? Where did you get that idea from?
Pretty much all the selling is handled by the dockscreen called dsExchangeSell, including the Tinkers. Where in the code do you see any counting of the items in the system?
Here is a snip covering the portion of the code where the price is adjusted:
Notice that there is no check for the amount of items in the system available to loot.
There is no check for any stored values for trade on the station, nor the system.
It also doesn't check or care how many the player has in hand.
The only deciding factor for price for any common station using this screen (including the Tinkers) is computed entirely in:
Pretty much all the selling is handled by the dockscreen called dsExchangeSell, including the Tinkers. Where in the code do you see any counting of the items in the system?
Here is a snip covering the portion of the code where the price is adjusted:
Code: Select all
; If the station already has lots of these, lower the price
(setq existingCount (objHasItem gSource thisItem))
(setq averageCount (itmGetAverageAppearing thisItem))
(switch
(not existingCount)
Nil
(geq existingCount (multiply averageCount 5))
(setq gCost 0)
(geq existingCount (multiply averageCount 4))
(setq gCost (divide (multiply gCost 25) 100))
(geq existingCount (multiply averageCount 3))
(setq gCost (divide (multiply gCost 50) 100))
(geq existingCount (multiply averageCount 2))
(setq gCost (divide (multiply gCost 75) 100))
)
; Compute how many items are available
(setq availCount (itmGetCount thisItem))
; Compute how many items the station is willing to buy
(if (gr gCost 0)
(switch
(not gMargin)
(block Nil
(setq affordCount (divide (objGetBalance gSource) gCost))
(if (gr affordCount availCount)
(setq affordCount availCount)
)
)
(gr gCost gMaxPrice)
(setq affordCount 0)
(setq affordCount availCount)
)
)
(setq gMaxCount affordCount)
; Set the price and description
(setq priceText (cat "Unit offer: " (if (eq gCost 0) "N/A" gCost)))
(if (gr availCount 1)
(setq priceText (cat priceText " (" availCount " for " (multiply gCost availCount) ")"))
)
(setq priceText (cat priceText "\nUnit mass: " (intMassString (itmGetMass thisItem))))
(if (gr availCount 1)
(setq priceText (cat priceText " (" availCount " at " (intMassString (multiply (itmGetMass thisItem) availCount)) ")"))
)
(setq priceText (cat priceText "\n\n"))
(switch
(eq gCost 0)
(setq desc (cat gTitle " is not interested in buying " (itmGetName thisItem 0x02) "."))
(eq affordCount 0)
(setq desc (cat gTitle " cannot afford to buy " (itmGetName thisItem 0x04) "."))
(eq availCount 1)
(setq desc (cat priceText gTitle " offers " gCost " credits for your " (itmGetName thisItem 0) "."))
(eq affordCount 1)
(setq desc (cat priceText gTitle " offers " gCost " credits for a single " (itmGetName thisItem 0) "."))
(ls affordCount availCount)
(setq desc (cat priceText gTitle " offers " gCost " credits for each " (itmGetName thisItem 0) " (up to a maximum of " affordCount ")."))
(setq desc (cat priceText gTitle " offers " gCost " credits for each " (itmGetName thisItem 0) "."))
)
There is no check for any stored values for trade on the station, nor the system.
It also doesn't check or care how many the player has in hand.
The only deciding factor for price for any common station using this screen (including the Tinkers) is computed entirely in:
Code: Select all
; If the station already has lots of these, lower the price
(setq existingCount (objHasItem gSource thisItem))
(setq averageCount (itmGetAverageAppearing thisItem))
(switch
(not existingCount)
Nil
(geq existingCount (multiply averageCount 5))
(setq gCost 0)
(geq existingCount (multiply averageCount 4))
(setq gCost (divide (multiply gCost 25) 100))
(geq existingCount (multiply averageCount 3))
(setq gCost (divide (multiply gCost 50) 100))
(geq existingCount (multiply averageCount 2))
(setq gCost (divide (multiply gCost 75) 100))
)
I got a clue about why the tinker could only buy 3 torches.
The credit regrow cant go over the max amount, so it stops at 13751 if the regrow is 1250 and the max is 15000.
I'm not sure why the tinker offered more when I had more in cargohold, but I'm sure it's not related to the amout that is in space around.
I sold them 8 torches (for 3600), then for 9 in my hold they offered 3600 again, nothing for less than 9.
Same thing for 12 torches.
...???
The credit regrow cant go over the max amount, so it stops at 13751 if the regrow is 1250 and the max is 15000.
I'm not sure why the tinker offered more when I had more in cargohold, but I'm sure it's not related to the amout that is in space around.
I sold them 8 torches (for 3600), then for 9 in my hold they offered 3600 again, nothing for less than 9.
Same thing for 12 torches.
...???
Last edited by Sheltem on Wed Aug 13, 2008 1:58 am, edited 2 times in total.
regards
Sheltem
What do you think about the endless stream of spawns ?
What about modding wandering spawns which dont attack the player directly ?
Sheltem
What do you think about the endless stream of spawns ?
What about modding wandering spawns which dont attack the player directly ?
- Periculi
- Fleet Officer
- Posts: 1282
- Joined: Sat Oct 13, 2007 7:48 pm
- Location: Necroposting in a forum near you
Plasma Torch base value is 18000.
Plasma Torch, like many weapons doesn't have a number appearing value.
itmGetAverageAppearing for that item returns 1. (It was returning nil in the debug console for some reason.)
It seemed to be returning nil, so I thought that was throwing the calculation off, but maybe there is some buggy action in there.
Seems like it should have cut you off at around 5 torches and stopped offering to buy them at all.
Plasma Torch, like many weapons doesn't have a number appearing value.
itmGetAverageAppearing for that item returns 1. (It was returning nil in the debug console for some reason.)
It seemed to be returning nil, so I thought that was throwing the calculation off, but maybe there is some buggy action in there.
Seems like it should have cut you off at around 5 torches and stopped offering to buy them at all.