Can Gamescripts change the game year?

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
Simons Mith
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 14 Jan 2010 23:45

Can Gamescripts change the game year?

Post by Simons Mith »

This post asks about repeating game years, and it does seems to be doable with a slight bodge - just use the game cheat menu to change the year back at regular intervals. If game scripts could change the game year, that could be automated. Would such a feature be reasonably easy to add?

viewtopic.php?f=33&t=82407&p=1200639
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Can Gamescripts change the game year?

Post by agentw4b »

Simons Mith wrote:This post asks about repeating game years, and it does seems to be doable with a slight bodge - just use the game cheat menu to change the year back at regular intervals. If game scripts could change the game year, that could be automated. Would such a feature be reasonably easy to add?

viewtopic.php?f=33&t=82407&p=1200639
https://nogo.openttd.org/api/1.8.0/clas ... 2130bd7022




I did not test it, but maybe for year 2200 ..



GSGameSettings.SetValue ( "restart_game_year" , 2200);
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Can Gamescripts change the game year?

Post by agentw4b »

agentw4b wrote:
Simons Mith wrote:This post asks about repeating game years, and it does seems to be doable with a slight bodge - just use the game cheat menu to change the year back at regular intervals. If game scripts could change the game year, that could be automated. Would such a feature be reasonably easy to add?

viewtopic.php?f=33&t=82407&p=1200639
https://nogo.openttd.org/api/1.8.0/clas ... 2130bd7022




I did not test it, but maybe for year 2200 ..



GSGameSettings.SetValue ( "restart_game_year" , 2200);
I already understand. You do not want to change the year of the end of game but the current game year. So I do not know how to do it.
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 5 guests