WML [move_unit] to other unit's current position
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.
WML [move_unit] to other unit's current position
I have an issue: I want to move the unit to another's unit using [move_unit], but I don't know how to retrieve the unit's location. How should I do it?
Code:
Code:
Code: Select all
[move_unit]
id = Unit_Id
force_scroll=yes
to_x=AnotherUnit_Id.x # how to retrieve another's unit x ?
to_y=AnotherUnit_Id.y # how to retrieve another's unit y ?
[/move_unit]
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: WML [move_unit] to other unit's current position
[store_unit] potentially?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: WML [move_unit] to other unit's current position
Well, I checked the syntax.
https://wiki.wesnoth.org/InternalAction ... re_unit.5D
They say that I must write:
Then goes "variable: the name of the variable into which to store the unit(s)".
What exactly I must assign to this variable?
https://wiki.wesnoth.org/InternalAction ... re_unit.5D
They say that I must write:
Code: Select all
[store_unit]
[filter]
id = Unit_ID
[/filter]
# variable
[/store_unit]
What exactly I must assign to this variable?
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: WML [move_unit] to other unit's current position
Wesnoth will store the unit's information, including its x and y coordinates, into that variable.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code