Commit Graph

120 Commits

Author SHA1 Message Date
glx22
938acbe6ef Add: [Script] Cloning ScriptList 2025-06-05 22:37:33 +02:00
SamuXarick
5fef32bde7
Change: [Script] Move GSStation::GetOwner to GSBaseStation::GetOwner (#13406)
* Add: [Script] GSBaseStation::GetOwner

Added method for Game Scripts to retrieve the owner of a basestation.

* Cleanup: [Script] Remove ScriptStation::GetOwner

Due to class inheritance, GSStation::GetOwner and GSWaypoint::GetOwner can both reach GetOwner defined at GSBaseStation.
2025-05-22 13:47:04 +02:00
SamuXarick
ad3a34e9ef
Add: [Script] ScriptVehicleList_Waypoint (#13456)
Creates a list of vehicles that have orders to a given waypoint.
2025-05-19 14:48:17 +02:00
Loïc Guilloux
c16d5f3a8d
Change: [Script] ScriptVehicleList_Station accepts an optional VehicleType parameter (#14260) 2025-05-13 16:41:23 +02:00
Björn Wärmedal
d009bfc47b
Codechange: Add vehicle owner to crash event (#13878)
Co-authored-by: Björn Wärmedal <bjorn.warmedal@lumera.com>
2025-03-25 22:53:44 +01:00
SamuXarick
f6b0f7848b
Add: [Script] Newer Cargo Classes (#13779) 2025-03-15 16:51:56 +01:00
glx22
a6f558ce2a Add: [Script] Saving/loading ScriptList 2025-03-02 13:41:12 +01:00
Peter Nelson
ca75a8ce19 Codechange: Use enum class for NewsType. 2025-02-07 19:36:52 +00:00
SamuXarick
f5d43ffdf8 Change: [Script] GetWaypointID to return the StationID of any waypoint
Modified ScriptWaypoint::GetWaypointID to also return the StationID of any waypoint (including road waypoint).
2025-02-03 08:41:59 +01:00
Rubidium
b1ab1b9f06 Change: [Script] rename BridgeID to BridgeType in the script API 2025-01-22 22:23:38 +01:00
Rubidium
29129e12fd Add: [Script] Event for when a company's president name changes 2025-01-14 11:35:35 +01:00
Björn Wärmedal
9ab936f76b
Add: [Script] ScriptEventCompanyRename (#12878) 2025-01-14 09:24:28 +00:00
Loïc Guilloux
d67963e616
Add: [Script] Include number of victims in ScriptEventVehicleCrashed (#12861) 2024-07-16 21:28:29 +02:00
frosch
40e6230900 Codechange: Add main page to script API documentation 2024-05-10 13:17:19 +01:00
glx22
704e871a0e Revert bbdbf9a: ScriptTimeMode was not the best solution for economy/calendar support 2024-03-23 21:17:40 +01:00
Loïc Guilloux
845b894fd8
Remove: [Script] random_deviation from setting description table (#12221) 2024-03-05 12:41:04 +01:00
Rubidium
a4d4301a0c Codechange: We are heading to 15 2024-02-18 21:48:54 +01:00
SamuXarick
8584d1b5bb
Add: [Script] GetAirportNumHelipads (#12085)
Adds a function for Scripts to get the number of helipads of an airport type.
2024-02-14 21:38:32 +01:00
Loïc Guilloux
b0f3417025
Add: [Script] ScriptTileList_StationCoverage (#12015) 2024-02-06 20:22:18 +01:00
Patric Stout
849fd5ae03
Change: [Script] replace easy/medium/hard values with default value (#11959) 2024-02-03 09:15:03 +00:00
Patric Stout
e28edf6945
Remove: [Script] CONFIG_RANDOM from AddSetting flags (#11942)
It had a very weird interaction, and was only ever used by a single
AI.
2024-01-31 22:24:36 +00:00
dP
897b59c158
Add: [GS] Allow to set max loan for each company separately (#11224) 2024-01-30 19:15:19 +01:00
SamuXarick
0c4e509b60
Fix #10439: [GS] Validate story page button colour, flags, cursor and vehicle type (#11892)
Adds GSStoryPage::IsValidStoryPageButtonColour, GSStoryPage::IsValidStoryPageButtonFlags and GSStoryPage::IsValidStoryPageButtonCursor to the API.

Add missing enforced preconditions to validate parameters passed to MakePushButtonReference, MakeTileButtonReference and MakeVehicleButtonReference.
2024-01-28 00:29:10 +01:00
SamuXarick
76f0f9e386
Fix #10438: [GS] Validate story page element type for ScriptStoryPage::NewElement (#11888)
Fixes a crash that happens if an invalid StoryPageElementType is passed to ScriptStoryPage::NewElement.

Adds an enforced precondition that tests the validity of StoryPageElementType.

Adds GSStoryPage::IsValidStoryPageElementType to the API.
2024-01-27 22:11:02 +01:00
Tyler Trahan
bbdbf9a589
Add: AI/GS Time Mode to choose between economy (default) and calendar time (#11603) 2024-01-23 10:42:10 -05:00
Loïc Guilloux
c86d918921
Add: [Script] Optional filter parameter to more ScriptXXXList constructors (#11698) 2024-01-09 09:39:13 +01:00
Loïc Guilloux
a672813bb0
Add: [Script] Optional filter parameter to ScriptVehicleList constructor (#11663) 2024-01-01 01:07:47 +01:00
Michael Lutz
1c56991213 Add: [Script] Game script control of industry production level. 2023-09-02 16:20:59 +02:00
Andy
ce9305a5ee
Add: [Script] GSIndustry.GetConstructionDate() method (#11145) 2023-07-20 20:35:37 +02:00
mrmbernardi
35ef6c1723
Feature: [GS] Goal destination can be updated (#10817) 2023-06-08 18:00:31 +01:00
Patric Stout
6b1c38e303
Fix 3effb893: mention GSAsyncMode in changelog (#10924) 2023-06-04 11:10:22 +00:00
SamuXarick
f8b5661d28 Change: Allow GS access to ScriptGroup functions 2023-04-17 17:59:16 +02:00
SamuXarick
f225f36c3d Change: Allow GS access to ScriptGameSettings.IsDisabledVehicleType 2023-04-17 17:59:16 +02:00
SamuXarick
fd26a44c9e Change: Allow GS access to more ScriptCompany functions 2023-04-17 17:59:16 +02:00
Andy
8b1960a41c Change: Allow GS access to more ScriptOrder functions 2023-04-17 17:59:16 +02:00
Rubidium
cada2ca310 Add: GSCompanyMode::IsValid and IsDeity, and precondition enforcement helpers 2023-03-06 22:34:09 +01:00
SamuXarick
3df9321a65 Fix: Some Script::IsValidVehicle checks need to be complemented with IsPrimaryVehicle
Add: [Script] ScriptVehicle.IsPrimaryVehicle
2023-02-18 09:58:02 +01:00
glx22
e735370318 Change: [Script] A ScriptText with too many parameters is now a fatal error
It should never happen as adding/setting parameters already checks that anyway.
2023-02-17 21:28:14 +01:00
SamuXarick
4fc4874a30 Add: [Script] Let random road layout be a choice 2023-02-01 21:15:13 +01:00
Michael Lutz
150f05dc15
Change: Heading for 14 now. (#10302) 2023-01-01 22:52:23 +01:00
dP
5e14a20b3b
Feature: [GS] Scriptable league tables (#10001) 2022-11-26 18:03:03 +01:00
SamuXarick
8d0d45c431 Add: ScriptCargo::GetWeight to get cargo weights 2022-10-16 18:28:28 +02:00
SamuXarick
3dda8c9bad Fix: ScriptRoad::HasRoadType really check for RoadType
Script::HasRoadType was only checking if the tile had the same RoadTramType as that of the RoadType provided.
Now it really checks RoadType against RoadType.
2022-10-16 18:27:23 +02:00
Andy
b8a8891a86 Add: [Script] IndustryType::ResolveNewGRFID to resolve industry id from grfid and grf_local_id 2022-01-22 18:15:12 +01:00
Andy
26ac0c48f0 Add: [Script] ObjectType::ResolveNewGRFID to resolve object id from grfid and grf_local_id 2022-01-22 13:12:10 +01:00
Patric Stout
394c749b6b
Change: Heading for 13 now (#9573) 2021-09-25 13:48:03 +02:00
dP
39662aabef
Add: allow gamescripts to build neutral objects (#9568) 2021-09-25 13:39:40 +02:00
SamuXarick
37de878129
Feature: [AI/GS] Missing water related functions and objects (#8390) 2021-09-14 22:06:55 +02:00
Patric Stout
eca73a810c Change: rebrand 1.12.0 to 12.0
One question that keeps popping up: "when do we release 2.0?".
NewGRF will force that at least 1.16 will be 2.0, but to not wait
for this, let's drop the "1." and be for ever done with that
conversation.

We are following in the footstep of giants here.
2021-08-15 12:28:51 +02:00
Michael Lutz
8706dcd9c1
Add: [Script] Basic information about loaded NewGRFs for scripts. (#9464)
Currently, scripts use various heuristics to detect loaded NewGRFs that are inherently unreliable.
The list of loaded NewGRFs is easily accessible to a human player, and thus giving
scripts the same information is consistent with the current approach to not give scripts
more information than a human player.
2021-08-09 23:34:50 +02:00