News:

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

Get version of simutrans

Started by Yona-TYT, July 22, 2021, 05:57:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

 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.


Yona-TYT

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()"

-----------------------------------

Dwachs

You really want svn revision number? Or would be something like "123.4.5 NIghtly" enough?
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

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.

THLeaderH

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.

Yona-TYT

This is nice! I am very happy that this is more useful.  :D