[Mod Request] Quantum Entangled Storage

Started by DoctorFowl, October 28, 2017, 09:46:55 AM

Previous topic - Next topic

Kiame

Yeah i am trying out having the storage drop what a pawn needs to haul. As for trading that's hard. I finally figured out how to get trading to work w/ change dresser but only for orbital traders so far - basically drop/spawn everything when the trade window opens then collect everything that wasnt sold when the window closes

DoctorFowl

I am no modder, thus, I might be terrible wrong and misinformed.

Can't we just make it so that two stockpiles mirror each other?

Hahaha, sorry if I oversimplified things.

Kiame

#17
Nope, it would make sense in real life  :P

The main problem is items cannot be duplicated and pawns don't care about stockpiles but rather the items themselves. So if a pawn needs a piece of apparel or a stack of logs they do not ask stockpiles if there is that item in the stockpile. Instead pawns search the map for the item they are looking for and go to that item.

As is the case of my idea where items are despawned and stored in a shared location which each crate would have access to, the pawn logic needs to be modified to search for nearby crates and ask the crate if it has the item it is looking for. (if this makes sense)

DoctorFowl

Wouldn't it be possible to make it so that the furniture duplicated the item on a given stockpile and any alteration on it affect the stockpile aswel?

Kiame

#19
No. The game logic relies on the fact that there is only one copy of any and all items. For multiple items of the same type they are still distinct as each item has a unique id.

If two identical items exist. Say hello to errors when saving and loading  ;)

Not sure what would happen in the case of two identical wood stacks where one is used... Maybe nothing and the identical copy would get removed but there's the cases of what if a pawn were hauling that second stack or the second stack gets put back in storage...

DoctorFowl

Wait, so each of my 25k corn has a unique ID!? Or I am getting somehting wrong?

Kiame

#21
Quote from: DoctorFowl on November 01, 2017, 01:44:05 PM
Wait, so each of my 25k corn has a unique ID!? Or I am getting somehting wrong?

In the case of stacked items the stack has a unique id and that stack object has the number of items in the stack - in the case of 25k corn divided into stacks of 75 is roughly 334 unique id's. When a stack is divided the new sub-stack gets a new id.

The id is an 8 byte (64bit) long value that each item has. So as long as a single game doesn't last long enough to have 18,446,744,073,709,551,615 (2^64 - 1) unique items you won't have a problem. (you'll never reach this limit  ;) )

DoctorFowl

Thankfully, I use Stack XXL, so in this case there is an even longer life! Pheww~
Hahahaha