Modularize Teleport, no changes to current gameplay
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.
- Thrawn
- Moderator Emeritus
- Posts: 2047
- Joined: June 2nd, 2005, 11:37 am
- Location: bridge of SSD Chimera
Re: Modularize Teleport, no changes to current gameplay
best thread necromancy ever
...please remember that "IT'S" ALWAYS MEANS "IT IS" and "ITS" IS WHAT YOU USE TO INDICATE POSSESSION BY "IT".--scott
this goes for they're/their/there as well
this goes for they're/their/there as well
Re: Modularize Teleport, no changes to current gameplay
edit: added comments
The old silver mage teleport feature has been removed in the branch and coded in wml.
This is the teleport ability wml code that should work exactly like the old teleport feature:
The old silver mage teleport feature has been removed in the branch and coded in wml.
This is the teleport ability wml code that should work exactly like the old teleport feature:
WML
Re: Modularize Teleport, no changes to current gameplay
[tunnel] also works in events as an action wml tag to create scenario specific teleporter.
Re: Modularize Teleport, no changes to current gameplay
Is there a way to deconstruct [tunnel]'s (make them unusable after a certain turn for example)? Do they automatically work both ways, is there an attribute which allows this, or must one have two [tunnel]'s which are opposites?
Re: Modularize Teleport, no changes to current gameplay
Yes, yes, yes and no.Gambit wrote:Is there a way to deconstruct [tunnel]'s (make them unusable after a certain turn for example)? Do they automatically work both ways, is there an attribute which allows this, or must one have two [tunnel]'s which are opposites?
Re: Modularize Teleport, no changes to current gameplay
An explanation of the [tunnel] tag.
The tag can be used in one of two ways:
With remove=yes, it removes all the [tunnel]s matching an id in the id list.
Without that, it creates a new tunnel with the following attributes:
-id: optional, for if you want to remove the [tunnel] again later
-bidirectional: if true, a reverse [tunnel] will also be created
-always_visible: if true, the possible movement of enemies under fog can be seen. (this is false by default, as in the case of silver magi, you would be able to see which fogged villages are owned by that side)
The [source], [target] and [filter] elements are all required, the last one filtering the units that can use this [tunnel] (leave empty to allow everyone), the first two defining the entry and exit hexes. ($teleport_unit can be used to refer to the teleporting unit)
The version that creates a new [tunnel] can be used in both EventWML and the [teleport] AbilityWML tag. Removing a [tunnel] can only be done in EventWML.
WML
With remove=yes, it removes all the [tunnel]s matching an id in the id list.
Without that, it creates a new tunnel with the following attributes:
-id: optional, for if you want to remove the [tunnel] again later
-bidirectional: if true, a reverse [tunnel] will also be created
-always_visible: if true, the possible movement of enemies under fog can be seen. (this is false by default, as in the case of silver magi, you would be able to see which fogged villages are owned by that side)
The [source], [target] and [filter] elements are all required, the last one filtering the units that can use this [tunnel] (leave empty to allow everyone), the first two defining the entry and exit hexes. ($teleport_unit can be used to refer to the teleporting unit)
The version that creates a new [tunnel] can be used in both EventWML and the [teleport] AbilityWML tag. Removing a [tunnel] can only be done in EventWML.
Re: Modularize Teleport, no changes to current gameplay
Thanks for the implementation, and for the clarifications.
Maybe this thread should be moved to WML workshop now?
One more question: would it be possible to create tunnels which take more than one MP (or even 0 MP) to cross? (This way one could create for example tunnels under (water) bridges, who take two movement points for water units to cross below, even when there is a land unit on top. For UMC, of course.)
Maybe this thread should be moved to WML workshop now?
One more question: would it be possible to create tunnels which take more than one MP (or even 0 MP) to cross? (This way one could create for example tunnels under (water) bridges, who take two movement points for water units to cross below, even when there is a land unit on top. For UMC, of course.)
Re: Modularize Teleport, no changes to current gameplay
The movement costs through a tunnel depends on the terrain (and the unit's movement ability on it) that is connected through it.pauxlo wrote:One more question: would it be possible to create tunnels which take more than one MP (or even 0 MP) to cross? (This way one could create for example tunnels under (water) bridges, who take two movement points for water units to cross below, even when there is a land unit on top. For UMC, of course.)
If you want to make a tunnel that needs more than the unit's movement cost on the target terrain you can do that by creating two tunnels that connect a separate part of the map with the exits
you want. You can limit the units that use that shortcut by the filter or by choosing a terrain that in your example only water units can cross.
Re: Modularize Teleport, no changes to current gameplay
Are tunnels optional? Or when moved upon do they have to be gone through?
Re: Modularize Teleport, no changes to current gameplay
The tunnels work exactly like the current teleport ability of the silver mage but for all kind of location/terrain/unit combinations you can manage with Wesnoth's standard unit and standard location filters.Gambit wrote:Are tunnels optional? Or when moved upon do they have to be gone through?
From Wesnoth 1.9 on, the teleport ability will be coded with the help of the [tunnel] as mentioned a few posts above.
Since a tunnel entrance can point to several target locations (just like the mage can teleport from a village to every other owned not occupied village) there is no way to determine where to send the unit and so the tunnel has to be "optional".
If you select a unit that can reach a tunnel during the turn the game will highlight not only the reachable locations around the mover but also the ones behind the tunnel.
The pathfinder will calculate a route through the tunnels if you move a unit if appropriate.
Sorry, can't explain it better. Just look how the mage teleport ability is working, understand how the wml posted earlier implements it, and you will see what [tunnel] is able to do for you.
edit: I have added comments to the example in the earlier post to make it easier to understand.
Re: Modularize Teleport, no changes to current gameplay
Oh that's right. I forgot (the basic principle) that you're moving to the exit to go through a [tunnel]. Sorry.
Re: Modularize Teleport, no changes to current gameplay
The [tunnel] feature has been merged into trunk, meaning it will be part of the next beta release and available in all upcoming 1.8 releases as well.
It's not compiled in by default to not spoil the 1.8 release with new untested stuff.
To try it out it's necessary to download the sourcecode and compile it with the EXPERIMENTAL flag set to true.
See "scons --help" how to do this.
I am moving the thread to wml workshop for this reason.
It's not compiled in by default to not spoil the 1.8 release with new untested stuff.
To try it out it's necessary to download the sourcecode and compile it with the EXPERIMENTAL flag set to true.
See "scons --help" how to do this.
I am moving the thread to wml workshop for this reason.
Re: Modularize Teleport, no changes to current gameplay
So will people who haven't compiled it this way still be able to play multiplayer games with [tunnel] in them? Will they be able to host addons with [tunnel] in them?