News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Expand the Squirrel API

Started by victor_18993, Yesterday at 02:34:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

victor_18993

One of the most common requests from users is for highly customized behaviors that would likely be rejected in a standard proposal.

For these situations, I propose a solution: extending the Squirrel API specifically for modifying game behaviors. Essentially, this would involve safely expanding the engine through a behavior API where Squirrel is the consumer and invoker language, but which allows, for example, functional extensions of signals or specific behaviors in response to them.

The foundation would be creating a specific API for game behavior modders.

This could allow for a more customized experience or behaviors that many players want, without deviating from standard C++.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

danivenk

I mean it could also be nice to just have an API of the running game to talk to to retrieve data. Currently you can only really use a scripting tool, I feel like there should be a way to run a script not just as a tool but just to for example extract the rail network of a map or something. In such a case using an in game tool feels a bit odd to me (then again I guess that is just how the game works idk)

victor_18993

I'd have to look into that specific section, but theoretically, creating a script loading section if the engine exposes it could return the behavior designed in the engine, and then consume and format it in Squirrel. I don't think it's far-fetched; it seems like an interesting use case.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

danivenk

Quote from: victor_18993 on Yesterday at 02:45:31 PMI'd have to look into that specific section, but theoretically, creating a script loading section if the engine exposes it could return the behavior designed in the engine, and then consume and format it in Squirrel. I don't think it's far-fetched; it seems like an interesting use case.
Or maybe even just the game having a literal API that returns JSON or something xD

victor_18993

How the script is coded would be Squirrel, and then whether data output behaviors could be parameterized into other exportable formats that would be more useful to the player.

The idea is to have an API that allows that modding without deviating from standard behaviors that would generally be rejected; over time, I imagine some could even be absorbed into Standard with a design fit if it becomes very useful.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)