AI create a lot of "T" sign

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
gr44
Engineer
Engineer
Posts: 4
Joined: 26 Aug 2022 12:07

AI create a lot of "T" sign

Post by gr44 »

Hi Guys, Please help me out here. there is an AI created A LOT of "T" sign + other sign total of 50k of sign created. please see the attached. how do i remove all this sign?

Thanks
Attachments
TTD.PNG
TTD.PNG (224.88 KiB) Viewed 1083 times
HGus
Engineer
Engineer
Posts: 121
Joined: 12 May 2013 22:28
Location: Argentina

Re: AI create a lot of "T" sign

Post by HGus »

The bug is in MailAi 2.22. To fix it you must change one line in their code.
Open EventManager.nut and delete or comment out (adding // at the begin) the line 144:

Code: Select all

MailAI.BuildSign(t1,"T"); 
(not an actual fix, but a workaround)

The error sign is triggered when the AI fails to convert rail track after 33 tries. Notice this AI is bugged and abandoned.

The are 2 ways to delete those signs from a running game. First, the hard one, manually, which is impracticable if the AI was building signs for a while. The second way is adding some cleaning code to main.nut in MailAI::Start function after "fixing" the bug.
(code borrowed from SuperLib)

Code: Select all

local sign_list = AISignList();
	foreach(i, _ in sign_list)
	{
		AISign.RemoveSign(i);
	}
After the next run you can delete or comment it out to avoid interference with newly created signs.

Do not update the AI from online content. It will overwrite the fixed version and the bug will come back.

Enjoy.
HGus
Engineer
Engineer
Posts: 121
Joined: 12 May 2013 22:28
Location: Argentina

Re: AI create a lot of "T" sign

Post by HGus »

Here a copy of the modified file:
MailAI-2.22-fix2.tar
Fixed MailAI for T signs
(273 KiB) Downloaded 61 times
gr44
Engineer
Engineer
Posts: 4
Joined: 26 Aug 2022 12:07

Re: AI create a lot of "T" sign

Post by gr44 »

It works. Thanks you so much Sir!
Attachments
ttd.PNG
ttd.PNG (355.42 KiB) Viewed 1002 times
HGus
Engineer
Engineer
Posts: 121
Joined: 12 May 2013 22:28
Location: Argentina

Re: AI create a lot of "T" sign

Post by HGus »

No problem. Those Bank signs seem to be created by a crashed AI. To remove them you must add the cleaning code to a GS script (too bad if you are not using anyone in your game) because AIs only can delete their own signs created by the current instance.
gr44
Engineer
Engineer
Posts: 4
Joined: 26 Aug 2022 12:07

Re: AI create a lot of "T" sign

Post by gr44 »

HGus wrote: 28 Aug 2022 02:42 No problem. Those Bank signs seem to be created by a crashed AI. To remove them you must add the cleaning code to a GS script (too bad if you are not using anyone in your game) because AIs only can delete their own signs created by the current instance.
ok noted. Thank you again. :D
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 5 guests