A way to make some units or all units unable to conquer?
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.
A way to make some units or all units unable to conquer?
In my era i want that only some units or no units (depending on what´s easier) to be able to change the side of a village terrain.
I want to make something like a modified version of a new land. Where you build terrain tiles and they are of your own. But i don´t want the opponent or anyone to be able to conquer it. I can´t figure a way because i want the tile to be counted as a village, but i don´t want player interaction to change who owns the village. I hope I made myself clear.
I want to make something like a modified version of a new land. Where you build terrain tiles and they are of your own. But i don´t want the opponent or anyone to be able to conquer it. I can´t figure a way because i want the tile to be counted as a village, but i don´t want player interaction to change who owns the village. I hope I made myself clear.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: A way to make some units or all units unable to conquer?
Possible, I think, but complicated. You can use owner_side in [filter_location] to create a list of who owns each village. Then, on each capture event, you can use [capture_village] to immediately give the village back to its previous owner. That should work. You could also filter the capture event to only fire for some units.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: A way to make some units or all units unable to conquer?
Code: Select all
[event]
name="side turn"
first_time_only=no
[store_villages]
[not]
owner_side=$side_number
[/not]
variable=unowned_villages
[/store_villages]
[/event]
[event]
name="capture"
first_time_only=no
[filter]
type=BadUnitType # CHANGE THIS
[filter_location]
find_in=unowned_villages
[/filter_location]
[/filter]
{FOREACH unowned_villages i}
[if]
[variable]
name=unowned_villages[$i].x
equals=$x1
[/variable]
[variable]
name=unowned_villages[$i].y
equals=$y1
[/variable]
[then]
[capture_village]
x,y=$x1,$y1
side=$unowned_villages[$i].owner_side
[/capture_village]
[/then]
[/if]
{NEXT i}
[/event]
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: A way to make some units or all units unable to conquer?
I didn´t test it yet but thank you very much for the extense reply