teleport help
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 help
hi I want to make a custom teleport ability ie:my unit teleports from one deep water tile to another deep water tile that it is not connected to I have this but it doesn't work:
#define ABILITY_WATERPORT
[teleport]
id=waterport
name= _ "waterport"
name_inactive= _ "waterport"
description= _ "waterport"
description_inactive= _ "waterport"
affect_self=yes
[filter_self]
[filter_location]
terrain=Wo
[/filter_location]
[/filter_self]
[/teleport]
#enddef
I am testing it on the grim spawn from war of chaos and this is the section that defines abilitys:
unit_description= _ "A creature spawned to be agile and cunning, the grim spawn is small and physically weak, however it
is able to strike precisely in order to damage and weaken muscles, and is incredibley fast and agile making it a difficult target to
strike."
[abilities]
{ABILITY_SWAMP_KNOWLEDGE}
{ABILITY_WATERPORT}
[/abilities]
{DEFENSE_ANIM "Afflicted/grimspawn-death1.png" "Afflicted/grimspawn.png" sound=hiss-hit.wav }
die_sound=hiss-die.wav
#define ABILITY_WATERPORT
[teleport]
id=waterport
name= _ "waterport"
name_inactive= _ "waterport"
description= _ "waterport"
description_inactive= _ "waterport"
affect_self=yes
[filter_self]
[filter_location]
terrain=Wo
[/filter_location]
[/filter_self]
[/teleport]
#enddef
I am testing it on the grim spawn from war of chaos and this is the section that defines abilitys:
unit_description= _ "A creature spawned to be agile and cunning, the grim spawn is small and physically weak, however it
is able to strike precisely in order to damage and weaken muscles, and is incredibley fast and agile making it a difficult target to
strike."
[abilities]
{ABILITY_SWAMP_KNOWLEDGE}
{ABILITY_WATERPORT}
[/abilities]
{DEFENSE_ANIM "Afflicted/grimspawn-death1.png" "Afflicted/grimspawn.png" sound=hiss-hit.wav }
die_sound=hiss-die.wav
every time my cat meows, something dies.
Re: teleport help
That's because [teleport] doesn't have that feature, it's on the "good idea" list though.
Re: teleport help
What, so does [teleport] actually only work with villages even though the syntax suggests otherwise?
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
- Ken_Oh
- Moderator Emeritus
- Posts: 2178
- Joined: February 6th, 2006, 4:03 am
- Location: Baltimore, Maryland, USA
Re: teleport help
Yeah, I wasn't able to make teleport work with anything other than vills.
Re: teleport help
well thats lame ill have to do something else. thanks!
every time my cat meows, something dies.
Re: teleport help
hi I realize that this is now an old thread but this is relevant: I was wondering weather or not this issue (no custom teleport) has been fixed/changed in 1.6? thanks for the reply.
every time my cat meows, something dies.
Re: teleport help
Well the quickest way to find out would be to try it. But no I don't think it has.
Re: teleport help
Necromancy for a reason. Teleporting just keep causing problems...
My problem might be blatantly obvious, but i searched every teleport-related thread and i couldn't find the answer.
I tried to give the ABILITY_TELEPORT to a custom unit and expected to work like on Silver Mage. Instead, custom unit was capable of entering and exiting unoccupied and enemy villages as well. I found this very strange, because Silver Mage uses the same ABILITY_TELEPORT and there's no further filters in its unit file either. Instead, it's definitely in the abilities.cfg:
How could that not working on other units? Many thanks.
My problem might be blatantly obvious, but i searched every teleport-related thread and i couldn't find the answer.
I tried to give the ABILITY_TELEPORT to a custom unit and expected to work like on Silver Mage. Instead, custom unit was capable of entering and exiting unoccupied and enemy villages as well. I found this very strange, because Silver Mage uses the same ABILITY_TELEPORT and there's no further filters in its unit file either. Instead, it's definitely in the abilities.cfg:
Code: Select all
...
[source]
terrain=*^V*
owner_side=$teleport_unit.side
[not]
[filter]
[not]
id=$teleport_unit.id
[/not]
[/filter]
[/not]
[/source]
...
Horus, organiser of International Wesnoth Tournament 2016
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: teleport help
Make sure to put that code into the [unit_type]. Or use delayed_...=yes if using an [object].
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: teleport help
Thank you, that was the key indeed.Anonymissimus wrote:Make sure to put that code into the [unit_type]. Or use delayed_...=yes if using an [object].
Horus, organiser of International Wesnoth Tournament 2016
Re: teleport help
Another thread necro, also for a decent reason I think.
I'm also having trouble with {ABILITY_TELEPORT}. I am aware that delayed_variable_substitution=yes is required when adding the ability with an object. However, it doesn't seem to be recognized when I use it inside a unit modifications tag as seen below.
The unit is able to teleport between all villages including enemy and unowned villages. The is especially frustrating because in the very same scenario I add teleport to a different unit using the exact same object code and it works fine. The only difference is that in that case it was applied using a right click menu rather than a unit modification.
Any suggestions?
I'm also having trouble with {ABILITY_TELEPORT}. I am aware that delayed_variable_substitution=yes is required when adding the ability with an object. However, it doesn't seem to be recognized when I use it inside a unit modifications tag as seen below.
Code: Select all
[unit]
type=Ghoul
side=$monster_side
x=$x1
y=$y1
role=guardian
[modifications]
{TRAIT_LOYAL}
[object]
silent=yes
delayed_variable_substitution=yes
[effect]
apply_to=new_ability
[abilities]
{ABILITY_TELEPORT}
[/abilities]
[/effect]
[/object]
[/modifications]
[/unit]
Any suggestions?
Re: teleport help
Instead (or additionally) of delayed_variable_substitution insert it literallyLimabean wrote:Any suggestions?
Code: Select all
[set_variables]
name=new_ability
[literal]
{ABILITY_TELEPORT}
[/literal]
[/set_variables]
[unit]
#...
[modifications]
[object]
# blah
[effect]
apply_to=new_ability
[insert_tag]
name=abilities
variable=new_ability.abilities
[/insert_tag]
[/effect]
[/object]
[/modifications]
[/unit]
Re: teleport help
Unfortunately no luck. The result is the same.trewe wrote: Instead (or additionally) of delayed_variable_substitution insert it literally