Author Topic: Cargo + Economy = wtf...  (Read 559 times)


  • Distracted
  • ***
  • Posts: 216
  • Karma: +17/-1
    • View Profile
Cargo + Economy = wtf...
« on: November 12, 2010, 08:51:31 AM »
Alright I'm apparently totally lost on what the game is doing here.

In the wiki for state.inCargo it says:
Amount of this state stored in general storage. Needs to be sync'd with the containing object's cargo levels

so... first off what exactly needs to be sync'd and how do I do that? I thought this function gets the objects cargo levels so I need to sync it to itself?

And state.val says it's the value of the state. Which means what? It's the current amount of that resource? If so what is inCargo for?

So yeah, I'm now totally lost on this. I thought you used inCargo to get whats in the cargo bay and val to get what appears on under the Economy tab of a ship. But apparently I'm wrong. inCargo does get the value of cargo onboard, but it doesn't seem to have any relavence on the Economy portion which it seems all the other scripts go by.

And When using consume and add, they never consume or add they never change the exact amount specified, the amount is always off. Which I assume is floating point errors again. and they never change the economy and cargo values the same amounts... So even if I knew the proper cargo handling structure, I'm not sure I could manage it in any detail, as the game just seems to do what it wants anyway.
My Mods:
Auto Resource Transfering Subsystems (Fuel, Power, Ammo):
Advanced spiral universe generation:
Currently working on: Adv Spiral Universe Map