AICompany.SetCompanyColor("pink")
Moderator: OpenTTD Developers
AICompany.SetCompanyColor("pink")
Hey guys,
I can't seem to find the NOAI command to set the company colour although it 'should' exist because it's a value you can change inside the game.
Any pointers? I've searched API and forum but couldn't find a topic about it. Thx
I can't seem to find the NOAI command to set the company colour although it 'should' exist because it's a value you can change inside the game.
Any pointers? I've searched API and forum but couldn't find a topic about it. Thx
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: AICompany.SetCompanyColor("pink")
Doesn't look like it exists (yet): http://noai.openttd.org/api/trunk/classAICompany.html
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: AICompany.SetCompanyColor("pink")
I remember that this has been suggested before and docummented in the API extension suggestions thread.
Mainly I think this has been left out because it does not really affect anything in the game. That said, I think if someone comes up with an implementation of the API that will increase the chance of it being added. I think It's just that the AI API developers haven't found this feature worth the effort.
Mainly I think this has been left out because it does not really affect anything in the game. That said, I think if someone comes up with an implementation of the API that will increase the chance of it being added. I think It's just that the AI API developers haven't found this feature worth the effort.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: AICompany.SetCompanyColor("pink")
Correct.Zuu wrote:Mainly I think this has been left out because it does not really affect anything in the game. That said, I think if someone comes up with an implementation of the API that will increase the chance of it being added. I think It's just that the AI API developers haven't found this feature worth the effort.
Re: AICompany.SetCompanyColor("pink")
This interests me
Which files in the source code would i have to edit to implement these functions? (In a patch)
Which files in the source code would i have to edit to implement these functions? (In a patch)
AroAI - A really feeble attempt at an AI
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Re: AICompany.SetCompanyColor("pink")
At least ai_company.hpp and ai_company.cpp. If I could be bothered to check if you need to change any more files I'd have already implemented it.
Re: AICompany.SetCompanyColor("pink")
Hmm.Yexo wrote:At least ai_company.hpp and ai_company.cpp. If I could be bothered to check if you need to change any more files I'd have already implemented it.
Me and no-experience with c++ means that i am unable to complete this patch on my own.

My problems are understanding the p1 and p2 of the AIObject::DoCommand() function. i have looked at the main DoCommandP() and the documentation and other implementations of company colour change, but i can't seem to understand how to do it
For example, line 798 of company_gui.cpp has this:
Code: Select all
DoCommandP(0, scheme | (widget == SCLW_WIDGET_PRI_COL_DROPDOWN ? 0 : 256), index, CMD_SET_COMPANY_COLOUR);
Help please?
Also, i notice that there are xxxxxxxxx.hpp.sq files. Do i need to edit them as well?
- Attachments
-
- ai_company_colour_r21329_unfinished.diff
- (985 Bytes) Downloaded 41 times
AroAI - A really feeble attempt at an AI
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Who is online
Users browsing this forum: No registered users and 7 guests