Is there a way to make a Super Skirmisher ability?
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.
Is there a way to make a Super Skirmisher ability?
I want to make a unit that can literally walk through enemy units, so that it becomes practically impossible to trap that unit. Even if you surround it with 6 level 3s it can just walk through them and escape. Is there a way to do that?
Re: Is there a way to make a Super Skirmisher ability?
Somebody had a similar question recently. They also wanted a unit to move through an enemy unit.
This is the thread:
https://forums.wesnoth.org/viewtopic.php?f=21&t=53463
Ravana suggested, "This goal seems more suited to [move_unit_fake] and [unstore_unit]/[teleport]."
This is the thread:
https://forums.wesnoth.org/viewtopic.php?f=21&t=53463
Ravana suggested, "This goal seems more suited to [move_unit_fake] and [unstore_unit]/[teleport]."
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: Is there a way to make a Super Skirmisher ability?
That's kind of different from what I want. That thread is for automatic moving of a unit through an enemy unit, with a predefined destination (behind the enemy). I want the player to be able to arbitrarily choose the destination instead.
The closest thing I can think of is to set Super Skirmishers to have 1 Max MP, and at the start of the scenario create [tunnel]s everywhere that only super skirmishers can move through. But this, while functionally identical to what I want for gameplay, looks really really weird.
Is there some kind of event that triggers just before a unit moves, so that I can fake move unit over the map from the start of the tunnel to the end, before the unit appears at the end?
The closest thing I can think of is to set Super Skirmishers to have 1 Max MP, and at the start of the scenario create [tunnel]s everywhere that only super skirmishers can move through. But this, while functionally identical to what I want for gameplay, looks really really weird.
Is there some kind of event that triggers just before a unit moves, so that I can fake move unit over the map from the start of the tunnel to the end, before the unit appears at the end?
Re: Is there a way to make a Super Skirmisher ability?
I don't recall seeing any kind of "pre-move" event on the Wiki. There is
[select]
, but I can't imagine how that would help you.Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Pentarctagon
- Project Manager
- Posts: 5566
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Is there a way to make a Super Skirmisher ability?
exit_hex, 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
- Celtic_Minstrel
- Developer
- Posts: 2233
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Is there a way to make a Super Skirmisher ability?
You probably want to make this a [teleport] ability rather than placing [tunnel]s in the scenario.
Re: Is there a way to make a Super Skirmisher ability?
I see that [teleport] allows you to put [tunnel] inside, but I don't quite understand how that works. Also, wouldn't teleport let the unit actually teleport between villages? Is there a way to use it just for tunneling but not for teleporting between villages?Celtic_Minstrel wrote: ↑November 12th, 2020, 1:47 pmYou probably want to make this a [teleport] ability rather than placing [tunnel]s in the scenario.
Re: Is there a way to make a Super Skirmisher ability?
Teleporting doesn't involve villages at all, unless you add extra code.
You might consider experimenting with
tunnel
and teleport
in a test scenario and compare the results.Here is some code that creates a one-way tunnel from (3,3) to (15,3).
Code: Select all
[tunnel]
[filter]
side=1
[/filter]
[source]
x,y=3,3
[/source]
[target]
x,y=15,3
[/target]
pass_allied_units=no
bidirectional=no
[/tunnel]
Code: Select all
[teleport]
[filter]
id=MyLeader
[/filter]
x,y=20,5
[/teleport]
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: Is there a way to make a Super Skirmisher ability?
There's two different things both called [teleport]: a unit ability, and a direct action.
The direct action version of [teleport] doesn't help here, as far as I know.
The direct action version of [teleport] doesn't help here, as far as I know.
- Celtic_Minstrel
- Developer
- Posts: 2233
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Is there a way to make a Super Skirmisher ability?
A teleport ability just creates tunnels that only the owning unit can pass through. If those tunnels are set to be on villages, then the unit can teleport between villages. If they're set to be on keeps, then the unit can teleport between keeps. If they're set to be on spaces adjacent to an enemy unit that's adjacent to the owner, then the unit can teleport to any unoccupied space adjacent to an adjacent enemy.weewah wrote: ↑November 12th, 2020, 6:42 pm I see that [teleport] allows you to put [tunnel] inside, but I don't quite understand how that works. Also, wouldn't teleport let the unit actually teleport between villages? Is there a way to use it just for tunneling but not for teleporting between villages?
Re: Is there a way to make a Super Skirmisher ability?
For a code example, you might check out the excellent campaign "The Black Cross of Aleron." Some elvish shamans in that campaign can treewalk; that is, teleport between Great Trees.Celtic_Minstrel wrote: ↑November 13th, 2020, 7:29 pmA teleport ability just creates tunnels that only the owning unit can pass through. If those tunnels are set to be on villages, then the unit can teleport between villages. If they're set to be on keeps, then the unit can teleport between keeps. If they're set to be on spaces adjacent to an enemy unit that's adjacent to the owner, then the unit can teleport to any unoccupied space adjacent to an adjacent enemy.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Celtic_Minstrel
- Developer
- Posts: 2233
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Is there a way to make a Super Skirmisher ability?
Yes, my treewalk is indeed another example of what the teleport ability can do.
Re: Is there a way to make a Super Skirmisher ability?
Hmm. I just realized that I don't actually know how to do that.
So I currently have something like:
But I am not sure what to put in the source and target tags. How do I get it to say the unit can teleport from its current location to any location within radius 5?
So I currently have something like:
Code: Select all
#define ABILITY_SUPER_SKIRMISHER
[teleport]
...
[tunnel]
[source]
?
[/source]
[target]
?
[/target]
[/tunnel]
[/teleport]
#enddef
[unit_type]
...
[abilities]
{ABILITY_SUPER_SKIRMISHER}
[/abilities]
[/unit_type]
- Celtic_Minstrel
- Developer
- Posts: 2233
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Is there a way to make a Super Skirmisher ability?
The source and target is the same as any ordinary tunnel, so you have access to the unit as
$teleport_unit
. So, if you want the unit to be able to teleport from anywhere, you could set the source to x,y=$teleport_unit.x,$teleport_unit.y
. If you want a radius, use the same thing for the target and add radius=5
.