Change units side
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.
Change units side
Hey everyone!
Is there a way to change the side of the units (including the leader)?
To be precise, I want a particular side (say side 1) to acquire all the units of another side (for example, side 2), including the leader. I also want that the death of the leader of the acquired side causes the defeat of the player. I already have a defeat condition for this: is this enough, or should something more be done since we are changing the side of the leader himself of that side?
Thanks in advance for all the suggestions.
Is there a way to change the side of the units (including the leader)?
To be precise, I want a particular side (say side 1) to acquire all the units of another side (for example, side 2), including the leader. I also want that the death of the leader of the acquired side causes the defeat of the player. I already have a defeat condition for this: is this enough, or should something more be done since we are changing the side of the leader himself of that side?
Thanks in advance for all the suggestions.
- Lord-Knightmare
- Discord Moderator
- Posts: 2359
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: Change units side
You know, most of problems are solvable by reading the WML documentation.
For example this:
For example this:
Is this:To be precise, I want a particular side (say side 1) to acquire all the units of another side (for example, side 2), including the lead
Code: Select all
{MODIFY_UNIT (side=2) side 1}
Yes. It is.. I already have a defeat condition for this: is this enough,
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
- Celtic_Minstrel
- Developer
- Posts: 2207
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Change units side
If by "defeat condition" you mean the
defeat_condition
key in [side]
, then no, that's not enough. That'll result in defeat when both leaders die, but not when only one leader dies.If by "defeat condition" you mean a death event, then yes, that's enough.
Re: Change units side
You know, maybe did I already consult the WML documentation but didn't find what I was looking for?Lord-Knightmare wrote: ↑December 2nd, 2022, 2:00 pm You know, most of problems are solvable by reading the WML documentation.
Thanks for the snippet, I'll try it.For example this:Is this:To be precise, I want a particular side (say side 1) to acquire all the units of another side (for example, side 2), including the leadCode: Select all
{MODIFY_UNIT (side=2) side 1}
Re: Change units side
This is how I would do it.
I included
[not]
to exclude a type of unit.Change the
name=turn 3
to whatever happened that triggered the event.Code: Select all
[event]
name=turn 3
[modify_unit]
[filter]
side=2
[not]
type=Giant Rat, Ogre
[/not]
[/filter]
side=1
[/modify_unit]
[/event]
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: Change units side
That's a fine approach! I like it a lot, especially the way to personalize which units include or are not in the change process.Helmet wrote: ↑December 5th, 2022, 3:33 pmThis is how I would do it.
I included[not]
to exclude a type of unit.
Change thename=turn 3
to whatever happened that triggered the event.
Code: Select all
[event] name=turn 3 [modify_unit] [filter] side=2 [not] type=Giant Rat, Ogre [/not] [/filter] side=1 [/modify_unit] [/event]
I will use this one!
Thanks a lot!
Re: Change units side
I'm glad it was useful, and thanks for the update. When I'm reading old threads and the OP doesn't post again, I always wonder, "Did they ever solve their problem?"
If you get stuck again and the Wiki isn't helping, don't hesitate to post another question. I often find myself stuck, so I know firsthand how useful this forum is. I'm probably one of the Top 10 question-askers!
If you plan to upload your completed campaign to the add-on server and you're not sure what to do, my "DIY Campaign" has a pretty good explanation how to do it, conveyed using "story" text in the first scenario.
Good luck with the WML.
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: Change units side
Thanks a lot for your kindness! Sorry, but sometimes I lag to reply (even to my questions!) due to real life. I confirm that your solution helped me a lot!Helmet wrote: ↑December 6th, 2022, 5:05 pmI'm glad it was useful, and thanks for the update. When I'm reading old threads and the OP doesn't post again, I always wonder, "Did they ever solve their problem?"
If you get stuck again and the Wiki isn't helping, don't hesitate to post another question. I often find myself stuck, so I know firsthand how useful this forum is. I'm probably one of the Top 10 question-askers!
If you plan to upload your completed campaign to the add-on server and you're not sure what to do, my "DIY Campaign" has a pretty good explanation how to do it, conveyed using "story" text in the first scenario.
Good luck with the WML.
Thanks also for your availability and for your time answering my questions! I've always been a fan of Wesnoth, and now that I'm learning WML to create my levels, it's so funny and engaging. The WML documentation and especially this forum are great resources!
And, of course, when I'll complete my campaign, I'll download your tutorial campaign to upload it on the add-on server. What a neat idea you had to instruct those who need to upload finished works.