Random terrain in MP
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.
Random terrain in MP
Is it possible to use random terrain change in multiplayer that does not require all players have downloaded that map?
Best would be 8 options with equal chance.
Best would be 8 options with equal chance.
- alexanderthegre
- Posts: 193
- Joined: December 8th, 2011, 3:23 am
- Location: nowhere
Re: Random terrain in MP
I haven't tested any of this, but it might be of use.
Code: Select all
#Change a specified area to a terrain type
[set_variable]
name=random_dummy
rand=1..8
[/set_variable]
[switch]
variable=$random_dummy
[case]
value=1
[terrain]
[filter]
#Filter
[/filter]
terrain=#Code to change it to
[/terrain]
[/case]
#Add more [case]s as necessary.
[/switch]
Code: Select all
#Change the whole map to a new one
[set_variable]
name=random_dummy
rand=1..8
[/set_variable]
[switch]
variable=$random_dummy
[case]
value=1
[replace_map]
map=#path to your new map
expand=yes
shrink=yes
[/replace_map]
[/case]
#etc.
[/switch]
Re: Random terrain in MP
Code: Select all
[event]
name=side 6 turn end
first_time_only=no
[set_variable]
name=random_dummy
rand=1..8
[/set_variable]
[switch]
variable=$random_dummy
[case]
value=1
[terrain]
[filter]
x,y=8,5
[/filter]
terrain=Mm
[/terrain]
[/case]
[case]
value=2
[terrain]
[filter]
x,y=8,5
[/filter]
terrain=Uu
[/terrain]
[/case] [case]
value=3
[terrain]
[filter]
x,y=8,5
[/filter]
terrain=Wwt
[/terrain]
[/case] [case]
value=4
[terrain]
[filter]
x,y=8,5
[/filter]
terrain=Hh
[/terrain]
[/case] [case]
value=5
[terrain]
[filter]
x,y=8,5
[/filter]
terrain=Kud
[/terrain]
[/case] [case]
value=6
[terrain]
[filter]
x,y=8,5
[/filter]
terrain=Dd
[/terrain]
[/case] [case]
value=7
[terrain]
[filter]
x,y=8,5
[/filter]
terrain=Gs^Fds
[/terrain]
[/case] [case]
value=8
[terrain]
[filter]
x,y=8,5
[/filter]
terrain=Aa
[/terrain]
[/case]
[/switch]
[/event]
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Random terrain in MP
Your problem isn't about randomness, it's about usage of custom terrain. You *cannot* use any custom terrain or units in a multiplayer addon if you do not want to require users to have downloaded the addon to save themselves from getting kicked due to unknown terrain/unit type.
EDIT
Above replies to your original post. For the rest see Ceres.
EDIT
Above replies to your original post. For the rest see Ceres.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Random terrain in MP
Code: Select all
variable=$random_dummy
$
" there, because you want the variable name, not the variable's value.Code: Select all
[terrain]
[filter]
x,y=8,5
[/filter]
terrain=Mm
[/terrain]
Code: Select all
[/case] [case]
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: Random terrain in MP
That is not custom terrain, that is random terrain from list of terrains in core files.
Thanks, now it works
Thanks, now it works