Project Highrise

Project Highrise

Unleash your inner architect.
Get new items for your skyscraper - furniture, decorations and even new types of tenants. You can also learn how to make them yourself using our guides.
了解更多
hydro-guppy[JP] 3 2016 年 9 月 28 日 上午 3:53
Naming and parameters(suggestions for modding system)
I've made a few Mods already, so I'd like to give a suggest I've noticed while code writing.

That is, access to language files and function supports; Naming tenants is quite a tough job if it has to write down all of them by hand and there's certain limit to variety. It'll be more sophisticated way which officially do, like "{#pattern-first-name}'s Restaurant"

And I hope there's more open information about parameters(coding) of tenants already exists, if possible. In current situation, we don't know some part of how it works, and sometime it results ridiculous settings and hard to tell where's problem is(Main program or Mod coding).
< >
正在显示第 1 - 10 条,共 10 条留言
SomaSim  [开发者] 2016 年 9 月 28 日 下午 12:49 
Moving this to the mods thread where it might get more attention.

Are you wanting to access the naming patterns that we already use in the game for mods instead of naming them yourself? Just want to make sure I understand the request!
最后由 SomaSim 编辑于; 2016 年 9 月 28 日 下午 12:50
hydro-guppy[JP] 3 2016 年 9 月 29 日 上午 3:59 
引用自 SomaSim Games
Moving this to the mods thread where it might get more attention.

Are you wanting to access the naming patterns that we already use in the game for mods instead of naming them yourself? Just want to make sure I understand the request!
Thanks for reply.
What I mean, it's great you're already supporting randamness for naming, and we're grad to if we could get a same way in modding as another option(It's sure that some of us want name then ourselves, as you said).
Anyway, I don't know well how busy you are and how conplex this game code is. If It sounded disturbing to you, please just think this as an small idea for ignor.
SomaSim  [开发者] 2016 年 9 月 29 日 上午 9:51 
You can do that in your mod file the way that we do it in the game.

Quick tutorial about the naming:

First you declare a pattern. Let's look at how the gourmet Chinese restaurants get their names.

In the unit section of the entities section of Definition.txt, replace locname with locpattern and define the locpattern,

In the case of our Chinese restuarant, let's imagine it looked like this before:
locname "restaurant.gourment.chinese"

That should become:
locpattern "#pattern-rest-chinese"

ALL PATTERNS MUST START WITH THE # SYMBOL. VERY IMPORTANT!!

That done, let's move down to the text section.

Inside the section that begins:

text {
en {

.... stuff
}
}

We're going to put the pattern based name for the Chinese restaurant.

First set up the structure of each pattern inside the curly brackets in the en section within the text section (or if you're working in another language, fr, de, es or it sections):

#pattern-rest-chinese {china.places} Kitchen
#pattern-rest-chinese {china.places} Restaurant
#pattern-rest-chinese {generic.colors.basic} {food.noun.chinese} Restaurant

You can have as many patterns as you want. The game will randomly pick a pattern and then randomly pick elements within the pattern.

Separate the pattern key and the value with a tab.

And one more time...

ALL PATTERNS MUST START WITH THE # SYMBOL. VERY IMPORTANT!!


The next step is to define what lives in the curly brackets. Still inside the en section of text (or which ever language you're working in), add:

china.places Beijing
china.places Chengdu
china.places Hong Kong
china.places Hunan
china.places Nanjing
china.places Shanghai
china.places Sichuan
china.places Xi'an
china.places Yunnan

Separate the key (china.places) and the value (Beijing) with a tab.

generic.colors.basic Black
generic.colors.basic Blue
generic.colors.basic Green
generic.colors.basic Orange
generic.colors.basic Purple
generic.colors.basic Red
generic.colors.basic White
generic.colors.basic Yellow

Again, separate the key (generic.colors.basic) and the value (Black) with a tab.

food.noun.chinese Chef
food.noun.chinese City
food.noun.chinese Ginger
food.noun.chinese Lamp
food.noun.chinese Palace
food.noun.chinese Wok

Again, separate the key (generic.colors.basic) and the value (Black) with a tab.

Hope that helps!
最后由 SomaSim 编辑于; 2016 年 9 月 29 日 上午 9:57
hydro-guppy[JP] 3 2016 年 9 月 30 日 上午 3:15 
Very Thanks!!
SomaSim  [开发者] 2016 年 9 月 30 日 上午 9:46 
Let me know if this all works well for you - if it does, we can add this to the modding instructions.
hydro-guppy[JP] 3 2016 年 10 月 5 日 上午 7:15 
引用自 SomaSim Games
Let me know if this all works well for you - if it does, we can add this to the modding instructions.

I've tried your suggetion, but it didn't work...

Coding as follows(from my mod, only text section);

text { en { "small-latediner.desc" "Small shop serving foods from noon to night." "small-latediner-movein.name" "Small Late-diner" #pattern-small-latediner {small.prefix} Diner #pattern-small-latediner {small.prefix} {late.night.prefix} Diner #pattern-small-latediner {late.night.prefix} Spot small.prefix Tiny small.prefix Mini late.night.prefix Late late.night.prefix Late-night late.night.prefix PM late.night.prefix Midnight } }

And this is what game returns;
Error parsing moveins for mod id [ModID small-latediner / Local]
Dictionary needs an even number of elements (keys and values) for dictionary starting with small.prefix
Parse Context: Diner
#pattern-small-latediner {small.prefix} {late.night.prefix} Diner
#pattern-small-latediner {late.night.

seems game can't get sub-text in the curly brackets, but why?
SomaSim  [开发者] 2016 年 10 月 5 日 上午 8:52 
Looks like your first two entries have spaces rather than tabs to separate - try replacing those with tabs and let me know?
hydro-guppy[JP] 3 2016 年 10 月 6 日 上午 6:57 
引用自 SomaSim Games
Looks like your first two entries have spaces rather than tabs to separate - try replacing those with tabs and let me know?
It made no difference, and I tried other conbination reffering 'en.txt' but only vain.
In all case, game can't find my own definitions' key.

I'm afraid that method you suggest isn't available in mod although it surely goes in "en.txt"...
SomaSim  [开发者] 2016 年 10 月 6 日 上午 9:04 
Try getting rid of the - in late-night or putting it quotes "late-night".
hydro-guppy[JP] 3 2016 年 10 月 12 日 上午 4:46 
引用自 SomaSim Games
Try getting rid of the - in late-night or putting it quotes "late-night".
It made no difference too.
I've tried another way, replacing mine to random official translation sets(JUST copy and paste).
...and none of them didn't work.
Now I'm sure that the method you've suggested DOESN'T WORK in mod, and therefore I'll give up.

Anyway, thanks for cooperation, and please check why does it go wrong if you could spear the time to do.
< >
正在显示第 1 - 10 条,共 10 条留言
每页显示数: 1530 50