Changing a side mid-scenario
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.
Changing a side mid-scenario
So, I've been working on a campaign and I ran into an interesting issue; to make a scenario more difficult, I wanted to give the enemy side more gold and improve it's recruit list, BUT it has to happen at a specific turn event. Ideas?
Re: Changing a side mid-scenario
Like this:
Code: Select all
[event]
name=turn 10
[allow_recruit]
side=2
type="Drake Arbiter,Drake Flare"
[/allow_recruit]
[/event]
[event]
name=turn 30
[gold]
side=2
amount=200
[/gold]
[allow_recruit]
side=2
type="Drake Flameheart"
[/allow_recruit]
[disallow_recruit]
side=2
type="Drake Burner"
[/disallow_recruit]
[/event]
Re: Changing a side mid-scenario
@octalot
Thanks! It looks like it's working!
Thanks! It looks like it's working!
-
- Posts: 153
- Joined: September 5th, 2018, 5:21 pm
- Location: Albania
Re: Changing a side mid-scenario
A question, how do you make so that enemy side becomes your ally mid game.
Competitive Wesnoth. For the fans by the fans.
Re: Changing a side mid-scenario
I don't know the syntax, but I'd guess that you would literally have to change the side.
I've noticed that near the end of a side's script, you have to list a display name for that side, and an ID for that side. I'd guess that you would have to change the ID to match the player's side's ID.
Again though, I have no idea how to do that.
I've noticed that near the end of a side's script, you have to list a display name for that side, and an ID for that side. I'd guess that you would have to change the ID to match the player's side's ID.
Again though, I have no idea how to do that.
Re: Changing a side mid-scenario
My first step would be to try and remember if there were mainline campaigns which had an enemy side change sides.
Legend_of_Wesmere/scenarios/chapter1/02_Hostile_Mountains.cfg has several possible changes for side 3:
The_South_Guard/scenarios/07a_Into_the_Depths.cfg has a neutral side join with you, and all of its units change to side 1. That requires several modifications:
TSG S07a also has the allies leave your team at the end of the scenario:
TSG S05 has an enemy side joining you, the code is similar to TSG S05 but the other parts of the scenario are more complex.
Legend_of_Wesmere/scenarios/chapter1/02_Hostile_Mountains.cfg has several possible changes for side 3:
Code: Select all
[modify_side]
side=3
team_name=player
user_team_name= _ "Player"
[/modify_side]
Code: Select all
[store_villages]
owner_side=5
variable=side_5_villages
[/store_villages]
{MODIFY_UNIT side=5 side 5}
[foreach]
array=side_5_villages
[do]
[capture_village]
x,y=$this_item.x,$this_item.y
side=1
[/capture_village]
[/do]
[/foreach]
{CLEAR_VARIABLE side_5_villages}
[modify_unit]
[filter]
side=5
[/filter]
side=1
[/modify_unit]
Code: Select all
[kill]
side=1
race=troll
[/kill]