Commit Graph
187 Commits
Author SHA1 Message Date
Guy Sviry 9507bf486a Fix TrackElement.seatRotation setter rejecting every ride except mazes (#27234)
The maze check in ScTileElement::seatRotation_set was inverted, so the
setter refused every track element except maze ones, the only ride type
seat rotation does not apply to. Use the same check as the getter.
2026-10-04 00:13:00 +02:00
Arjan van Dijk 5fe7c12c6f Add missing "guestsEntertained" to Entertainer interface in plugin API (#27153) 2026-09-19 23:55:43 +02:00
dumpster000 4872effb80 Make vehicle subposition writable in API (#26971)
* add vehicle subposition setter

* declare vehicle subposition setter

* subposition writable in api

* plugin API version

* fix format

* Add bounds checking

* fix formatting
2026-08-24 00:35:46 +10:00
Stephan Spengler 7bf6a4b4fb Fix result.position.z of SmallSceneryPlaceAction (#26958)
Adds a changelog that also references #26441
2026-08-21 08:30:23 +02:00
Marino Rottier e25c301668 feat: add PathNavigator (#26412)
* feat: add PathNavigator

* separate PathConnection from PathNavigator

* add PathNavigationOptions for PathNavigator

* make PathNavigationOptions positive instead of double-negative

* [skip ci] fix typo

* [skip ci] revert formatting

* align branch with develop after merge

* Address PR feedback

* Adapt PathNavigator to lowerCamelCase renames in develop

Upstream renamed TileElementType members and PathElement/BannerElement
accessors to lowerCamelCase (#26608, #26626 and follow-ups).

* Name PathNavigator/PathConnection Register and New

Use the same names as every other scripting engine class for these two
functions, so they don't read as doing something different.
2026-08-19 23:49:45 +10:00
Gymnasiast 11547e998a Make enum class+FlagHolder for ownership flags and normalise them 2026-08-14 21:52:24 +02:00
Max a187bc9550 Close #26827: Add map resize hook to scripting API (#26828) 2026-08-09 20:55:24 +02:00
RayKoopa 5a814722e1 Add Walls-only and Footpath Addition modes to Clear Scenery (#26877)
* Add two new modes for Clear Scenery.
- Split "Walls" from "Small Scenery" into own mode
- Add "Footpath Additions" mode
2026-08-07 20:49:40 +00:00
Gymnasiast e1f2c365c1 Rename members of PluginType 2026-08-02 20:08:35 +02:00
MaukWM 1ef6b7e941 Add save game binding in plugin API (#26560)
* Add context.saveGame() binding in plugin API.

* Add option to save games to a specific path via the plugin API.

* Alter documentation for SaveGameOptions.

* Bump kPluginApiVersion to 116.

* Use IsFilenameValid to disallow saving files with invalid characters

* Add changelog entry
2026-07-08 11:40:39 +00:00
mrmbernardi a64f0eff6c Fix crash when ScPark::generateGuest fails to generate a guest (#26681) 2026-06-16 20:24:53 +02:00
Stephan SpenglerandTulio Leao bcdac632a4 Add footpath object flags to API (#26322)
* add footpath object flags to API

* Add changelog

---------

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2026-06-06 16:31:03 -03:00
mrmbernardiandTulio Leao 6b81c4efec Fix JS socket issues (#26539)
* Fix Qjs sockets

* Add changelog entry

* Fix changelog ordering

---------

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2026-05-17 09:45:31 +00:00
mrmbernardiandMichał Janiszewski e4ba212574 Set qjs stack limit to 7MB (#26489)
* Set qjs stack limit to 7MB

* Update distribution/changelog.txt

Co-authored-by: Michał Janiszewski <janisozaur@users.noreply.github.com>

---------

Co-authored-by: Michał Janiszewski <janisozaur@users.noreply.github.com>
2026-05-16 17:26:29 +02:00
Marino Rottier 6e45d802ec Automatically publish plugin types to NPM (#26283)
* add workflow and package.json for publishing plugin TypeScript types

* move scripting-related files to scripting folder

* add support for trusted publishers

* fix path to scripting readme

* rename scripting README.md back to scripting.md

* support tagged/dev releases

* add workflow for development versions

* Update package.json website

* change dependencies in publish-plugin-types

* add timestamp to dev plugin versions

* note ScriptEngine.h grep dependency from CI

* use gh-describe to track release version for dev plugin types
2026-04-28 21:25:57 +02:00
Basssiiieandguysv ce9470971c Expose show/hideGridlines to scripting more safely (#24879)
Co-authored-by: guysv <sviryguy@gmail.com>
2026-04-18 03:37:11 +00:00
Max efb268af7d Add ride breakdown hook for scripting (#24243) 2026-04-18 03:25:23 +00:00
Michał Janiszewski 8d9aec1090 Fix #26304: Use common prototypes for JS entities (#26321)
Previously JS entities would create prototypes on each allocation in
`Sc*::New`. This change creates a single global protype for each entity
class which then gets copied upon entity allocation in JS realm.

Running test with "Live Ride Measurements" plugin on a park shared for
performance testing I get following results:

|                 | OpenRCT2::Scripting::HookEngine::Call | OpenRCT2::Scripting::ScMap::getAllEntities |
|-----------------|---------------------------------------|--------------------------------------------|
| duktape         | 68ms                                  | 10ms                                       |
| quickjs current | 318ms                                 | 126ms                                      |
| quickjs + fix   | 22ms                                  | 942µs                                      |

Previously each call to `getAllEntities` would result in 1382 calls to
`JS_SetPropertyFunctionList`, each costing 90.5µs.

Park used: https://files.catbox.moe/z6j2g4.park
2026-04-05 09:22:47 +02:00
Basssiiie cee8fcbee6 Remove some unused includes and simplify some others (#26317) 2026-04-03 23:04:34 +02:00
Michael Bernardi 4c8308464f QuickJS network and plugin version bumps 2026-04-01 12:54:43 +11:00
Michael Bernardi 79e10f98d5 Fix ScSocket 2026-04-01 02:19:01 +11:00
Michael Bernardi 421530c3ea Use class prototypes for all script types. 2026-04-01 02:19:01 +11:00
16cd1c07ff Swap Duktape for quickjs-ng
Co-authored-by: Basssiiie <Basssiiie@users.noreply.github.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2026-04-01 02:18:36 +11:00
Aaron van Geffen 1cc7006127 Reorganise game actions into folders (#25987) 2026-02-10 08:57:40 +01:00
matheusvb3 bba937a03d Remove more redundant namespace qualifiers (#25828) 2026-01-16 08:38:20 +01:00
Aaron van Geffen 40aaf97c07 Update copyright years to 2026 (#25741) 2026-01-05 13:42:59 +00:00
Aaron van Geffen abe58f6439 Move ClearAction, GameAction, ScenarioSetSettingAction into GameActions (#25045) 2025-08-29 06:32:05 -03:00
Aaron van Geffen bcb803df96 Move Footpath game actions into GameActions namespace 2025-08-26 14:48:16 +02:00
Jan Strauss 0522ae848b Add award plugin APIs (#24468)
* Add award plugin apis

* Address review feedback (use erase_if, extract AwardAdd method)

* Address review feedback (remove redundant comments, make AwardAdd static)

* Address review feedback (bump plugin api version, add changelog entry)
2025-07-13 07:04:26 -03:00
Cory Sanin 65b5d86e6c Feature: [Plugin] Add bindings for missing cheats
Added the following binds for completeness:
- ignoreRidePrice
- makeAllDestructible
- forcedParkRating*

`allowSpecialColourSchemes` was missing from the type definition file so I added that as well.

\*forcedParkRating required a little more logic than the boolean cheats and I added some safeguards to prevent setting invalid values
2025-07-08 09:18:25 +02:00
MaxandGymnasiast 5a95e5e27d Close #24313 - Add API for setting a car’s ‘isCrashed’ flag
Co-authored-by: Gymnasiast <Gymnasiast@users.noreply.github.com>
2025-05-12 21:42:46 +00:00
Max 08cb8cb8c3 Add plugin call for breakdowns (#24207) 2025-04-30 14:41:47 +00:00
ZeroBreakpoint 76cc04d044 Fix crash in map.getAllEntities("car") when car has an invalid ride 2025-04-17 19:18:23 +02:00
b92e05bc14 Scripting: Add Car.moveToTrack API (#23359)
* Scripting: Redraw vehicle when setting track location

* Scripting: introduce car.moveToTrack

A new function to move cars to tracks easier. Also redraws the car.

* Revert car.trackLocation to CoordsXYZD

reverts 30a555d3c2
car.moveToTrack() achieves the same thing in a saner API.

* Final fixes for vehicle.moveToTrack

added back tracklocation.Get with track type
added EntityTweener call at the end of travelBy/moveToTrack

* moveToTrack: final bassie review fixes.

* moveToTrack: use tile coords

* moveToTrack: api increment

---------

Co-authored-by: Guy Sviry <guy@axissecurity.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2025-04-02 23:42:30 +00:00
Michael Steenbeek be9f27e4f9 Mass rename constants (#23656) 2025-01-19 15:59:45 +00:00
Aaron van Geffen dbc394cb67 Scripting: list and use available costumes dynamically 2024-12-08 12:34:13 +01:00
Aaron van Geffen fa06a49302 Update copyright year to 2025 (#23514) 2024-12-31 20:30:04 +01:00
Aaron van Geffen 3685d1a24b clang-format: change IndentPPDirectives to BeforeHash (#23287) 2024-11-29 12:04:56 +09:00
Tulio Leao 4404415aec Fix #22891: getInstalledObject API function not implemented 2024-10-05 09:35:21 +00:00
AT41andTulio Leao 6e7b489304 Added additional stats to Plugin interface
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2024-10-03 11:23:50 +00:00
kendfreyandTulio Leao 307523610e Add Park.generateGuest() to plugin API (#22883)
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2024-10-02 06:49:43 -03:00
DuncanandTulio Leao e157a843f0 Large scenery object tiles for scripting (#22842)
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2024-10-01 21:02:46 -03:00
Harry Hopkinson 89637013e8 Fix #21507: Expose suggestedGuestMaximum via hook (#21521) 2024-09-11 21:17:26 -03:00
Guy SviryandGuy Sviry 332df0f1db expose Vehicle.spin_sprite to Car scripting (#22392)
* expose spinSprite to Car scripting

---------

Co-authored-by: Guy Sviry <guy@axissecurity.com>
2024-08-07 18:13:33 +01:00
Aaron van Geffen 05e56517ab Adopt existing namespaces into OpenRCT2 namespace (#22368)
* Put all of TitleSequenceManager into the same namespace

* Move RideConstructionState into the OpenRCT2 namespace

* Adopt existing namespaces into OpenRCT2 namespace

This adds `using namespace OpenRCT2` to compilation units where appropriate,
as a means to get the codebase to compile until these units have been placed
in a namespace of their own.
2024-07-26 09:59:58 +02:00
Guy SviryandGuy Sviry 30a555d3c2 Expose vehicle.trackType to scripting (#22272)
Co-authored-by: Guy Sviry <guy@axissecurity.com>
2024-07-25 17:27:15 -03:00
Arnold Zhou a749698566 [Plugin API] Feat: Expose staff statistics (#22184) 2024-07-24 20:10:34 -03:00
Aaron van Geffen b5ef2693b0 Remove common.h include from all units 2024-07-09 16:45:19 +02:00
Arnold Zhou aa11d8ddfe Expose ride satisfaction to plugin api (#22172) 2024-07-08 10:53:14 +02:00
Aaron van Geffen 83e5aeb9c5 Increment versions for park format, script engine, network for new flags 2024-07-06 15:14:12 +02:00