News:

Welcome to World of Banished!

Main Menu

More Building Requirements

Started by Tom Sawyer, April 11, 2017, 06:04:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tom Sawyer

I want to start a discussion separate from the other thread to (maybe) solve this issue of more building requirements. As you can see in the picture I was able to build a house with 5 materials, just for example. The game can already handle it. But to make it work I had to disable the BuildRequirementUI in the ToolTipToolbar.rsc and CreateBar.rsc. At these points the game crashes if more then 3 materials are defined. Of course it's not a solution because without this controller the Tooltip does not show the right content.

So what we know is that the problem is the object type "BuildRequirementUI" which controls the UI elements and crashes with more than 3 items. I think it can be easily fixed by Luke. Or we find a way to make the ToolTip work without crash. My trials to add elements there to show more materials failed. But I could live without showing the fourth or fifth material there.

It would be great to have this option of more requirements, also for CC @kralyerg and DSSV @Discrepancy where gears and baskets are included as new requirements as well as for many other mods @RedKetchup, @kid1293 and @Necora. Maybe we find a solution together. :)

kid1293

#1
Looks very promising!

Don't forget a third file 'ToolTipUpgrade.rsc'
Maybe you must change all three?

Are you sure the extra resources get collected and used as they should?
No problem with the finished building? edit - when destroyed -do you get all rsources?
Just that tooltip?

kralyerg

A long time ago, a modder named OwlChemist did a similar thing and ran into the same problems. I never looked into it much at the time, but it might be worth another look.

Can you share exactly what you did so we can all start from the same point? Or was it literally just commenting out a single line in the files you mentioned? (I'm on mobile so I can't actually look at my files at the moment.)


Tom Sawyer

Yes, it's just commenting out the BuildRequirementUI in ToolTipToolbar.rsc and CreateBar.rsc to avoid crashes. The ToolTipUpgrade is affected too. Thanks @kid1293.

Dialog resource
{
ElementDescription _rootElement = "main";

int _drawLevel = 2;

ElementController _controllers
[
{ ObjectType _type = HotKeyToolTipUI; }
//{ ObjectType _type = BuildRequirementUI; }
]
}



And I made a Build6.rsc with extended storage table referenced by the red cottage BuildUI (to keep the vanilla Build.rsc with3 slots):

RibbonDescription storageTable
{
int _cellPad = 7;

ElementDescription _elements
[
"clearItem"
"storageItem"
"storageItem"
"storageItem"
"storageItem"
"storageItem" //new
"storageItem" //new
]
}


It really works in game. They need the materials and carry it to the building site. You also get back some of them after demolishing. All is fine, only the ToolTip not. I tried to extend it by adding a "build3" item and so on but the game does not use it. Instead of this it crashes. It seems it tries to do something with the materials and fails. If it would just ignore the additional resources in the tool tip then it would work. Of course to show all mats on mouse over would be perfect. 5 resources would fit in this box and it also can be made wider. This is as far as I got.

Turis

Why don't you try adding another step in the production chain where you combine some of those materials to produce something generic like construction materials?

Tom Sawyer

#5
That would of course work technically @Turis and I know it from CC but in game it is just a workaround and somehow artificial. How to combine bricks, tiles and window panes or a paint and some iron or gold or DS baskets and gears in a suitable way and how to name such new resources? Building pack x and y or building supply 1 - 3. I don't know. To just carry it to the building site and to see it there would be much more elegant. Especially because it already works and just needs a fix of the tool tip.

embx61

Great find @Tom Sawyer

Indeed promising and my guess is that Luke should be able to do something in his code to make the tool tips work without that much a hassle.
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

Necora

I don't know much about this sort of thing, it is way beyond my knowledge of modding. But I was looking through the dialog files and the CreateBar.rsc has many instances of 'build0', 'build1', and 'build2'. Did you try adding a 'build3' and 'build4' for each time the others are mentioned?

RedKetchup

Quote from: Tom Sawyer on April 11, 2017, 09:46:44 AM
That would of course work technically @Turis and I know it from CC but in game it is just a workaround and somehow artificial. How to combine bricks, tiles and window panes or a paint and some iron or gold or DS baskets and gears in a suitable way and how to name such new resources? Building pack x and y or building supply 1 - 3. I don't know. To just carry it to the building site and to see it there would be much more elegant. Especially because it already works and just needs a fix of the tool tip.

i am pretty sur Tom that if you build your email correctly with all the details, this is certainly something Luke can fix : make his ToolTipToolbar.rsc and CreateBar.rsc compatible for accepting more building resources :).
if you explain him well, pretty sure he can easily fix that :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Discrepancy

sorry for being an echo, but very good find @Tom Sawyer .

Even if Luke doesn't make changes, I think we could find a new way of getting around this and utilizing the extra resources.

...

A question regarding the returning of resources when a building is demolished.
I don't think I ever really get all the resources back anyway, and I've found with buildings that require few resources I don't get them back. Is this normal?
For example, how many people are getting returned Wagon Parts when they remove a Vendor Wagon? It was happening very little when I was testing.

Necora

@Discrepancy when I built a building that required 1 dory, it seemed to be hit or miss (mostly miss) if I would get any back when it was demolished.

embx61

@Discrepancy

I think you get half of the materials back you used for the building.
I never really checked it but see stuff on the ground after the building is demolished.
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

Paeng

Quote from: embx61 on April 11, 2017, 06:04:29 PMI think you get half of the materials back

Yeah, that's correct...

It may be worth some testing if Banished correctly recognizes custom materials added to building requirements (like bricks, lumber, glass or whatever)...
[i]Heads are round so thoughts can take a turn[/i]
[color=teal][size=8pt]Editor's Choice [b]here[/b][/size][/color]

RedKetchup

i sent an email to Luke about it ....
hopefully we will get some news on this :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

btw guys...

i cant even get to you guys are .... i crash always as i click my blacksmith icon :S


my BS had : wood, stone and iron. i added brick and rooftile.
in the BuildUI of that BS , i changed    ElementDescription _element = "Dialog/Build.rsc:build"; to    ElementDescription _element = "Dialog/Build6.rsc:build";
i made a copy of build.rsc and renamed build6.rsc
i added 2x    "storageItem" //new at the end of the list of RibbonDescription storageTable
i added a copy of ToolTipToolbar.rsc , CreateBar.rsc , The ToolTipUpgrade.rsc and i shut down the //{   ObjectType _type = BuildRequirementUI;   } in those 3...


but i am still crashing.... what i ve missed ?
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .