Author Topic: More Building Requirements  (Read 1889 times)

0 Members and 1 Guest are viewing this topic.

Offline Tom Sawyer

  • Modders
  • Architect
  • *****
  • Posts: 727
More Building Requirements
« on: April 11, 2017, 06:04:10 AM »
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. :)
« Last Edit: April 11, 2017, 06:09:22 AM by Tom Sawyer »

Online kid1293

  • Modders
  • Banished Expert
  • *****
  • Posts: 1695
  • Never confuse movement with progress
Re: More Building Requirements
« Reply #1 on: April 11, 2017, 06:51:19 AM »
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?
« Last Edit: April 11, 2017, 06:57:24 AM by kid1293 »

Offline kralyerg

  • Modders
  • Vendor
  • *****
  • Posts: 85
Re: More Building Requirements
« Reply #2 on: April 11, 2017, 07:21:34 AM »
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.)


Offline Tom Sawyer

  • Modders
  • Architect
  • *****
  • Posts: 727
Re: More Building Requirements
« Reply #3 on: April 11, 2017, 09:10:41 AM »
Yes, it's just commenting out the BuildRequirementUI in ToolTipToolbar.rsc and CreateBar.rsc to avoid crashes. The ToolTipUpgrade is affected too. Thanks @kid1293.

Code: [Select]
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):

Code: [Select]
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.

Offline Turis

  • Trader
  • ****
  • Posts: 317
Re: More Building Requirements
« Reply #4 on: April 11, 2017, 09:20:39 AM »
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?

Offline Tom Sawyer

  • Modders
  • Architect
  • *****
  • Posts: 727
Re: More Building Requirements
« Reply #5 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.
« Last Edit: April 11, 2017, 09:59:33 AM by Tom Sawyer »

Online embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1115
  • You are always on my mind, Forever in my heart
Re: More Building Requirements
« Reply #6 on: April 11, 2017, 12:02:03 PM »
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.
My beloved Kathy
As you were you will always be
Treasured forever in my memory

Online Necora

  • Modders
  • Trader
  • *****
  • Posts: 401
Re: More Building Requirements
« Reply #7 on: April 11, 2017, 02:39:24 PM »
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?

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 6983
Re: More Building Requirements
« Reply #8 on: April 11, 2017, 02:40:14 PM »
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 Paypal Donations < < <
Click here to PayPal Donate.

Offline Discrepancy

  • Modders
  • Architect
  • *****
  • Posts: 591
Re: More Building Requirements
« Reply #9 on: April 11, 2017, 05:53:09 PM »
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.

Online Necora

  • Modders
  • Trader
  • *****
  • Posts: 401
Re: More Building Requirements
« Reply #10 on: April 11, 2017, 06:01:43 PM »
@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.

Online embx61

  • Modders
  • Banished Expert
  • *****
  • Posts: 1115
  • You are always on my mind, Forever in my heart
Re: More Building Requirements
« Reply #11 on: April 11, 2017, 06:04:29 PM »
@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.
My beloved Kathy
As you were you will always be
Treasured forever in my memory

Offline Paeng

  • Banished Expert
  • *****
  • Posts: 1215
Re: More Building Requirements
« Reply #12 on: April 12, 2017, 07:30:58 AM »
I 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)...
Heads are round so thoughts can take a turn

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 6983
Re: More Building Requirements
« Reply #13 on: April 12, 2017, 11:39:46 AM »
i sent an email to Luke about it ....
hopefully we will get some news on this :)
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 6983
Re: More Building Requirements
« Reply #14 on: April 12, 2017, 12:42:20 PM »
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 Paypal Donations < < <
Click here to PayPal Donate.