Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facility buildings 001 - warehouse #9146

Merged
merged 11 commits into from Sep 21, 2014

Conversation

Projects
None yet
4 participants
@Aenye
Copy link
Contributor

commented Sep 20, 2014

Just a warehouse filled with a lot of crates and a possible flatbed truck in the middle. Added as a 1 x 1 overmap special with low-to-average frequency (0-2). Based on house_rv.json by John-Candlebury.

Question: Is it possible to set which item groups pop up in crates ?

Adds a new warehouse building
Just a warehouse filled with a lot of crates and a possible flatbed truck in the middle. Not yet linked to anything.
Based on house_rv.json by John-Candlebury.

@Aenye Aenye changed the title Adds a new warehouse building [CR] Facility buildings - warehouse [CR][WIP] Sep 20, 2014

@Mshock777

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2014

I think you just add place_groups on crate's tile.
Like it's done in mall_a_3

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2014

Thanks ! Will look into it and complete the update.

Adds items on the floor and in crates
Adding items to make the building seem cluttered.

@Aenye Aenye changed the title Facility buildings - warehouse [CR][WIP] Facility buildings - warehouse Sep 20, 2014

{ "point": "terrain", "id": "t_dirt", "x": [ 0, 23 ], "y": 23, "repeat": [ 5, 8 ] }
],
"place_groups": [
{ "vehicle": "rv", "x": 12, "y": 13, "rotation": 270, "chance": 50 },

This comment has been minimized.

Copy link
@KA101

KA101 Sep 20, 2014

Contributor

Um, that's an RV, not a flatbed?

Makes the proper vehicle spawn
Thanks for pointing it out !
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2014

Fixed the rv-flatbed - thanks for pointing this out !

PS: Pieced together a nice spreadsheet in excel that gives me 100% accuracy when designing the layouts and generates code auto-magically. Will share if anyone is interested.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2014

PS: Pieced together a nice spreadsheet in excel that gives me 100% accuracy when designing the layouts and generates code auto-magically. Will share if anyone is interested.

Please do. Tedium & fine-detail are the biggest reasons we don't have more large structures in the game.

@KA101 KA101 assigned KA101 and unassigned KA101 Sep 20, 2014

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2014

Gonna need some more support code in mapgen and/or overmap_specials. Sorry.

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2014

Here's the spreadsheet: https://app.box.com/s/w7n58om43xt6g4nmt1ey
Very basic for now, but if it is helpful, I can give it the necessary polishes.

I've set it for the standard 24 x 24 grid and use a few minor functions in excel to make it link all the symbols in each row into a single string, appending it with quotations and a comma (unless it's the last line).

TBH I'm not sure what functionality is required of the spreadsheet (well, apart from the obvious) - I will greatly appreciate your input ! While I'm not much in terms of json/c#, excel/vba have been my domain for a long time...

Aenye added some commits Sep 20, 2014

Adds warehouse to overmap
Adds warehouse to overmap terrain and gives it light blue "W" as a symbol, with "small warehouse" as the name for the tile.
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2014

Added the necessary code in overmap_terrain and overmap_specials. Should be acceptable now.

@Aenye Aenye changed the title Facility buildings - warehouse Facility buildings 001 - warehouse Sep 20, 2014

{ "point":[0,0,0], "overmap": "warehouse", "connect":"road"}
],
"locations" : [ "by_hiway" ], "//":"what special locations does it spawn",
"city_distance" : [10, 100], "//":"how far from a city it should be",

This comment has been minimized.

Copy link
@Mshock777

Mshock777 Sep 20, 2014

Contributor

That far? Probably should take power station above as example

Changes distance from city
Increased minimal, sharply decreased maximal.
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2014

Good point - not too close, though - trucks don't like city centres and vice versa.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2014

OK, I'll push the current merge then come back around for this and the craters later.

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2014

Thanks ! Is there anything more I can do to help with #9130 ?

@KA101 KA101 self-assigned this Sep 21, 2014

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 21, 2014

Got it working. Thinking that the crates need a bit more, seeing as one would need to cut/demo one's way into the structure.

One thing I want to make totally clear: I (and probably every one of my fellow mergers) have made piles of these sorts of mistakes throughout my career. JSON glitches happen. We'd appreciate it if you make sure it runs on your end before PRing, but it's not as though we've never merged something that broke things. (I know I've broken the build a few times.)

"@": "f_trashcan"
},
"place_specials": [
{ "type": "toilet", "x": 17, "y": 2 }

This comment has been minimized.

Copy link
@KA101

KA101 Sep 21, 2014

Contributor

x and y were reversed. Fixed in the merge.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 21, 2014

Crates can be handled later; rotation not so much. I'm looking into that and if I can get it working, will merge.

"id" : "warehouse",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "warehouse", "connect":"road"}

