Teleport
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.
Teleport
So I made a custom teleport ability that can allow units to teleport next to units with a location ability, however it seems that units can teleport next to enemy units with location ability. How do I add a requirement that units can only teleport next to friendly units
Code: Select all
#define ABILITY_TELEPORT
[teleport]
id=teleportloc
# name= _ "Teleport"
# description= _ ""
[tunnel]
id=tunnel
[source]
[/source]
[target]
[filter_adjacent_location]
[filter]
is_enemy=no
ability=location
[/filter]
[/filter_adjacent_location]
[/target]
[filter]
ability=teleportloc
[/filter]
[/tunnel]
[/teleport]
#enddef
Code: Select all
#define ABILITY_LOCATION
[teleport]
id=location
# name= _ "Teleport Location"
# description= _ "Allows Teleport units to teleport next to it"
[tunnel]
id=tunnel
[source]
[/source]
[target]
[filter_adjacent_location]
[filter]
is_enemy=no
ability=location
[/filter]
[/filter_adjacent_location]
[/target]
[filter]
ability=location
[/filter]
[/tunnel]
[/teleport]
#enddef
Re: Teleport
The correct syntax should be:
If I understand correctly, the target hex must have an adjacent non-enemy unit with the location ability.
Code: Select all
[target]
[filter]
[filter_adjacent]
is_enemy=no
ability=location