Page 1 of 1

Possible bug with TTmod_addTrigger(GeoID...

Posted: 08 Sep 2018, 05:45
by Merlyn
I have just started using the addTrigger (thank you very much btw, very helpful), and have now run into this a few times where it doesn't seem the GeoID is properly being converted to the correct X, Y and Z coordinates, specifically the Z coordinates.

Here's an example of two attempts at adding a trigger based on a GeoID

Code: Select all

INFO 2018-09-08 05:43:48.015 {02} <TTmod_addTrigger> [96974] TTmod | Registered new trigger at position 1856 1196 0 with radius 12
INFO 2018-09-08 05:43:48.015 {02} <TTmod_addTrigger> [96974] TTmod | Registered new trigger at position 476 1032 0 with radius 12
I have had success using the actual X, Y, and Z coordinates but for this specific instance, I only have the GeoID.

The documentation states:
%position
“X Y Z” position or GeoID of the trigger center
Thank you in advance!

Re: Possible bug with TTmod_addTrigger(GeoID...

Posted: 08 Sep 2018, 07:20
by Nyuton
Hi,
GeoIDs contain only X and Y axis information, so conversion will always return 0 on z-axis. It shouldn't be a problem though. The trigger system ignores the z-axis entirely. I will update the documentation to reflect this.
Did you test the triggers? If X and Y is converted correctly, they should work, regardless of Z.

Re: Possible bug with TTmod_addTrigger(GeoID...

Posted: 08 Sep 2018, 07:35
by Merlyn
Interesting, maybe it's something else, any trigger I make using the GeoID doesn't work, but if I switch to x, y, and z (with a valid z), it seems to work. I'll have to try my current x, y, and z with z = 0 to test that functionality out.

Re: Possible bug with TTmod_addTrigger(GeoID...

Posted: 09 Sep 2018, 15:12
by Nyuton
You are correct, the conversion of X and Y is broken when using GeoIDs. My apologies. Thanks for pointing this out.
I've attached a fixed triggers.cs.dso file that you can replace. This will fix the problem. It'll also add the Z information based on the terrain at the X and Y coordinates (surface height).
I will of course include this in the next TTmod update.

Re: Possible bug with TTmod_addTrigger(GeoID...

Posted: 10 Sep 2018, 19:56
by Merlyn
Awesome! I was actually going to do some testing tonight because on my initial view, the console output was specifying X and Ys that I was certain were not correct based on what I was providing it. You just saved me having to loop through all objects to detect type and grab the coordinates off that! Thank you a bunch.