This comment has been minimized.

Copy link
@vache

vache Sep 21, 2014

Contributor

To rotate properly, this should have "overmap":"warehouse_north"

This comment has been minimized.

Copy link
@KA101

KA101 Sep 21, 2014

Contributor

Would have been nice to know several hours ago. Thanks just the same, vache. :-/

This comment has been minimized.

Copy link
@KA101

KA101 Sep 21, 2014

Contributor

Nope, that of itself won't do it, and changing the ID didn't either. I've been all night at this and wold really like to smash something right about now.
...
Someone write a recipe to convert pebbles to sand, once the sand-pickup thing gets fixed. That ought to do it.

@KA101 KA101 removed their assignment Sep 21, 2014

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2014

Trying to fix this (somehow) as well - tried to test this one as well, but had a bit of trouble - is there any "trick" to quickly generating a lot of them (well, beside raw json edition on the required amount on an overmap) on an overmap, to test the rotations ?

Fixes inversed coords.
Fixed the coords for toilet.
@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2014

Fixed the coordinates in the building map. As for getting in, smashing a window and opening the inner door gives you easy access. That said, will add some more stuff to the crates.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 21, 2014

Testing mapgen rotation? Afraid you need it to produce more in mapgen, so no, you'd need to increase the amount. (And 2, 4 seemed better anyway--a warehouse or two per overmap is realistic, compared to the amount of power substations, etc.)

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2014

I've done some testing and can see how it should work - a line should be added in overmap_specials. json that should say: "rotate" : true,

I did that, but this resulted in a debug message that the game can't find "warehouse" (testing has shown that this one is the same map name as what I enter in overmap_specials in this line:

"overmaps" :
[
{ "point":[0,0,0], "overmap": "warehouse", "connect":"road"}
],

Has me puzzled to no end - tried several configurations and it's wither no rotation or can't find the map.

Update: Tested in on the grocery (duplicated grocery1.json to m_grocery.json, where the map name was changed to m_grocery instead of s_grocery). Added it in the overmap_terrain and overmap_specials:

overmap_terrain.json addition:

{
"type" : "overmap_terrain",
"id" : "m_grocery",
"name" : "m_grocery",
"rotate" : true,
"sym" : 72,
"color" : "red",
"see_cost" : 5,
"extras" : "build",
"mondensity" : 2,
"sidewalk" : true
}

overmap_specials.json addition:

{
"type" : "overmap_special",
"id" : "m_grocery",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "m_grocery", "connect":"road"}

    ],
   "locations" : [ "by_hiway" ], "//":"what special locations does it spawn",
    "city_distance" : [10, 120], "//":"how far from a city it should be",
    "city_sizes" : [1, 12], "//":"what city sizes should it spawn in",
    "occurrences" : [2, 5], "//":"how many per overmap",
    "rotate" : true, "//":"allow rotation",
    "unique" : false, "//":"only allow one per city",
    "required" : false, "//":"is this special required for valid city sizes",
    "flags" : [ "CLASSIC" ]
}

Result: m_grocery not found. This means the error is somewhere in the above contributions. Thing is, this time I've copied them from what already is in the files and changed only the names. Tried changing the names around and even went and changed all of the id/names/filenames to m_grocery (as you can see above). No effect.

@vache

This comment has been minimized.

Copy link
Contributor

commented Sep 21, 2014

Now try changing "warehouse" to "warehouse_north". I didn't notice that you didn't have rotate set in the overmap terrain before.

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2014

Ok, will push it in warehouse.json and in overmap_specials.json as map name. One moment.

@vache

This comment has been minimized.

Copy link
Contributor

commented Sep 21, 2014

You should only need to set "warehouse_north" in the layout in the special definition. The game reads in the ID from the mapgen json, then attaches _north, _south, etc for the different variants. Unfortunately, overmap_special isn't smart enough right now to assume north, and it has to be specified.

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2014

Done that - cloning the branch to test...

Cloned. Tested and ...it works !!! Pic 'cause it happened: http://i58.tinypic.com/250mlad.jpg

Thank you Vache !

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 21, 2014

Always nice to have support, isn't it? >_<

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2014

Yeah, although I'd call it "having my behind pulled out of the fire" rather than just "support". ^^ Even though the code is relatively easy to understand, some things culd be deemed tutorial-worthy. ;-)

That or me turning the "newbie factor" to eleven.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Sep 21, 2014

Just nice to see that you got help when you needed it. >_<

@KA101 KA101 self-assigned this Sep 21, 2014

@Aenye

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2014

I should take both of you out for a brew or ten to show my appreciation. ;-)

@KA101 KA101 merged commit 38d51fb into CleverRaven:master Sep 21, 2014

1 check passed

default
Details

@Aenye Aenye deleted the Aenye:facility_warehouse_building branch Sep 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.