AI communicate with player

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
jamesinchina
Engineer
Engineer
Posts: 2
Joined: 31 Oct 2019 07:27

AI communicate with player

Post by jamesinchina »

Hi,

Looking through the API I couldn't see the right method. I want the AI I am coding to pop up a message to the player. Even better would be the player could click accept or reject. But just a pop up window would be sufficient. Can you point me in the right direction? Thanks
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: AI communicate with player

Post by PikkaBird »

AIs can't do this (although I've long thought it would be nice if they could write to the multiplayer chat). They can only write to the AI debug log.

If you want dialogues the player interacts with, you need a GameScript.
jamesinchina
Engineer
Engineer
Posts: 2
Joined: 31 Oct 2019 07:27

Re: AI communicate with player

Post by jamesinchina »

Thanks. Can my AI script import a GameScript library, or do I need to write a separate GameScript which would then be located in the GS folder instead of the AI folder?
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 12 guests