How to get moveto-coordinates of a unit at the time of exiting first hex

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
WhiteWolf
Forum Moderator
Posts: 769
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

How to get moveto-coordinates of a unit at the time of exiting first hex

Post by WhiteWolf »

Hello,

Is it possible in WML or rather with Lua, to get the coordinate information of where a unit is going after it's been ordered to move by the player (i.e. the would-be location where the moveto event would fire), at the time when the unit is just exiting its first hex?

The reason for this is that I need to kill the unit in the "exit hex" event, but I need the x,y information of where it was planning to go to.
I tried to check if maybe the unit.goto_x and unit.goto_y variables would be set to the selected value, but I'm afraid not, that won't work. (they stay on -999). However, I'm sure that by the time the unit is exiting the hex, the information of the selected goal must be stored by the game somewhere. So does anyone know if it's possible to get it with lua or something?

Thanks very much!
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Post Reply