Where does the Train Stop get support for a player enterable name?

Place to get help with not working mods / modding interface.
Valyrin
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Aug 17, 2020 3:43 am
Contact:

Where does the Train Stop get support for a player enterable name?

Post by Valyrin »

I'm working on a very small mod and need support for custom named entities. The first thing I think of to look for is the train stop, since players can rename it to whatever they want. I've looked through demo-entities.lua and demo-item.lua and found the train-stop entries, but I'm not seeing where it gets the ability to hold a player entered name (Iron 1, Copper Dropoff, Base, etc).

I'm new to modding in Factorio so it's entirely possible I've just missed it, but if anyone can lend a hand, I'd really appreciate it. I *think* I can do the rest of my mod once I know how I can add this feature, and read up on how it was implemented for train stops
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Where does the Train Stop get support for a player enterable name?

Post by steinio »

Look at backer_name.
Image

Transport Belt Repair Man

View unread Posts
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Where does the Train Stop get support for a player enterable name?

Post by DaveMcW »

It is hardcoded for train stops and any other entity that supports_backer_name(). You can't add it to anything else.
Valyrin
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Aug 17, 2020 3:43 am
Contact:

Re: Where does the Train Stop get support for a player enterable name?

Post by Valyrin »

Dang, so there is no ability to have custom named entities in the game, other than train stops?
Post Reply

Return to “Modding help”