Saving unit coordinates/location to a variable
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.
Saving unit coordinates/location to a variable
Hi Im having some issues trying to save a unit's current coords in a single variable so this can be filtered later allowing me to do an event when another unit is adjacent to that former coord, any ideas of the besy way to populate this in a variable macro please?
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Re: Saving unit coordinates/location to a variable
Store the locations that have your unit on.
If it is code challenge to solve it with variable macro, you need something like lua_function or formula to unpack the value again.
If it is code challenge to solve it with variable macro, you need something like lua_function or formula to unpack the value again.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Saving unit coordinates/location to a variable
The way I would do it would be to store_locations with radius=1 to save the six hexes adjacent to the unit's current coords. That way, I could just use find_in when I filtered the location later.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide