Jump to content

Recommended Posts

Hello everyone!

I'm trying to port a DS mod to DST, figured out how to solve a lot of different problems, but a lot more remain, and I don't know exactly how I should treat them.

The mod's called Craft Pot, and what it does is basically

I. Find all crock pot prefabs
  1. Iterate all prefabs ingame (AddPrefabPostInitAny)
  2. Find those that have stewer component
II. Adding custom crock pot event handlers
  3. Save the following original events: open, close, give item, take item, finish cooking
  4. Change binded handlers for those events to custom ones (injecting modded code) + calling the original ones as the first line
III. Processing current inventory content
  5. Track down crock pot inventory content
  6. Pass it down to mod components
  7. Redrawing the crock pot food scroll

 

And now the yet unsolved issues, that I could really use some help or a direction with:

I. CrockPots only have stewer and container components on the mastersim side, so I've lost a way to track down crock pots on a client
II. Even if i somehow managed to get crockpot prefabs, I don't see a way I could modify container/stewer components (locally) in order to pass custom event handlers (as they simply do not exist??) on the client.
III. Client is drawing container, all of the local icons, does that mean there should be some sort of a dirty replica for container on a client somwhere?

I'm a decent programmer, just point me in the right direction, or onto some other client mod that could help me find a solution to those problems. The way I see it, if it comes to the worst, I would have to rewrite crock pot prefabs adding dirty stewer, dirty container, and somehow sync raw data with the 'real' stewer/container on the server. Hope it doesn't go that far thou.

Edited by IvanX

Managed to solve all the problems. container_replica provides original inst reference that has give item/take item. As for the 'finish cooking' event of the stewer, Guess it's inaccessible in anyway, at least I couldn't find how exactly stewer callback fires from server to the client. So I had to change it to button click on the container_replica.

Now the new problem is:

Error: Failed sharing mod data file.

And I guess there's no way to solve that other than waiting for DST workshop to work again.

Edited by IvanX

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...