News:

SimuTranslator
Make Simutrans speak your language.

Use start and end coordinates from a script tool in a scenario

Started by Yona-TYT, August 31, 2020, 06:46:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

Quote from: Yona-TYT on August 31, 2020, 01:46:41 AM2 - Can you combine a script tool with a scenario script ?, I mean to be able to pass data from the tool to the scenario script, such as the start and end coordinates from "mark_tiles" for example, with this I can solve a problem in the "Split Regions" script to not use toll gates.


What I am looking for is to use a scripted tool to select an area on the map to save the coordinate values (start and end) and use those values in a script scenario.

Dwachs

Why not catch the calls to is_work_allowed_here? The tool id is a special number indicating that a scripted tool is behind.
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Certainly this can work, using the "tool_id", but how but how would you go about getting the start and end coordinates in a two-click tool?.  ???

Dwachs

Each click should be send to the scenario. But it seems impossible to distinguish first and second.

For your request, I could think of implementing a very low-level communication between scripts: just sending strings and numbers between them.
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Quote from: Dwachs on September 01, 2020, 07:10:22 AMEach click should be send to the scenario. But it seems impossible to distinguish first and second.
Certainly, it was precisely this that gave me headaches in the past, when I was trying to mark the beginning and the end of a road at the time of its construction.  :o

Quote from: Dwachs on September 01, 2020, 07:10:22 AMFor your request, I could think of implementing a very low-level communication between scripts: just sending strings and numbers between them.
This sounds interesting.  8)