The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on October 10, 2022, 09:07:07 PM

Title: Messages in underground mode ignore the z coordinate
Post by: Yona-TYT on October 10, 2022, 09:07:07 PM
I don't know if this was implemented, but the messages in the underground mode don't point to the correct address because they don't use the z coordinate (height), would it be possible to implement this?.

 It actually tends to confuse users when building a tunnel underground, look at the picture:
Title: Re: Messages in underground mode ignore the z coordinate
Post by: Dwachs on October 12, 2022, 06:16:14 AM
This is a missing feature of this message box window (and thus inherited by scripting api). Should be doable.
Title: Re: Messages in underground mode ignore the z coordinate
Post by: Dwachs on October 20, 2022, 06:24:38 AM
This turns out to produce a lot of work in completely unrelated parts of the code, which still use 2d coordinates only (ticker, speed records).

Also what should happen if one clicks such a message? Should display change to underground mode automatically?
Title: Re: Messages in underground mode ignore the z coordinate
Post by: Yona-TYT on October 20, 2022, 10:35:49 AM
Quote from: Dwachs on October 20, 2022, 06:24:38 AMAlso what should happen if one clicks such a message? Should display change to underground mode automatically?

Well, the behavior should be similar to when following a vehicle entering a tunnel, this activates the "Sliced map view".
Title: Re: Messages in underground mode ignore the z coordinate
Post by: Yona-TYT on October 30, 2022, 02:50:51 AM
Quote from: Dwachs on October 20, 2022, 06:24:38 AMThis turns out to produce a lot of work in completely unrelated parts of the code, which still use 2d coordinates only (ticker, speed records).
Do you think it would be a good idea to change everything to 3d coordinates? Would this have implications in general performance?.
Title: Re: Messages in underground mode ignore the z coordinate
Post by: Dwachs on October 30, 2022, 11:16:16 AM
I will work on this. It will have no impact at all, I guess. A lot of code needs to be updated (inclusive savegame compatibility code).
Title: Re: Messages in underground mode ignore the z coordinate
Post by: Dwachs on November 07, 2022, 06:28:11 PM
This is now in r10794/96
Title: Re: Messages in underground mode ignore the z coordinate
Post by: Yona-TYT on November 08, 2022, 01:52:25 AM
Quote from: Dwachs on November 07, 2022, 06:28:11 PMThis is now in r10794/96
Wow, you have changed many coordinates to 3d!. ;D

It works great, thanks for your great work!.



There is a small visual error in the preview, apparently it happens on the slopes, look at the image:
Captura desde 2022-11-07 21-49-11.png