Sides
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.
Sides
I was wondering if it was possible to add a unit to a new side (not listed previously). For example, on multiplayer, I want to have an automatic computer-controlled team that comes into the game. However, when I create a 5th side (and set it so that it is automatically controlled by ai), other players can still select that side, and I can't even see it available to manually set to a computer player.
So, what I'm really asking is if I can create a new side in the middle of a multiplayer scenario. Is that possible?
So, what I'm really asking is if I can create a new side in the middle of a multiplayer scenario. Is that possible?
No, currently any side you use must have a starting location.
Btw it's easy to mask in the scenario some starting location, using something like this :
Use this trick with no_leader=yes / canrecruit=0 sides to make additional sides that do not appear at the begining of the scenario.
Btw it's easy to mask in the scenario some starting location, using something like this :
Code: Select all
#define HIDE_STARTUP_LOCATION SIDE REPLACEMENT_TERRAIN
[store_starting_location]
side={SIDE}
variable=starting_location
[/store_starting_location]
[terrain]
x=$starting_location.x
y=$starting_location.y
letter={REPLACEMENT_TERRAIN}
[/terrain]
[clear_variable]
name=starting_location
[/clear_variable]
#enddef
Alright, thanks. This is off my original title's topic, but I've already made a few topics in here, so I'll post my problem in this last one.
The units never appear during their turn...or at all.
What did I do wrong this time?
Code: Select all
[event]
name=side turn
[if]
[variable]
name=turn_number
equals=3
[/variable]
[variable]
name=side_number
equals=5
[/variable]
[then]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=1,2
side=5
[/unit]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=3,3
side=5
[/unit]
[unit]
type=Goblin Knight
description=Fasal
x,y=2,2
side=5
[/unit]
[message]
description=Fasal
message= _ "Bwahaha! Did you really think you had it that easy?! We'll kill you all!"
[/message]
[/then]
[/if]
[if]
[variable]
name=turn_number
equals=6
[/variable]
[variable]
name=side_number
equals=5
[/variable]
[then]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=1,2
side=5
[/unit]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=3,3
side=5
[/unit]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=2,3
side=5
[/unit]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=2,1
side=5
[/unit]
[unit]
type=Goblin Knight
description=Javar
x,y=2,2
side=5
[/unit]
[message]
description=Javar
message= _ "It's time you feel my wrath! Cringe below me in terror!"
[/message]
[/then]
[/if]
[/event]
What did I do wrong this time?

So, something more like this:
Code: Select all
[event]
name=side turn
[if]
[variable]
name=turn_number
equals=3
[/variable]
[and]
[variable]
name=side_number
equals=5
[/variable]
[/and]
[then]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=1,2
side=5
[/unit]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=3,3
side=5
[/unit]
[unit]
type=Goblin Knight
description=Fasal
x,y=2,2
side=5
[/unit]
[redraw]
[message]
description=Fasal
message= _ "Bwahaha! Did you really think you had it that easy?! We'll kill you all!"
[/message]
[/redraw]
[/then]
[/if]
[if]
[variable]
name=turn_number
equals=6
[/variable]
[and
[variable]
name=side_number
equals=5
[/variable]
[/and]
[then]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=1,2
side=5
[/unit]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=3,3
side=5
[/unit]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=2,3
side=5
[/unit]
[unit]
type=Goblin Wolf
generate_description=yes
x,y=2,1
side=5
[/unit]
[unit]
type=Goblin Knight
description=Javar
x,y=2,2
side=5
[/unit]
[redraw]
[message]
description=Javar
message= _ "It's time you feel my wrath! Cringe below me in terror!"
[/message]
[/redraw]
[/then]
[/if]
[/event]
Yes, but [and] is in trunk only, not in the stable version. There you can trick it with
[if]
(variable stuff)
[then]
[if]
(variable stuff)
[then]
(units)
[/then]
[/if]
[/then]
[/if]
General WML question: What happens to an [or] in [and]? Is this possible?
[if]
(variable stuff)
[then]
[if]
(variable stuff)
[then]
(units)
[/then]
[/if]
[/then]
[/if]
General WML question: What happens to an [or] in [and]? Is this possible?
First read, then think. Read again, think again. And then post!
Well, I'm now getting this error when I start multiplayer (but after this message, the server loads and I connect) and the script still doesn't work.
Picture You may need to use the zoom button to view the image properly.
Picture You may need to use the zoom button to view the image properly.
I didn´t mean the files in the wesnoth root directory. I should have articulated clearer, I meant you file where you give the path to the MP scenario, and the scenario file itself (wich you posted)
Then, I found some things.
You can´t set any recruits and names/descriptions in MP. When you start a game, you always have your username, and choose the era.(recruitment!)
This can be fixed when you use this code in the start event:
to disallow all standard units. Then insert an [allow_recruit] and list all the units he should be able to recruit. also you will need this to fix a leader type and a description.
And all this in the start event, as the first.
And then, you always only have [/redraw]. But it should be [redraw] [/redraw]. I know WML is sometimes a bit weird. This may help you somewhere:
#define RERAW
[redraw] [/redraw]
#enddef
And better define things inside your scenario.
And the last I noticed:
I don´t know if this command actually exists, but I´d advice you to use this
or the built-in macro STARTING_VILLAGES SIDE RADIUS to get all villages in a given area.
And about the [element] stuff: I´m quite sure that´s in the file wich tells the wesnoth engine to load the scenario.
Then, I found some things.
You can´t set any recruits and names/descriptions in MP. When you start a game, you always have your username, and choose the era.(recruitment!)
This can be fixed when you use this code in the start event:
Code: Select all
[disallow_recruit]
side=5
type="Bowman,Cavalryman,Horseman,Mage,Heavy Infantryman,Fencer,Spearman,Merman Fighter"
[/disallow_recruit]
[disallow_recruit]
side=5
type="Goblin Spearman,Orcish Grunt,Orcish Archer,Wolf Rider,Troll Whelp,Orcish Assassin,Naga Fighter"
[/disallow_recruit]
[disallow_recruit]
side=5
type="Dwarvish Fighter,Dwarvish Guardsman,Dwarvish Thunderer,Dwarvish Ulfserker,Gryphon Rider,Poacher,Thug,Thief,Footpad"
[/disallow_recruit]
[disallow_recruit]
side=5
type="Elvish Archer,Elvish Fighter,Elvish Scout,Elvish Shaman,Wose,Merman Hunter"
[/disallow_recruit]
[disallow_recruit]
side=5
type="Drake Fighter,Drake Burner,Drake Glider,Drake Clasher,Saurian Skirmisher,Saurian Tribalist"
[/disallow_recruit]
[disallow_recruit]
side=5
type="Dark Adept,Skeleton,Skeleton Archer,Ghoul,Ghost,Vampire Bat,Walking Corpse"
[/disallow_recruit]
Code: Select all
[store_unit]
variable=side_modify
kill=yes
[filter]
side=5
canrecruit=1 #not essential, just to make sure
[/filter]
[/store_unit]
{VARIABLE side_modify.description Barvolis}
{VARIABLE side_modify.type (Orcish Ruler)}
[unstore_unit]
variable=side_modify
[/unstore_unit]
And then, you always only have [/redraw]. But it should be [redraw] [/redraw]. I know WML is sometimes a bit weird. This may help you somewhere:
#define RERAW
[redraw] [/redraw]
#enddef
And better define things inside your scenario.
And the last I noticed:
Code: Select all
[village]
x,y=2,1
[/village]
Code: Select all
#define CAPTURE_VILLAGE SIDE X Y
[capture_village]
side={SIDE}
x,y={X},{Y}
[/capture_village]
#enddef
And about the [element] stuff: I´m quite sure that´s in the file wich tells the wesnoth engine to load the scenario.
First read, then think. Read again, think again. And then post!
Code: Select all
[redraw]
[message]
description=Javar
message= _ "It's time you feel my wrath! Cringe below me in terror!"
[/message]
[/redraw]
Code: Select all
[if]
[variable]
name=turn_number
equals=6
[/variable]
[and
[variable]
name=side_number
equals=5
[/variable]
[/and]

Thanks to both of you.
As for the village tags, it does work in my case and the reason I didn't use a macro is because those villages are on the opposite side of the map. As for the recruit problem, I'll happily see if your solution works, Toms. Thanks for clarifying things guys.
I'm trying to swallow all of this quickly.
As for the village tags, it does work in my case and the reason I didn't use a macro is because those villages are on the opposite side of the map. As for the recruit problem, I'll happily see if your solution works, Toms. Thanks for clarifying things guys.
I'm trying to swallow all of this quickly.
