Placeholder support in the localised "help" of command

This subforum contains all the issues which we already resolved.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Placeholder support in the localised "help" of command

Post by Mooncat »

Request:
Add support for placeholders (__1__, __2__, etc) in the localised "help" of custom commands registered by using commands.add_command.

Currently, the placeholder __1__ will be displayed as "1" if I type /help (the command) in the game. But it works as expected if I print the string using player.print. :geek:
B-Tone
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun May 28, 2017 7:43 pm
Contact:

Re: Placeholder support in the localised "help" of command

Post by B-Tone »

I would also like this!
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Placeholder support in the localised "help" of command

Post by Rseding91 »

The /help and player.print() operate using the same methods so they should show the same result.

Can you upload a mod that shows the problem?
If you want to get ahold of me I'm almost always on Discord.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Placeholder support in the localised "help" of command

Post by Mooncat »

Rseding91 wrote:The /help and player.print() operate using the same methods so they should show the same result.

Can you upload a mod that shows the problem?
Thanks for noticing the request, senpai!

A simple command can reproduce the issue:

Code: Select all

/c commands.add_command("foo", {"modifier-description.bullet-shooting-speed-bonus", "blah"}, function(event) end)
Then,

Code: Select all

/help foo
For comparison:

Code: Select all

/c game.player.print{"modifier-description.bullet-shooting-speed-bonus", "blah"}
This is the result:
foo.jpg
foo.jpg (73.93 KiB) Viewed 3337 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Placeholder support in the localised "help" of command

Post by Rseding91 »

Thanks. It's now fixed for the next version of 0.15.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Placeholder support in the localised "help" of command

Post by Mooncat »

Rseding91 wrote:Thanks. It's now fixed for the next version of 0.15.
Thanks!
Post Reply

Return to “Resolved Problems and Bugs”