How does tech/recipe difficulty handle the default fields?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
Mernom
Fast Inserter
Fast Inserter
Posts: 123
Joined: Sun Jul 15, 2018 10:05 pm
Contact:

How does tech/recipe difficulty handle the default fields?

Post by Mernom »

How does tech/recipe difficulty handle the default fields? namely, localised name/localised description. I'm making a mod which adjusts the cost of technologies based on their position in the tech tree, but since normal and expensive mode can have different tech trees, having a single description for them might not work well.

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 519
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: How does tech/recipe difficulty handle the default fields?

Post by Silari »

AFAIK you can't change localized name/description based on difficulty level, as those are part of PrototypeBase which has no concept of difficulty level. Name/description has to be set during the data stage, well before a game is loaded to know what difficulty is set. Don't know if it could be added to the engine either, since difficulty can change mid-game and the game doesn't seem to handle localizations changing mid-game (like rebinding controls will still show the old one, unless you save+load).

Closest way I can think of to fake it is to have a startup setting for which mode is going to be used and require the user to set it properly for whatever game mode they're playing. Not ideal since it'd have to be changed anytime the user switches modes, but I can't see another way.

Mernom
Fast Inserter
Fast Inserter
Posts: 123
Joined: Sun Jul 15, 2018 10:05 pm
Contact:

Re: How does tech/recipe difficulty handle the default fields?

Post by Mernom »

That's too bad, this means I have to record data for both states in the description.

Post Reply

Return to “Modding discussion”