Feature Request: Setting Labels

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Feature Request: Setting Labels

Post by Zutty »

Hi all,

I know its late in the day for feature requests but this is something that I think might make AIs a bit easier to use and help make NoAI feel more polished.

It would be nice if we could specify labels for settings such that the AI config window displays those labels (if provided) instead of the raw numbers. Something like...

Code: Select all

AddSetting({name = "aggro" description = "Aggression", min_value = 0, max_value = 1, easy_value = 0, medium_value = 0,
 hard_value = 1, custom_value = 1, flags = 0, labels = {0 = "Off, 1 = "On"}});
It would be nice to have "Low", "Medium", "High", etc.. instead of rather arbitrary looking 0...5 values. It would be especially useful though for stuff like "On" and "Off" for boolean 0, 1 values or for more abstract things that don't really represent continuous settings, e.g. if you wanted the player to be able to specify what cargo types are used you might want labels like "None", "Mail", "Mail & Goods", "All Cargo".

I know all the devs must be busy right now, and I can't imagine I'm the first person to think of or suggest this, but I thought I'd mention it anyway. :)

Thanks.
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Feature Request: Setting Labels

Post by Yexo »

For boolean values, try using

Code: Select all

AddSetting({name = "some_bool" description = "Aggression", easy_value = 0, medium_value = 0,
 hard_value = 1, custom_value = 1, flags = AICONFIG_BOOLEAN});
For the other settings, I agree it would be nice, but I'm not sure how it can be implemented. I'll think about it.
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Feature Request: Setting Labels

Post by Zutty »

Yexo wrote:For boolean values, try using

Code: Select all

AddSetting({name = "some_bool" description = "Aggression", easy_value = 0, medium_value = 0,
 hard_value = 1, custom_value = 1, flags = AICONFIG_BOOLEAN});
Oooh I didn't know that. I might put this in the wiki (assuming it isn't already there!).
For the other settings, I agree it would be nice, but I'm not sure how it can be implemented. I'll think about it.
Thanks.
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Feature Request: Setting Labels

Post by Yexo »

Zutty wrote:
For the other settings, I agree it would be nice, but I'm not sure how it can be implemented. I'll think about it.
Thanks.
Please read your pm.

Edit: I updated http://wiki.openttd.org/wiki/index.php/AI:AIInfo to reflect all current options.
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Feature Request: Setting Labels

Post by Zutty »

Yexo wrote:
Zutty wrote:
For the other settings, I agree it would be nice, but I'm not sure how it can be implemented. I'll think about it.
Thanks.
Please read your pm.

Edit: I updated http://wiki.openttd.org/wiki/index.php/AI:AIInfo to reflect all current options.
Thanks for the explanation. Some stuff in there I wasn't aware of!

Replied to your PM too.
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Feature Request: Setting Labels

Post by Yexo »

Implemented in r15366, see http://wiki.openttd.org/wiki/index.php/AI:AIInfo for usage information.
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Feature Request: Setting Labels

Post by Zutty »

Wow that was quick. Thanks very much Yexo. :bow:
PathZilla - A networking AI - Now with tram support.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests