Trade moding question

Started by Teneombre, October 08, 2017, 11:02:20 AM

Previous topic - Next topic

Teneombre

Hi everyone :)

I started moding rimworld since the a17 now and if I still don't touch any .dll, I'm quit used to .xml (creating object/recipe etc).
I'm currently trying to modify the way arts are show in the trade HUD. they are currently display one by one, in a really long list in my case. I want to make them act like body part, guns, cloth and other thing that are not stackable ingame but are stacked in trader HUD. I was try to use the <tradeability>Stockable</tradeability> but that won't work.

So my question are :
- how to stack arts in trader HUD ?
- What the "stockable" entry for tradeability is used too ? (didn't found any entry in the Core files)

Thansk everyone for reading it, I hope some of you have the answers I need.

PS : I'm pretty sure it's obvious but English is not my main language. I hope though his topic is still readable.

Distman

I don't see how that would work since every artwork is of different quality/market value...

I think stockable is basically "Can traders stock/sell this item?".

Quote from: Teneombre on October 08, 2017, 11:02:20 AM
Hi everyone :)

I started moding rimworld since the a17 now and if I still don't touch any .dll, I'm quit used to .xml (creating object/recipe etc).
I'm currently trying to modify the way arts are show in the trade HUD. they are currently display one by one, in a really long list in my case. I want to make them act like body part, guns, cloth and other thing that are not stackable ingame but are stacked in trader HUD. I was try to use the <tradeability>Stockable</tradeability> but that won't work.

So my question are :
- how to stack arts in trader HUD ?
- What the "stockable" entry for tradeability is used too ? (didn't found any entry in the Core files)

Thansk everyone for reading it, I hope some of you have the answers I need.

PS : I'm pretty sure it's obvious but English is not my main language. I hope though his topic is still readable.

Albion

Hey, where did you run into the <tradeability>Stockable</tradeability> parameter? I can't remember ever consciously reading it.

Anyway, regarding the stackability: I'm not exactly sure on this but it might be due to the fact that art is technically a minified building not a normal thing like body parts etc. You'll run into the same problem with multiple telescopes/TVs.
Somewhere minified furniture is defined but I can't remember where and couldn't find it again on the fly.
Maybe the answer is somewhere over there...

I guess it would be a nice quality of life feature to have stacked art but most art has different quality levels anyway and will therefore be somewhat unstacked like different qualities of weapons and clothing.

CannibarRechter

Tradeability.cs:


using System;

namespace Verse
{
public enum Tradeability : byte
{
Never,
Sellable,
Stockable
}
}
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

Wishmaster

I think the method you want to modify is RimWorld.Dialog_Trade.FillMainRect(). It draws the list of tradeables items in the trade dialog.

Teneombre

Hi everyone and thanks for all the answers.
I found the Stockable parameter when looking of the different arguments you can use in def file on the wiki. I was wondering at an error but it works ingame, even if I don't know what it does.
@Albion, thanks for your answer. I don't want to stack them in my storage, I don't really care, but I build a lot of them (so I have like 5-10 times the same quality/material art,) to trade and it's can be messy on the window. You're answer remember me a mod that have "minified building" and stack on the trade HUD. I will look at it. Thanks a lot !
If your are right @Wishmaster, and I guess you are since I took a lot of time to search in .xml file, I'm screwed TT I just look in the assemblies of a mod creating preset storage (I wanna create one by myself for my last mod) and it was... way out of my skill ^^