I have noticed that now you can get the name of the pakset from script, I wonder if it is possible to do the same with the version number of simutras.
Dwachs asked that wishes be entered here.
https://github.com/Dwachs/simutrans-scenarios/issues (https://github.com/Dwachs/simutrans-scenarios/issues)
Getting the revision works for me too.
Here's a little experiment (not sure if it works):
api_world.cc----------------------- +++
#include "../../dataobj/gameinfo.h"
uint32 get_revision(){
gameinfo_t current( welt );
return current.get_game_engine_revision();
}
register_method(vm, get_revision, "get_revision");
-----------------------------------
squirrel_types_scenario.awk-------- +++
export_types["::get_revision"] = "integer()"
-----------------------------------
You really want svn revision number? Or would be something like "123.4.5 NIghtly" enough?
Quote from: Dwachs on July 28, 2021, 04:42:53 PM
You really want svn revision number? Or would be something like "123.4.5 NIghtly" enough?
That above was only one experiment on my part.
The most reasonable would be to get the version number, since the end user will understand it better since most mortals are more familiar with version numbers.
Getting the version number is useful for scripting tool too. I often have to separate the logic to use API functions which were implemented in recent versions.
This is nice! I am very happy that this is more useful. :D