The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Andarix on April 17, 2025, 07:45:39 PM

Title: problem hm_toolkit functions - Simutrans 124.3.1 r11671
Post by: Andarix on April 17, 2025, 07:45:39 PM
I'm not sure if this is a bug or a programming issue.

The toolkit functions seem to be executed automatically with the new coordinates as long as a script tool is active.


I've expanded the airport script tool and added a rotation that attaches the airport stops to existing stops.

This only works correctly, however, if the tool is deselected and reselected after the first airport is built.

If it remains active, the previous airport will be rebuilt at the new coordinates during the run. Then an attempt will be made to build the correct alignment over it. Of course, this doesn't work because the fields are already occupied.

I know it's hard to understand.

In the image, I'm stopping the script at line 80. Up to this point, no construction function has been called. Nevertheless, the runway (the two spaces in front) has already been built.

(https://files.simutrans-germany.com/upload/Screenshot_2025-04-17_211133.png)

https://files.simutrans-germany.com/upload/script_tools_fh_neu.zip (https://files.simutrans-germany.com/upload/script_tools_fh_neu.zip)
Title: Re: problem hm_toolkit functions
Post by: THLeaderH on April 18, 2025, 10:52:15 AM
So do you have the issue in using the function in hm_toolkit_v3? It would be appreciated if you paste the code in which you have the problem.
I noticed that the code is attached. Let me take a look.
(I have not maintained this library for a long time...)
Title: Re: problem hm_toolkit functions
Post by: Andarix on April 18, 2025, 01:10:07 PM
The toolkit is built into Simutrans, but has been modified and expanded.

simutrans/script/

I submitted most of my changes to the Git repo via a request. I don't know if they're still there, because I've since deleted the fork.