News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Recent posts

#1
Game Servers / Re: pak64 server
Last post by prissi - Yesterday at 11:39:37 AM
Strange, the server was running but not connections to the outside. Had to kill the process and restart it manually.
#2
Game Servers / Re: pak64 server
Last post by Nazalassa - Yesterday at 09:28:12 AM
Server is down again.

For the record, seems like it crashed when a player joined while I was editing a schedule.
#3
Scripting Scenarios and AI / Re: need welt->get_active_play...
Last post by makie - July 01, 2026, 10:06:18 AM
Quote from: Andarix on July 01, 2026, 09:35:59 AMget_version_number()

Thank you very much, that is helpful.
I search for it but couldn't find it.
#4
Scripting Scenarios and AI / Re: need welt->get_active_play...
Last post by Andarix - July 01, 2026, 09:35:59 AM
Quote from: makie on July 01, 2026, 08:38:48 AM...
Another question:
Is there any other way to detect the Version of Simutrans as trying a new call and catching the exception with "try" and "catch"?
...

get_version_number()
#5
Scripting Scenarios and AI / Re: need welt->get_active_play...
Last post by makie - July 01, 2026, 08:38:48 AM
Thank you very much, I can manage with that now. :thumbsup:  :thumbsup:  :thumbsup:

Small question:
Is there any other way to detect a locked public player than by trying it and catching the exception with "try" and "catch"?

Another question:
Is there any other way to detect the Version of Simutrans as trying a new call and catching the exception with "try" and "catch"?

My solution: try get_target_cities() -> no? then old program version! --> check if player has enough money else hint for use public player
try with public player --> get a catch --> ok it is locked! --> try as aktiv player if has enough money
#6
Scripting Scenarios and AI / Re: need welt->get_active_play...
Last post by prissi - July 01, 2026, 03:03:33 AM
The squirrel virtual machine VM is tied to a player. So switching players would require to restart the VM as that player. However, r12053 will allow players to run commands as other players IF that player is not locked. Just like a normal player could do. I.e. the above script can build the factory as player_x(1).
#7
Patches & Projects / Re: Retire NETTOOL preprocesor...
Last post by prissi - July 01, 2026, 02:13:38 AM
IT really depends, is all I can say. If the refactor opens up new functionality or helps to break up things to make them more understandable, yes. But on the other hand, it will make it harder and hard for the fraks to keep in sync and also to port back stuff. In that apsect, the huge refactoring of file reorganisation and translation etc. was bad, as any patches/features comitted to OPTR cannot go back to standard. And, due to breaking of simvehicle.cc into subfiles, this part means fully manual work.

Finally, the long time maintainers working have to relearns to where is what after these larger refactorings, making life for existing maintainers a little harder.

So it is a balance, and I cannot promise you a clear answer.

As to patching out #ifdef: I think these are extremely low on my priority list as a clever IDE could show which are active and which not for the current settings.
#8
Patches & Projects / Re: Change direction of player...
Last post by Isaac Eiland-Hall - June 30, 2026, 09:27:00 PM
What other game would give you an option for such a thing? lol. Awesome. :)
#9
Scripting Scenarios and AI / Re: need welt->get_active_play...
Last post by makie - June 30, 2026, 03:49:42 PM
If the program officially allows you to make roads public, then in my view, that isn't cheating.

My original approach was to switch to public service in the script, as it is normally permitted for players, at least in pak128.german. Only the command just isn't working. This command can be disabled, for the player in the GUI, as it is the case in various scenarios—but in pak128.german, it is normally permitted for the player. There is no cheating. The script do as the player can do. If the command is forbidden the script can handle this, if the second problem see below is solved.

The second problem: After the tool_switch_player there is no way to check witch player is active. There is a lake of get_active_player_nr(), a internal routine that is only not exported to Squirrel. No cheating at all.

Cheating the building cost is a idea form prissi, not mine.

command_x(tool_switch_player) isn't working because there is no coding for executing this command in the program from Squirrel.



#10
Scripting Scenarios and AI / Re: need welt->get_active_play...
Last post by Andarix - June 30, 2026, 02:46:30 PM
Quote from: makie on June 30, 2026, 02:06:15 PMMost player play in single mode and the simplest method to cheat is to play without bankruptcy.
I'd like to see that player who delves into the depths of the Squirrel-API and write a script just to cheat in a multiplayer simutrans game. We are not at Counter-Strike.
...

It can certainly be considered cheating when many paths (especially roads) are made public in order to drastically reduce maintenance costs. After all, the toll revenue depends on usage rather than being a fixed fee for every field.

Of course, designating them as public roads entails some cost. However, once the standard 60-month period has passed, the costs associated with the paths are significantly lower.