ChaosRider’s WML questions
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.
Re: Road Code...
Code: Select all
[while]
[variable]
name=TerrainX1
not_equals={X2}
[/variable]
[or]
[variable]
name=TerrainY1
not_equals={Y2}
[/variable]
[/or]
[do]
...
[/do]
[/while]
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
Re: Road Code...
Ok! All codes for 3 roads works well, you can see how they are working in addon ONLY_RM_RC (they are used in maps with bigger size than 20, maps with lower size arent enought big to use them as for me).
1. Code for road from north to south:
2. Code for road from north west to south east:
3. Last code for road from south west to north east:
I am using them all in my maps, one by another (1,2,3 - in first code i am picking road type, so in other two they are blocked by this #).
1. Code for road from north to south:
Code: Select all
#define ROAD1_ONLY_RM_CR X1 Y1 X2 Y2 ZmiennaWychylu
[set_variable]
name=PickedRoad
rand=1..8
[/set_variable]
[switch]
variable=PickedRoad
[case]
value=1
[set_variable]
name=TerrainType
value=Urb
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Rrc
[/set_variable]
[/case]
[case]
value=3
[set_variable]
name=TerrainType
value=Rb
[/set_variable]
[/case]
[case]
value=4
[set_variable]
name=TerrainType
value=Rd
[/set_variable]
[/case]
[case]
value=5
[set_variable]
name=TerrainType
value=Re
[/set_variable]
[/case]
[case]
value=6
[set_variable]
name=TerrainType
value=Rr
[/set_variable]
[/case]
[case]
value=7
[set_variable]
name=TerrainType
value=Ur
[/set_variable]
[/case]
[case]
value=8
[set_variable]
name=TerrainType
value=Rp
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
value={X1}
[/set_variable]
[set_variable]
name=TerrainX2
value={X2}
[/set_variable]
[set_variable]
name=TerrainY1
value={Y1}
[/set_variable]
[set_variable]
name=TerrainY2
value={Y2}
[/set_variable]
[terrain]
x=$TerrainX1
y=$TerrainY1
terrain=$TerrainType
[/terrain]
[while]
[variable]
name=TerrainY1
not_equals={Y2}
[/variable]
[do]
[set_variable]
name=LicznikPetli
add=1
[/set_variable]
[if]
[variable]
name={X1}
less_than=$TerrainX1
[/variable]
[then]
[set_variable]
name=checkingX1
value=$TerrainX1
[/set_variable]
[set_variable]
name=checkingX1
sub={X1}
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=TerrainX1
less_than={X1}
[/variable]
[then]
[set_variable]
name=checkingX1
value={X1}
[/set_variable]
[set_variable]
name=checkingX1
sub=$TerrainX1
[/set_variable]
[/then]
[/if]
[set_variable]
name=checkingY1
value={Y2}
[/set_variable]
[set_variable]
name=checkingY1
sub=$TerrainY1
[/set_variable]
[if]
[variable]
name=checkingX1
less_than=$checkingY1
[/variable]
[then]
[set_variable]
name=PickedChanges
rand=1..12
[/set_variable]
[switch]
variable=PickedChanges
[case]
value=1,2,3,4,5
[switch]
variable=TerrainX1
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
sub=1
[/set_variable]
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=checkingX2
value={X1}
[/set_variable]
[set_variable]
name=checkingX2
sub={ZmiennaWychylu}
[/set_variable]
[if]
[variable]
name=TerrainX1
less_than=$checkingX2
[/variable]
[then]
[if]
[variable]
name=checkingX1
less_than=$checkingY1
[/variable]
[then]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/then]
[/if]
[/case]
[case]
value=6,7,8,9,10
[switch]
variable=TerrainX1
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=checkingX2
value={X1}
[/set_variable]
[set_variable]
name=checkingX2
add={ZmiennaWychylu}
[/set_variable]
[if]
[variable]
name=TerrainX1
greater_than=$checkingX2
[/variable]
[then]
[if]
[variable]
name=checkingX1
less_than=$checkingY1
[/variable]
[then]
[set_variable]
name=TerrainX1
sub=1
[/set_variable]
[/then]
[/if]
[/then]
[/if]
[/case]
[case]
value=11,12
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/case]
[/switch]
[/then]
[else]
[if]
[variable]
name=TerrainX1
not_equals={X1}
[/variable]
[then]
[if]
[variable]
name=TerrainX1
greater_than={X1}
[/variable]
[then]
[set_variable]
name=TerrainX1
sub=1
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=TerrainX1
less_than={X1}
[/variable]
[then]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/then]
[else]
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/else]
[/if]
[/else]
[/if]
#[terrain]
# x=$TerrainX1
# y=$TerrainY1
# terrain=Urb
#[/terrain]
[terrain]
x=$TerrainX1
y=$TerrainY1
terrain=$TerrainType
[/terrain]
[if]
[variable]
name=LicznikPetli
greater_than=500
[/variable]
[then]
[set_variable]
name=TerrainX1
value={X2}
[/set_variable]
[set_variable]
name=TerrainY1
value={Y2}
[/set_variable]
[/then]
[/if]
[/do]
[/while]
{CLEAR_VARIABLE TerrainX1}
{CLEAR_VARIABLE TerrainX2}
{CLEAR_VARIABLE TerrainY1}
{CLEAR_VARIABLE TerrainY2}
{CLEAR_VARIABLE SrodekX}
{CLEAR_VARIABLE SrodekY}
{CLEAR_VARIABLE checkingX1}
{CLEAR_VARIABLE checkingX2}
{CLEAR_VARIABLE checkingY1}
{CLEAR_VARIABLE checkingY2}
{CLEAR_VARIABLE PickedChanges}
#enddef
Code: Select all
#define ROAD2_ONLY_RM_CR X1 Y1 X2 Y2 ZmiennaWychylu
#[set_variable]
# name=PickedRoad
# rand=1..8
#[/set_variable]
#[switch]
# variable=PickedRoad
# [case]
# value=1
# [set_variable]
# name=TerrainType
# value=Urb
# [/set_variable]
# [/case]
# [case]
# value=2
# [set_variable]
# name=TerrainType
# value=Rrc
# [/set_variable]
# [/case]
# [case]
# value=3
# [set_variable]
# name=TerrainType
# value=Rb
# [/set_variable]
# [/case]
# [case]
# value=4
# [set_variable]
# name=TerrainType
# value=Rd
# [/set_variable]
# [/case]
# [case]
# value=5
# [set_variable]
# name=TerrainType
# value=Re
# [/set_variable]
# [/case]
# [case]
# value=6
# [set_variable]
# name=TerrainType
# value=Rr
# [/set_variable]
# [/case]
# [case]
# value=7
# [set_variable]
# name=TerrainType
# value=Ur
# [/set_variable]
# [/case]
# [case]
# value=8
# [set_variable]
# name=TerrainType
# value=Rp
# [/set_variable]
# [/case]
#[/switch]
[set_variable]
name=TerrainX1
value={X1}
[/set_variable]
[set_variable]
name=TerrainX2
value={X2}
[/set_variable]
[set_variable]
name=TerrainY1
value={Y1}
[/set_variable]
[set_variable]
name=TerrainY2
value={Y2}
[/set_variable]
[set_variable]
name=SrodekX
value={X1}
[/set_variable]
[set_variable]
name=SrodekY
value={Y1}
[/set_variable]
[terrain]
x=$TerrainX1
y=$TerrainY1
terrain=$TerrainType
[/terrain]
[while]
[variable]
name=TerrainX1
not_equals={X2}
[/variable]
[or]
[variable]
name=TerrainY1
not_equals={Y2}
[/variable]
[/or]
[do]
[set_variable]
name=LicznikPetli
add=1
[/set_variable]
[set_variable]
name=checkingY1
value={X2}
[/set_variable]
[if]
[variable]
name=TerrainX1
equals=$SrodekX
[/variable]
[then]
[set_variable]
name=checkingX1
value=$TerrainY1
[/set_variable]
[set_variable]
name=checkingX1
sub=$SrodekY
[/set_variable]
[set_variable]
name=checkingY1
sub=$TerrainY1
[/set_variable]
[set_variable]
name=checkingY1
add=$SrodekY
[/set_variable]
[set_variable]
name=checkingY1
sub=$SrodekX
[/set_variable]
[/then]
[else]
[if]
[variable]
name=TerrainX1
greater_than=$SrodekX
[/variable]
[then]
[set_variable]
name=checkingX1
value=$TerrainX1
[/set_variable]
[set_variable]
name=checkingX1
sub=$SrodekX
[/set_variable]
[set_variable]
name=checkingY1
sub=$TerrainX1
[/set_variable]
[/then]
[/if]
[/else]
[/if]
#Sprawdzam odległość od krańca mapy
[if]
[variable]
name=checkingY1
greater_than=0
[/variable]
[then]
[if]
[variable]
name=checkingX1
less_than=$checkingY1
[/variable]
#odleglosc od srodkax zmiennej x jest mniejsza od odleglosci srodkay od koncowego y
[then]
[set_variable]
name=PickedChanges
rand=1..12
[/set_variable]
[if]
[variable]
name=TerrainX1
greater_than=$SrodekX
[/variable]
#Tu sprawdzam czy jest to górna część mapki
[then]
[if]
[variable]
name=TerrainY1
greater_than=$SrodekY
[/variable]
#upewniam się że nie jest to środek lini mapy
[then]
[switch]
variable=PickedChanges
[case]
value=1,2,3,4,5
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
#upewniam się czy nie wyjdzie droga za bardzo
[then]
[if]
[variable]
name=TerrainX1
less_than={X2}
[/variable]
[then]
[switch]
variable=TerrainX1
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/then]
[/if]
[/case]
#rownolegle do lini mapy
[case]
value=6,7
[if]
[variable]
name=TerrainX1
less_than={X2}
[/variable]
[then]
[switch]
variable=TerrainX1
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/case]
#w dol po ukosie
[case]
value=8,9,10,11,12
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/case]
[/switch]
[/then]
[else]
[if]
[variable]
name=TerrainX1
greater_than=$SrodekX
[/variable]
# tutaj się upewniam że nie uciekną mi wyjątki w których X jest większy od srodek x a y jest taki sam jak w srodek y
[then]
[switch]
variable=PickedChanges
[case]
value=1,2,3,4,5
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
#upewniam się czy nie wyjdzie droga za bardzo
[then]
[if]
[variable]
name=TerrainX1
less_than={X2}
[/variable]
[then]
[switch]
variable=TerrainX1
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/then]
[/if]
[/case]
#rownolegle do lini mapy
[case]
value=6,7
[if]
[variable]
name=TerrainX1
less_than={X2}
[/variable]
[then]
[switch]
variable=TerrainX1
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/case]
#w dol po ukosie
[case]
value=8,9,10,11,12
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[/else]
[/if]
[/then]
#ponizej lini mapy
[else]
[if]
[variable]
name=TerrainX1
equals=$SrodekX
[/variable]
[then]
[if]
[variable]
name=TerrainY1
not_equals=$SrodekY
[/variable]
#czy nie jest to na lini mapy
[then]
[switch]
variable=PickedChanges
[case]
value=1,2,3,4,5
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/case]
[case]
value=6,7
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
add=1
[/set_variable]
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/case]
# w dol po ukosie od lini mapy
[case]
value=8,9,10,11,12
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
[then]
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/then]
[/if]
[/case]
[/switch]
[/then]
# na lini mapy
[else]
[switch]
variable=PickedChanges
[case]
value=1,2,3,4,5
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/case]
# rownolegle na lini mapy i na lini mapy
[case]
value=6,7
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/case]
#w dol na lini mapy
[case]
value=8,9,10,11,12
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/case]
[/switch]
[/else]
[/if]
[/then]
[/if]
[/else]
[/if]
[/then]
#tutaj wiem że wychylenie jest większe od odległości zmiennej miejscowej Y odjętej od Y końcowego
[else]
[set_variable]
name=PickedChanges
rand=1..12
[/set_variable]
[if]
[variable]
name=TerrainX1
greater_than=$SrodekX
[/variable]
#Tu sprawdzam czy jest to górna część mapki
[then]
[if]
[variable]
name=TerrainY1
less_than=$SrodekY
[/variable]
#upewniam się że nie jest to środek lini mapy
[then]
[switch]
variable=PickedChanges
[case]
value=1,2
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
#upewniam się czy nie wyjdzie droga za bardzo
[then]
[if]
[variable]
name=TerrainX1
less_than={X2}
[/variable]
[then]
[switch]
variable=TerrainX1
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/then]
[/if]
[/case]
#rownolegle do lini mapy
[case]
value=3,4,5,6,7
[if]
[variable]
name=TerrainX1
less_than={X2}
[/variable]
[then]
[switch]
variable=TerrainX1
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/case]
#w dol po ukosie
[case]
value=8,9,10,11,12
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/case]
[/switch]
[/then]
[else]
[if]
[variable]
name=TerrainX1
greater_than=$SrodekX
[/variable]
# tutaj się upewniam że nie uciekną mi wyjątki w których X jest większy od srodek x a y jest taki sam jak w srodek y
[then]
[switch]
variable=PickedChanges
[case]
value=1,2
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
#upewniam się czy nie wyjdzie droga za bardzo
[then]
[switch]
variable=TerrainX1
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/case]
#rownolegle do lini mapy
[case]
value=3,4,5,6,7
[switch]
variable=TerrainX1
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/case]
#w dol po ukosie
[case]
value=8,9,10,11,12
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[/else]
[/if]
[/then]
#ponizej lini mapy
[else]
[if]
[variable]
name=TerrainY1
not_equals=$SrodekY
[/variable]
#czy nie jest to na lini mapy
[then]
[switch]
variable=PickedChanges
[case]
value=1,2,3,4,5
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/case]
[case]
value=6,7,8,9,10
[set_variable]
name=checkingY2
value=$TerrainY1
[/set_variable]
[set_variable]
name=checkingY2
sub=$SrodekY
[/set_variable]
[set_variable]
name=checkingY2
add=$TerrainX1
[/set_variable]
[if]
[variable]
name=checkingY2
less_than={X2}
[/variable]
[then]
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
add=1
[/set_variable]
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/case]
# w dol po ukosie od lini mapy
[case]
value=11,12
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
[then]
[if]
[variable]
name=checkingY1
greater_than=0
[/variable]
[then]
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/then]
[/if]
[/then]
[/if]
[/case]
[/switch]
[/then]
# na lini mapy
[else]
[switch]
variable=PickedChanges
[case]
value=1,2,3,4
[switch]
variable=TerrainX1
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/case]
# rownolegle na lini mapy i na lini mapy
[case]
value=5,6,7,8
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/case]
#w dol na lini mapy
[case]
value=9,10,11,12
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/case]
[/switch]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
[/then]
#Jeżeli jestesmy przy krawedziach koncowych naszej trasy trzeba sprawdzic ktora to
[else]
[if]
[variable]
name=TerrainX1
greater_than=$SrodekX
[/variable]
#krawedz mapy na polnocnej stronie
[then]
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/then]
[else]
[if]
[variable]
name=TerrainX1
equals=$SrodekX
[/variable]
[then]
[switch]
variable=TerrainX1
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=SrodekY
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/then]
[/if]
[/else]
[/if]
[/else]
[/if]
[terrain]
x=$TerrainX1
y=$TerrainY1
terrain=$TerrainType
[/terrain]
[if]
[variable]
name=TerrainX1
greater_than={X2}
[/variable]
[then]
[set_variable]
name=TerrainX1
value={X2}
[/set_variable]
[if]
[variable]
name=TerrainY1
greater_than={Y2}
[/variable]
[then]
[set_variable]
name=TerrainY1
value={Y2}
[/set_variable]
[/then]
[/if]
[/then]
[/if]
[if]
[variable]
name=LicznikPetli
greater_than=500
[/variable]
[then]
[set_variable]
name=TerrainX1
value={X2}
[/set_variable]
[set_variable]
name=TerrainY1
value={Y2}
[/set_variable]
[/then]
[/if]
[/do]
[/while]
{CLEAR_VARIABLE TerrainX1}
{CLEAR_VARIABLE TerrainX2}
{CLEAR_VARIABLE TerrainY1}
{CLEAR_VARIABLE TerrainY2}
{CLEAR_VARIABLE SrodekX}
{CLEAR_VARIABLE SrodekY}
{CLEAR_VARIABLE checkingX1}
{CLEAR_VARIABLE checkingX2}
{CLEAR_VARIABLE checkingY1}
{CLEAR_VARIABLE checkingY2}
{CLEAR_VARIABLE PickedChanges}
{CLEAR_VARIABLE LicznikPetli}
#enddef
Code: Select all
#define ROAD3_ONLY_RM_CR X1 Y1 X2 Y2 ZmiennaWychylu
#[set_variable]
# name=PickedRoad
# rand=1..8
#[/set_variable]
#[switch]
# variable=PickedRoad
# [case]
# value=1
# [set_variable]
# name=TerrainType
# value=Urb
# [/set_variable]
# [/case]
# [case]
# value=2
# [set_variable]
# name=TerrainType
# value=Rrc
# [/set_variable]
# [/case]
# [case]
# value=3
# [set_variable]
# name=TerrainType
# value=Rb
# [/set_variable]
# [/case]
# [case]
# value=4
# [set_variable]
# name=TerrainType
# value=Rd
# [/set_variable]
# [/case]
# [case]
# value=5
# [set_variable]
# name=TerrainType
# value=Re
# [/set_variable]
# [/case]
# [case]
# value=6
# [set_variable]
# name=TerrainType
# value=Rr
# [/set_variable]
# [/case]
# [case]
# value=7
# [set_variable]
# name=TerrainType
# value=Ur
# [/set_variable]
# [/case]
# [case]
# value=8
# [set_variable]
# name=TerrainType
# value=Rp
# [/set_variable]
# [/case]
#[/switch]
[set_variable]
name=TerrainX1
value={X1}
[/set_variable]
[set_variable]
name=TerrainX2
value={X2}
[/set_variable]
[set_variable]
name=TerrainY1
value={Y1}
[/set_variable]
[set_variable]
name=TerrainY2
value={Y2}
[/set_variable]
[set_variable]
name=SrodekX
value={X1}
[/set_variable]
[set_variable]
name=SrodekY
value={Y1}
[/set_variable]
[terrain]
x=$TerrainX1
y=$TerrainY1
terrain=$TerrainType
[/terrain]
[while]
[variable]
name=TerrainX1
not_equals={X2}
[/variable]
[or]
[variable]
name=TerrainY1
not_equals={Y2}
[/variable]
[/or]
[do]
[set_variable]
name=LicznikPetli
add=1
[/set_variable]
[set_variable]
name=checkingY1
value={X2} #65
[/set_variable]
[if]
[variable]
name=TerrainX1
equals=$SrodekX
[/variable]
[then]
[set_variable]
name=checkingX1
value=$SrodekY
[/set_variable]
[set_variable]
name=checkingX1
sub=$TerrainY1
[/set_variable]
[set_variable]
name=checkingY1
sub=$SrodekX
[/set_variable]
[/then]
[else]
[if]
[variable]
name=TerrainX1
greater_than=$SrodekX
[/variable]
[then]
[set_variable]
name=checkingX1
value=$TerrainX1
[/set_variable]
[set_variable]
name=checkingX1
sub=$SrodekX
[/set_variable]
[set_variable]
name=checkingY1
sub=$SrodekX
[/set_variable]
[/then]
[/if]
[/else]
[/if]
#Sprawdzam czy nie jestem przy krawędzi mapy
[set_variable]
name=checkingX2
value=$checkingY1
[/set_variable]
[set_variable]
name=checkingX2
sub=$checkingX1
[/set_variable]
[if]
[variable]
name=checkingX2
not_equals=0
[/variable]
[then]
[set_variable]
name=PickedChanges
rand=1..12
[/set_variable]
#czy jest powyżej lini środkowej mapy
[if]
[variable]
name=TerrainX1
equals=$SrodekX
[/variable]
[then]
#czy na pewno jest powyżej lini mapy sprawdzajac poprzez Y'ki
[if]
[variable]
name=TerrainY1
less_than=$SrodekY
[/variable]
[then]
[switch]
variable=PickedChanges
[case]
value=1,2
# w góre po ukosie od środkowej lini mapy
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
[then]
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/then]
[/if]
[/case]
[case]
value=6,7
#rownolegle do lini mapy
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[set_variable]
name=SrodekY
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/case]
[case]
value=8,9,10,11,12
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
[then]
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/case]
[/switch]
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=SrodekY
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/case]
[/switch]
[/then]
[else]
[if]
[variable]
name=TerrainY1
equals=$SrodekY
[/variable]
[then]
[switch]
variable=PickedChanges
[case]
value=1,2,3,4,5
# w góre po ukosie od środkowej lini mapy
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
[then]
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/then]
[/if]
[/case]
[case]
value=6,7
#rownolegle do lini mapy
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[set_variable]
name=SrodekY
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/case]
[case]
value=8,9,10,11,12
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
[then]
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/case]
[/switch]
[/then]
[/if]
[/else]
[/if]
[/then]
[else]
[if]
[variable]
name=TerrainX1
greater_than=$SrodekX
[/variable]
[then]
[if]
[variable]
name=TerrainY1
greater_than_equal_to=$SrodekY
[/variable]
[then]
[switch]
variable=PickedChanges
[case]
value=1,2,3,4,5
# w góre po ukosie od środkowej lini mapy
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
[then]
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=SrodekY
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/then]
[/if]
[/case]
[case]
value=6,7
#rownolegle do lini mapy
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=SrodekY
sub=1
[/set_variable]
[/case]
[/switch]
[switch]
variable=TerrainX1
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/case]
[case]
value=8,9,10,11,12
[if]
[variable]
name=checkingX1
less_than={ZmiennaWychylu}
[/variable]
[then]
[switch]
variable=TerrainX1
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/case]
[/switch]
[/then]
[/if]
[/then]
[/if]
[/else]
[/if]
[/then]
[else]
[if]
[variable]
name=checkingX2
equals=0
[/variable]
[then]
[if]
[variable]
name=TerrainX1
equals=$SrodekX
[/variable]
[then]
[if]
[variable]
name=TerrainY1
less_than=$SrodekY
[/variable]
[then]
[switch]
variable=SrodekX
[case]
value=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
[set_variable]
name=TerrainY1
add=1
[/set_variable]
[/case]
[/switch]
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=SrodekY
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[set_variable]
name=TerrainX1
add=1
[/set_variable]
[/then]
[/if]
[/then]
[else]
[if]
[variable]
name=TerrainX1
greater_than=$SrodekX
[/variable]
[then]
[if]
[variable]
name=TerrainY1
greater_than_equal_to=$SrodekY
[/variable]
[then]
[switch]
variable=SrodekX
[case]
value=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65
[set_variable]
name=SrodekY
sub=1
[/set_variable]
[/case]
[/switch]
[set_variable]
name=TerrainY1
sub=1
[/set_variable]
[set_variable]
name=SrodekX
add=1
[/set_variable]
[/then]
[/if]
[/then]
[/if]
[/else]
[/if]
[/then]
[/if]
[/else]
[/if]
[terrain]
x=$TerrainX1
y=$TerrainY1
terrain=$TerrainType
[/terrain]
[if]
[variable]
name=LicznikPetli
greater_than=500
[/variable]
[then]
[set_variable]
name=TerrainX1
value={X2}
[/set_variable]
[set_variable]
name=TerrainY1
value={Y2}
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=TerrainX1
not_equals={X2}
[/variable]
[and]
[variable]
name=TerrainY1
not_equals={Y2}
[/variable]
[/and]
[then]
[if]
[variable]
name=SrodekX
greater_than=$TerrainX1
[/variable]
[then]
[set_variable]
name=SrodekX
value=$TerrainX1
[/set_variable]
[/then]
[/if]
[/then]
[/if]
[/do]
[/while]
{CLEAR_VARIABLE TerrainX1}
{CLEAR_VARIABLE TerrainX2}
{CLEAR_VARIABLE TerrainY1}
{CLEAR_VARIABLE TerrainY2}
{CLEAR_VARIABLE SrodekX}
{CLEAR_VARIABLE SrodekY}
{CLEAR_VARIABLE checkingX1}
{CLEAR_VARIABLE checkingX2}
{CLEAR_VARIABLE checkingY1}
{CLEAR_VARIABLE checkingY2}
{CLEAR_VARIABLE PickedChanges}
{CLEAR_VARIABLE PickedRoad}
#enddef
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
About terrain code.
Hi! I just create 3 codes for roads (from north to south, north/west to south/east and south/west to north/east) and i wish to upgrade it a bit. For that i need to know how to check what type of terrain is already used in x,y. If i will be able to know on which type of terrain i want to create my road terrain then i will be able to change variable value which have road type.
x,y =$TerrainX1,$TerrainY1 - my variables thx to which i know in which place my road is bulding
PickedRoad - variable which have randomly chosen hex type for road (one of Urb,Rrc,Rb,Rd,Re,Rr,Ur,Rp).
x,y =$TerrainX1,$TerrainY1 - my variables thx to which i know in which place my road is bulding
PickedRoad - variable which have randomly chosen hex type for road (one of Urb,Rrc,Rb,Rd,Re,Rr,Ur,Rp).
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
Re: About terrain code.
So this part of code is written well and should works ?
Code: Select all
[if]
[terrain]
x=$TerrainX1
y=$TerrainY1
terrain=Ww # or Wwt
[/terrain]
[then]
[set_variable]
name=TerrainType
value=Ww^Bw/
[/set_variable]
[/then]
[/if]
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
Re: About terrain code.
No.ChaosRider wrote:So this part of code is written well and should works ?
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
Re: About terrain code.
Ok, so why this isnt working well ? That code is not changing value of variable TerrainType which is used in creating road in TerrainX1,TerrainY1.
Code: Select all
#define ROAD_CHECKING_NORTH_SOUTH_ONLY_RM_CR
[store_locations]
x,y=$TerrainX1,$TerrainY1
variable=stored_location
[/store_locations]
{DEBUG_MSG "stored_location_terrain is $stored_location_terrain.terrain"}
[if]
[variable]
name=stored_location_terrain.terrain
equals=W*
[/variable]
[then]
[set_variable]
name=RandomVariable
rand=1..2
[/set_variable]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Wot
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wot^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wot^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Wog
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wog^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wog^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Wo
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wo^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wo^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Wwg
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwg^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwg^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Ww
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Ww^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Ww^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Ww^Ewf
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Ww^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Ww^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Ww^Ewl
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Ww^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Ww^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Wwt
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwt^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwt^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Wwf
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwf^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwf^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Wwrg
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwrg^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwrg^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Wwr
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwr^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwr^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Wwrt
[/variable]
[then]
[set_variable]
name=TerrainType
value=Wwrt^Bw|
[/set_variable]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwrt^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwrt^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Ss
[/variable]
[then]
[set_variable]
name=RandomVariable
rand=1..2
[/set_variable]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Ss^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Ss^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Sm
[/variable]
[then]
[set_variable]
name=RandomVariable
rand=1..2
[/set_variable]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Sm^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Sm^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Ce
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ce
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Cea
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cea
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Co
[/variable]
[then]
[set_variable]
name=TerrainType
value=Co
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Coa
[/variable]
[then]
[set_variable]
name=TerrainType
value=Coa
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Ch
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ch
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Cha
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cha
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Cv
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cv
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Cud
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cud
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Chr
[/variable]
[then]
[set_variable]
name=TerrainType
value=Chr
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Chw
[/variable]
[then]
[set_variable]
name=TerrainType
value=Chw
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Chs
[/variable]
[then]
[set_variable]
name=TerrainType
value=Chs
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Cd
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cd
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Cdr
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cdr
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Ke
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ke
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Ket
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ket
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Kea
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kea
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Ko
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ko
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Koa
[/variable]
[then]
[set_variable]
name=TerrainType
value=Koa
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Kh
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kh
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Kha
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kha
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Kv
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kv
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Kud
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kud
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Khr
[/variable]
[then]
[set_variable]
name=TerrainType
value=Khr
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Khw
[/variable]
[then]
[set_variable]
name=TerrainType
value=Khw
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Khs
[/variable]
[then]
[set_variable]
name=TerrainType
value=Khs
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Kd
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kd
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location_terrain.terrain
equals=Kdr
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kdr
[/set_variable]
[/then]
[/if]
[unstore_location]
variable=stored_location
[/unstore_location]
{CLEAR_VARIABLE stored_location}
#enddef
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
Re: About terrain code.
It's probably because you store the location in the variable "
stored_location
" and then check the value of "stored_location_[b]terrain[/b]
". Also the [unstore_location] tag doesn't exist.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
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
Re: About terrain code.
Code: Select all
#define ROAD_CHECKING_NORTH_SOUTH_ONLY_RM_CR
[store_locations]
[filter]
x,y=$TerrainX1,$TerrainY1
[/filter]
variable=stored_location
[/store_locations]
[if]
[variable]
name=stored_location.terrain
equals=W*
[/variable]
[then]
[set_variable]
name=RandomVariable
rand=1..2
[/set_variable]
[if]
[variable]
name=stored_location.terrain
equals=Wot
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wot^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wot^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Wog
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wog^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wog^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Wo
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wo^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wo^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Wwg
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwg^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwg^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Ww
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Ww^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Ww^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Ww^Ewf
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Ww^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Ww^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Ww^Ewl
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Ww^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Ww^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Wwt
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwt^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwt^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Wwf
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwf^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwf^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Wwrg
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwrg^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwrg^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Wwr
[/variable]
[then]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwr^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwr^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Wwrt
[/variable]
[then]
[set_variable]
name=TerrainType
value=Wwrt^Bw|
[/set_variable]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Wwrt^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Wwrt^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Ss
[/variable]
[then]
[set_variable]
name=RandomVariable
rand=1..2
[/set_variable]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Ss^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Ss^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Sm
[/variable]
[then]
[set_variable]
name=RandomVariable
rand=1..2
[/set_variable]
[switch]
variable=RandomVariable
[case]
value=1
[set_variable]
name=TerrainType
value=Sm^Bw|
[/set_variable]
[/case]
[case]
value=2
[set_variable]
name=TerrainType
value=Sm^Bw|r
[/set_variable]
[/case]
[/switch]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Ce
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ce
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Cea
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cea
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Co
[/variable]
[then]
[set_variable]
name=TerrainType
value=Co
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Coa
[/variable]
[then]
[set_variable]
name=TerrainType
value=Coa
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Ch
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ch
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Cha
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cha
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Cv
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cv
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Cud
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cud
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Chr
[/variable]
[then]
[set_variable]
name=TerrainType
value=Chr
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Chw
[/variable]
[then]
[set_variable]
name=TerrainType
value=Chw
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Chs
[/variable]
[then]
[set_variable]
name=TerrainType
value=Chs
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Cd
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cd
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Cdr
[/variable]
[then]
[set_variable]
name=TerrainType
value=Cdr
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Ke
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ke
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Ket
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ket
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Kea
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kea
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Ko
[/variable]
[then]
[set_variable]
name=TerrainType
value=Ko
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Koa
[/variable]
[then]
[set_variable]
name=TerrainType
value=Koa
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Kh
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kh
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Kha
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kha
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Kv
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kv
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Kud
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kud
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Khr
[/variable]
[then]
[set_variable]
name=TerrainType
value=Khr
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Khw
[/variable]
[then]
[set_variable]
name=TerrainType
value=Khw
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Khs
[/variable]
[then]
[set_variable]
name=TerrainType
value=Khs
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Kd
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kd
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=stored_location.terrain
equals=Kdr
[/variable]
[then]
[set_variable]
name=TerrainType
value=Kdr
[/set_variable]
[/then]
[/if]
{CLEAR_VARIABLE stored_location}
#enddef
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
Again about chests, but this time generated randomly...
That code is a bit changed of time when i was writing about that earlier (and chests where created and x,y for them set by my self, this time i want to do it by my code of creating map, in which MapX, MapY is changing.
Map code (for size 21x21):
We are interested by this part of code higher written:
in which we have 10% chance to create chest (if it will works i will change it to 1/1000). Before that code start i have set for now 30 avaible chests:
Codes for chests:
CHESTA - code for picking extra gold value found in chest:
CHESTB - code for picking new allie:
Randomly picked units for bonuses from chest (from default wesnoth):
Code to place allie unit:
"MODIFICATION_FOR_UNITS $PickedX $PickedY" - this is quite long code so i add higher that "#".
So if someone is good in coding pls dont give me links , i already read a lot of them, i dont know why this is not work.
In this code i got created in map chests, even variables of MapX_0 to MapX29 and of MapY_0 to MapY_29 got own values. But still moving on them is not work.
Map code (for size 21x21):
Code
Code
Code
Code
Code
Code
Code
Code
So if someone is good in coding pls dont give me links , i already read a lot of them, i dont know why this is not work.
In this code i got created in map chests, even variables of MapX_0 to MapX29 and of MapY_0 to MapY_29 got own values. But still moving on them is not work.
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
Re: Again about chests, but this time generated randomly...
It looks like code CHESTA and CHESTB dont work here, cause images they are created by code to generate map.
Is variables written like that "$MapX_$i" and "$MapY_$i" cant be used in event with name=move_to ?
Is variables written like that "$MapX_$i" and "$MapY_$i" cant be used in event with name=move_to ?
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
HERE IS NEEDED SOME GOOD ANSWER!!
Hello, i got a code in which Im using 6 diffrent faction, at start each of them got 1 unit to recruit. That one unit in each side let me know later which faction was chosen, then i am adding to that faction extra recruits, but i dont know how to delete that first unit which that faction had it from the start... set recruit and dissalow recruit dont works...
Code: Select all
#define RANDOM_RECRUITS_01LVLS
name=side 1 turn 1
[set_variable]
name=SIDEVALUE
value=1
[/set_variable]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[store_side]
[filter_side]
side=1,2,3,4,5,6,7,8,9
[/filter_side]
variable=stored_side
[/store_side]
{FOREACH stored_side i}
[if]
[variable]
name=stored_side[$i].recruit
contains="Moja_Era_Elvish Archer"
[/variable]
[then]
{RANDOM_UNIT_01LVL_SOWER_OF_PEACE}
[set_recruit]
side=$SIDEVALUE
type="$CHOSEN01LVL_SOWER_OF_PEACE"
[/set_recruit]
[while]
[variable]
name=CountNumber
greater_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_PEACE}
[allow_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_PEACE
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[set_variable]
name=SIDEVALUE
add=1
[/set_variable]
[/then]
[else]
[if]
[variable]
name=stored_side[$i].recruit
contains="Moja_Era_Troll Whelp"
[/variable]
[then]
{RANDOM_UNIT_01LVL_SOWER_OF_CHAOS}
[set_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_CHAOS
[/set_recruit]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_CHAOS}
[allow_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_CHAOS
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[set_variable]
name=SIDEVALUE
add=1
[/set_variable]
[/then]
[else]
[if]
[variable]
name=stored_side[$i].recruit
contains="Moja_Era_Messenger"
[/variable]
[then]
{RANDOM_UNIT_01LVL_SOWER_OF_LIGHT}
[set_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_LIGHT
[/set_recruit]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_LIGHT}
[allow_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_LIGHT
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[set_variable]
name=SIDEVALUE
add=1
[/set_variable]
[/then]
[else]
[if]
[variable]
name=stored_side[$i].recruit
contains="Moja_Era_Vampire Bat"
[/variable]
[then]
{RANDOM_UNIT_01LVL_SOWER_OF_DEATH}
[set_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_DEATH
[/set_recruit]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_DEATH}
[allow_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_DEATH
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[set_variable]
name=SIDEVALUE
add=1
[/set_variable]
[/then]
[else]
[if]
[variable]
name=stored_side[$i].recruit
contains="Moja_Era_Dwarvish Fighter"
[/variable]
[then]
{RANDOM_UNIT_01LVL_SOWER_OF_GREED}
[set_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_GREED
[/set_recruit]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_GREED}
[allow_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_GREED
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[set_variable]
name=SIDEVALUE
add=1
[/set_variable]
[/then]
[else]
[if]
[variable]
name=stored_side[$i].recruit
contains="Moja_Era_Drake Burner"
[/variable]
[then]
{RANDOM_UNIT_01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE}
[set_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE
[/set_recruit]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE}
[allow_recruit]
side=$SIDEVALUE
type=$CHOSEN01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[set_variable]
name=SIDEVALUE
add=1
[/set_variable]
[/then]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
{NEXT i}
{CLEAR_VARIABLE SIDEVALUE}
{CLEAR_VARIABLE stored_side}
{CLEAR_VARIABLE CountNumber}
#enddef
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
Re: ChaosRider’s WML questions
Moved to the WML Workshop, and merged with nine(!) of your previous threads. (There are yet more, but I have other things to do.)
Furthermore, the title of this latest thread is in violation of both parts of Posting Guideline 1c...
Edit: Merged another 24 threads, for a grand total of thirty-four. (Edit: As of my post below, thirty-five.)
Furthermore, the title of this latest thread is in violation of both parts of Posting Guideline 1c...
...and possibly 1i — “Ask, don’t demand”.Posting Guideline 1c wrote:Vague titles serve little purpose in attracting attention if you need help, have a question, or want an opinion on your work. Thread titles in IN ALL CAPS (shouting!) are annoying, rude and highly frowned upon.
Edit: Merged another 24 threads, for a grand total of thirty-four. (Edit: As of my post below, thirty-five.)
- ChaosRider
- Posts: 846
- Joined: April 15th, 2012, 1:15 pm
Interesting wierd bug which i dont understand...
First i will write how should code below poster works:
- first player is picking max of avaible to recruit units
- by checking leaders type of each side i am able later to choose from which list they are added allowed to recruit list units
- new recruits are added to each side.
Well all could be good if that code didnt work like that:
- choosen faction for last side (in map with 6 players last will be 6) is picked for first player, for penultimate side (5th side) is picked that for second side:
side number (which is checked, a= first, b=last):
a, a+1... ...b-1, b
chosen faction which should be added to each side is added to:
b, b-1... ...a+1,a
1,2 = 2,1 (for map with 2 players)
1,2,3 = 3,2,1 (for map with 3 players)
1,2,3,4 = 4,3,2,1 (for map with 4 players)
1,2,3,4,5 = 5,4,3,2,1 (for map with 5 players)
1,2,3,4,5,6 = 6,5,4,3,2,1 (for map with 6 players)
1,2,3,4,5,6,7 = 7,6,5,4,3,2,1 (for map with 7 players)
1,2,3,4,5,6,7,8 = 8,7,6,5,4,3,2,1 (for map with 8 players)
1,2,3,4,5,6,7,8,9 = 9,8,7,6,5,4,3,2,1 (for map with 9 players)
Code
___________________________________________________________________________________________________________________
fixed...
lists of leaders type
lists of recruits
Code for random picking recruits
Code to ask first player about number new recruits:
- first player is picking max of avaible to recruit units
- by checking leaders type of each side i am able later to choose from which list they are added allowed to recruit list units
- new recruits are added to each side.
Well all could be good if that code didnt work like that:
- choosen faction for last side (in map with 6 players last will be 6) is picked for first player, for penultimate side (5th side) is picked that for second side:
side number (which is checked, a= first, b=last):
a, a+1... ...b-1, b
chosen faction which should be added to each side is added to:
b, b-1... ...a+1,a
1,2 = 2,1 (for map with 2 players)
1,2,3 = 3,2,1 (for map with 3 players)
1,2,3,4 = 4,3,2,1 (for map with 4 players)
1,2,3,4,5 = 5,4,3,2,1 (for map with 5 players)
1,2,3,4,5,6 = 6,5,4,3,2,1 (for map with 6 players)
1,2,3,4,5,6,7 = 7,6,5,4,3,2,1 (for map with 7 players)
1,2,3,4,5,6,7,8 = 8,7,6,5,4,3,2,1 (for map with 8 players)
1,2,3,4,5,6,7,8,9 = 9,8,7,6,5,4,3,2,1 (for map with 9 players)
Code
Code: Select all
#define RANDOM_RECRUITS_01LVLS
name=side 1 turn 1
[set_variable]
name=i
value=1
[/set_variable]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[store_unit]
[filter]
side=1,2,3,4,5,6,7,8,9
[/filter]
variable=stored_leader
[/store_unit]
{FOREACH stored_leader j}
[if]
[variable]
name=ALL2LVLS_SOWER_OF_PEACE
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_PEACE}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_PEACE
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name=ALL2LVLS_SOWER_OF_CHAOS
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_CHAOS}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_CHAOS
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name=ALL2LVLS_SOWER_OF_LIGHT
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_LIGHT}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_LIGHT
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name=ALL2LVLS_SOWER_OF_DEATH
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_DEATH}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_DEATH
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name="ALL2LVLS_SOWER_OF_GREED"
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_GREED}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_GREED
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name=ALL2LVLS_SOWER_OF_ANCIENTS_KNOWLEDGE
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
[set_variable]
name=i
add=1
[/set_variable]
{NEXT j}
{CLEAR_VARIABLE stored_leader}
{CLEAR_VARIABLE i}
{CLEAR_VARIABLE CountNumber}
#enddef
fixed...
lists of leaders type
Code: Select all
#define ALL_UNITS_2LVLS_SOWER_OF_ANCIENTS_KNOWLEDGE
{VARIABLE_OP ALL2LVLS_SOWER_OF_ANCIENTS_KNOWLEDGE value ("Moja_Era_Drake Thrasher,Moja_Era_Wyvern Great,Moja_Era_Wyvern Tamer,Moja_Era_Drake Ranger,Moja_Era_Sword Drake,Moja_Era_Drake Hero,Moja_Era_Guardian Dragon Turtle,Moja_Era_Divine Dragon Turtle,Moja_Era_Javelin Dragon Turtle,Moja_Era_Monstrous Dragon Turtle,Moja_Era_Drake Warrior,Moja_Era_Drake Arbiter,Moja_Era_Fire Drake,Moja_Era_Drake Flare,Moja_Era_Sky Drake,Moja_Era_Drake Lord,Moja_Era_Drake High Magus,Moja_Era_Drake Alchemist,Moja_Era_Frost Wyrm,Moja_Era_Mistral Wyrm,Moja_Era_Tatsu,Moja_Era_Euplocephalus,Moja_Era_Rockback,Moja_Era_Saurian Ambusher,Moja_Era_Corrupted Shaman,Moja_Era_Clan Leader,Moja_Era_Saurian Soothsayer,Moja_Era_Saurian Oracle,Moja_Era_Saurian Soulmage,Moja_Era_Saurian Healer,Moja_Era_Saurian Elementalist,Moja_Era_Saurian Mystic,Moja_Era_Swamp Guard,Moja_Era_Swamp Fighter,Moja_Era_Saurian Highlander,Moja_Era_Saurian Pikeman,Moja_Era_Saurian Duelist,Moja_Era_Saurian Lizard Master,Moja_Era_Saurian Crossbowman,Moja_Era_Saurian Beast Master,Moja_Era_Lurker,Moja_Era_RangedToadRecruit,Moja_Era_ShamanisticToadRecruit,Moja_Era_BattleToadRecruit,Moja_Era_Salamander Black,Moja_Era_Salamander Blue,Moja_Era_Salamander Green,Moja_Era_Rebel,Moja_Era_Transformation,Moja_Era_Primeval Ironwheel,Moja_Era_Primeval Dogface,Moja_Era_Primeval Driver,Moja_Era_Primeval Hektor,Moja_Era_Primeval Escort,Moja_Era_Primeval Striker,Moja_Era_Cyclops Breaker,Moja_Era_Fire Cyclops,Moja_Era_Mighty Cyclops,Moja_Era_Outlaster,Moja_Era_Living Furnace,Moja_Era_Elemental Fire,Moja_Era_Flame Sprite,Moja_Era_Fire Master Ifreet,Moja_Era_Great Jinn,Moja_Era_Efreeti,Moja_Era_RhamiDatu,Moja_Era_RhamiKai,Moja_Era_Ice Crab,Moja_Era_Magic Defender,Moja_Era_Greenwood Sword,Moja_Era_Shifting Sword,Moja_Era_Possessed Sword,Moja_Era_Magic Sword")}
#enddef
#define ALL_UNITS_2LVLS_SOWER_OF_GREED
{VARIABLE_OP ALL2LVLS_SOWER_OF_GREED value ("Moja_Era_Dwarvish Berserker,Moja_Era_Dwarvish Masked Stalwart,Moja_Era_Dwarvish Masked Steelclad,Moja_Era_Dwarvish Masked Thunderguard,Moja_Era_Dwarvish Annalist,Moja_Era_Dwarvish Rune Fighter,Moja_Era_Dwarvish Observer,Moja_Era_Rune Smith,Moja_Era_Gunner,Moja_Era_Dwarvish Pathfinder,Moja_Era_Dwarvish Runesmith,Moja_Era_Dwarvish Stalwart,Moja_Era_Dwarvish Thunderguard,Moja_Era_Forge,Moja_Era_Technician,Moja_Era_Harpoon Specialist,Moja_Era_Crocodile Rider,Moja_Era_Experienced Tamer,Moja_Era_Dwarvish Huntsman,Moja_Era_Council Elder,Moja_Era_Dwarvish Steelclad,Moja_Era_Dwarvish Marshal,Moja_Era_Dwarvish Miasmist,Moja_Era_Oiler,Moja_Era_Dwarvish Charger,Moja_Era_Ice Apprentice,Moja_Era_Herbicider,Moja_Era_Herbalist,Moja_Era_Wave Rider,Moja_Era_Dwarvish Heavy Warrior,Moja_Era_Rambler,Moja_Era_Steam Berserker,Moja_Era_Steam Ulfserker Red,Moja_Era_Magic Golem Boss,Moja_Era_Iron Golem,Moja_Era_Mechanical Automaton,Moja_Era_Rock Golem,Moja_Era_Dwarvish Thunderwheel,Moja_Era_Dwarvish Steamcopter,Moja_Era_Dwarvish Steel Eagle,Moja_Era_Dwarvish Tank,Moja_Era_Heavy Baloon,Moja_Era_Pyradalon,Moja_Era_Katoblepon,Moja_Era_Gryphon Master,Moja_Era_Gryphon,Moja_Era_Medium Fungoids,Moja_Era_Water Serpent,Moja_Era_Deep Sting Ray,Moja_Era_Fleet Seal,Moja_Era_Crocodile,Moja_Era_Seafarer,Moja_Era_Pirate,Moja_Era_Hulk,Moja_Era_Trapper,Moja_Era_Wrath,Moja_Era_Outlaw Shadow Mage,Moja_Era_Outlaw Warlock,Moja_Era_Outlaw Overlord,Moja_Era_Bird_Knight,Moja_Era_Mystical Warrior,Moja_Era_Marauder,Moja_Era_Warrior Lady,Moja_Era_Termagant,Moja_Era_Blazier,Moja_Era_Clearbow,Moja_Era_Rogue,Moja_Era_Bandit,Moja_Era_Outlaw Witch,Moja_Era_Hydromonger,Moja_Era_Outlaw,Moja_Era_Sacrificer,Moja_Era_Cursedhand,Moja_Era_Titan,Moja_Era_Featherlite,Moja_Era_Valkyrie Warrior,Moja_Era_Valhallan")}
#enddef
#define ALL_UNITS_2LVLS_SOWER_OF_DEATH
{VARIABLE_OP ALL2LVLS_SOWER_OF_DEATH value ("Moja_Era_Dread Bat,Moja_Era_Blood Hulk,Moja_Era_Mistress,Moja_Era_Half Blood,Moja_Era_Blood Manipulator,Moja_Era_Vampire_Noble,Moja_Era_Vampire_Duelist,Moja_Era_Flesh Artisan,Moja_Era_Dark Sorcerer,Moja_Era_Magus,Moja_Era_Dark Knight,Moja_Era_Chaos Marksman,Moja_Era_Doom Guard,Moja_Era_Dark Crusher,Moja_Era_Dark Guardian,Moja_Era_Dark Berserker,Moja_Era_Dark Longswordsman,Moja_Era_Dark Fighter,Moja_Era_Dark Pillager,Moja_Era_Dark Knight 2,Moja_Era_Dark Halberdier,Moja_Era_Dark Gunner,Moja_Era_Dark Longbowman,Moja_Era_Dark Crossbowman,Moja_Era_Bone Knight,Moja_Era_Bone Shooter,Moja_Era_Chocobone,Moja_Era_Undead Pirate Captain,Moja_Era_Undead Swashbuckler,Moja_Era_Death Squire,Moja_Era_Deathblade,Moja_Era_Revenant,Moja_Era_Phantom Stone,Moja_Era_Marlgoyle,Moja_Era_Soulless Mauler,Moja_Era_Necrophage,Moja_Era_Mummy Unbound,Moja_Era_Tomb Sentinel,Moja_Era_Phantom White,Moja_Era_Phantom Midnight,Moja_Era_Phantom Shadow,Moja_Era_Phantom Dullohan,Moja_Era_Phantom,Moja_Era_Onryo,Moja_Era_Banshee,Moja_Era_Phantom Horseman,Moja_Era_Shadow,Moja_Era_Wraith,Moja_Era_Dark_Elder_Wose,Moja_Era_Deep Tentacle,Moja_Era_Double Tentacle,Moja_Era_Floating Eye,Moja_Era_Avatar_Air,Moja_Era_Air Zephyr,Moja_Era_Ghost Officer,Moja_Era_Horse_Black_Demon_Knight,Moja_Era_Demon_Assault,Moja_Era_Demon_Sentry,Moja_Era_Echidna Mid,Moja_Era_Blood Imp,Moja_Era_Giant Leech,Moja_Era_Chaos Daemon,Moja_Era_Demon Grunt,Moja_Era_Demon Stormbringer,Moja_Era_Demon Devil,Moja_Era_Demon Heretic,Moja_Era_Demon Leech Knight,Moja_Era_Demon Slaughterer,Moja_Era_Demon Daemon,Moja_Era_Demon Sharp Eye,Moja_Era_Demon Spellcaster,Moja_Era_Demon Hierophant,Moja_Era_Devling Flyers,Moja_Era_Devling Staplers,Moja_Era_Devling Soldier,Moja_Era_Devling Warrior,Moja_Era_Devling Offenders,Moja_Era_Hell Archfiend,Moja_Era_Hell Demon,Moja_Era_Hell Familiar,Moja_Era_Hell Sadist,Moja_Era_Plagued,Moja_Era_Zombie,Moja_Era_Mutilated Corpse,Moja_Era_Dismembered,Moja_Era_Rancid,Moja_Era_Spore Hive,Moja_Era_Undead Hound,Moja_Era_Blacktide,Moja_Era_Fleshpool,Moja_Era_Ooze,Moja_Era_Tomb Stalker,Moja_Era_Tomb Archer,Moja_Era_Tomb Wing")}
#enddef
#define ALL_UNITS_2LVLS_SOWER_OF_LIGHT
{VARIABLE_OP ALL2LVLS_SOWER_OF_LIGHT value ("Moja_Era_Knight,Moja_Era_Lancer,Moja_Era_Dragoon,Moja_Era_Mounted Warrior,Moja_Era_Samurai Captain,Moja_Era_Heavy Camel Rider,Moja_Era_Saree,Moja_Era_Qanas,Moja_Era_Faris,Moja_Era_Royal Sheriff,Moja_Era_Claimant,Moja_Era_Angel Ironbeak,Moja_Era_Light Child Of Light,Moja_Era_Human_Divine_Knight,Moja_Era_Human_Snow_Keeper,Moja_Era_Savant,Moja_Era_Lorekeeper,Moja_Era_Heretic,Moja_Era_Pathfinder,Moja_Era_Prophetess,Moja_Era_Envoy,Moja_Era_Reaver,Moja_Era_Emissary,Moja_Era_Infantry Lieutant,Moja_Era_Brown Warrior,Moja_Era_Silver Warrior,Moja_Era_Protector,Moja_Era_Human Crusader,Moja_Era_Judgementor,Moja_Era_Sun Follower,Moja_Era_Sun Protector,Moja_Era_Sun Revenger,Moja_Era_Monawish,Moja_Era_Ghazi,Moja_Era_Mudafi,Moja_Era_Duelist,Moja_Era_Militant,Moja_Era_Great Mystic,Moja_Era_Great Wizard,Moja_Era_Arsenal,Moja_Era_Arcane Rune Transcriber,Moja_Era_Elemental Rune Interpreter,Moja_Era_Rune Fire Specialist,Moja_Era_Human Pillager,Moja_Era_Human Mounted Axeman,Moja_Era_Warrior Monk,Moja_Era_Shifter Aura Monk,Moja_Era_Aura Monk,Moja_Era_Human Hunter,Moja_Era_Human Mauler,Moja_Era_Javelineer,Moja_Era_Centurion,Moja_Era_Lieutenant,Moja_Era_Commander,Moja_Era_Princess,Moja_Era_Prince,Moja_Era_Longbowman,Moja_Era_Pikeman,Moja_Era_Frightening Captain,Moja_Era_Shock Trooper,Moja_Era_Blacksmith,Moja_Era_Swordsman,Moja_Era_ShockTroop,Moja_Era_Stalwart,Moja_Era_Flinger,Moja_Era_Spiker,Moja_Era_Velite,Moja_Era_RockRider,Moja_Era_Trireme,Moja_Era_Bolter,Moja_Era_White Mage,Moja_Era_Battle Sage,Moja_Era_Elder Sage,Moja_Era_Spell Sword,Moja_Era_Warrior Mage,Moja_Era_Isolated Mage,Moja_Era_Sorcerer,Moja_Era_Mage Of Water,Moja_Era_Ekim Haram,Moja_Era_Mage Of Air,Moja_Era_Mage Of Fire,Moja_Era_Summoner,Moja_Era_Dispeller,Moja_Era_War Banner,Moja_Era_Cleric Of Light,Moja_Era_Carpet Master,Moja_Era_Light Inspired,Moja_Era_Cool Tempest Mage,Moja_Era_Red Mage,Moja_Era_Miscreation,Moja_Era_Merman Warrior,Moja_Era_Merman Soldier King,Moja_Era_River Horse,Moja_Era_Sailor,Moja_Era_Cuttle Fish,Moja_Era_Sea Turtle,Moja_Era_Qatif-Al-Nar,Moja_Era_Muharib,Moja_Era_War Hound,Moja_Era_Prokyon,Moja_Era_Cow,Moja_Era_Monster Mudcrawler,Moja_Era_Ancestor")}
#enddef
#define ALL_UNITS_2LVLS_SOWER_OF_CHAOS
{VARIABLE_OP ALL2LVLS_SOWER_OF_CHAOS value ("Moja_Era_Troll Shaman,Moja_Era_Troll Hero,Moja_Era_Troll Bladesman,Moja_Era_Troll Rocklobber,Moja_Era_Troll,Moja_Era_Troll Axe,Moja_Era_White Troll,Moja_Era_Warrior_Warg,Moja_Era_Rabid_Wolf,Moja_Era_Shadow_Pelt,Moja_Era_Changeling,Moja_Era_Black_Hunter,Moja_Era_Orcish Warrior,Moja_Era_Orcish Fireline,Moja_Era_Orcish Slayer,Moja_Era_Orcish Ruler,Moja_Era_Orcish Crossbowman,Moja_Era_Orcish Maurader,Moja_Era_Orcish Shaman,Moja_Era_Orcish Foreman,Moja_Era_Orcish Rigid,Moja_Era_Khaganate Bladesman,Moja_Era_Khaganate Savage,Moja_Era_Khaganate Spearman,Moja_Era_Khaganate Vanguard,Moja_Era_Khaganate Juggernaut,Moja_Era_Khaganate Outcast,Moja_Era_Khaganate Drover,Moja_Era_Orcish Magni Paegniarius,Moja_Era_Orcish Magni Bestiarius,Moja_Era_Barbarian,Moja_Era_Orcish Warbanner,Moja_Era_Orcish Cavalry,Moja_Era_Ogre,Moja_Era_Minotaur Boar Knight,Moja_Era_Minotaur Mystic,Moja_Era_Minotaur Warlock,Moja_Era_Minotaur Slayer,Moja_Era_Minotaur Savage,Moja_Era_Minotaur Rouser,Moja_Era_Minotaur Ancient Behemoth,Moja_Era_Naga Warrior,Moja_Era_Naga Warden,Moja_Era_Naga Pariah,Moja_Era_Naga Assassin,Moja_Era_Naga Depthprowler,Moja_Era_Naga Spear Soldier,Moja_Era_Naga Marksman,Moja_Era_Naga Mage,Moja_Era_Naga Sword Guard,Moja_Era_Roc Master,Moja_Era_Goblin Spearmaster,Moja_Era_Goblin Chopper,Moja_Era_Goblin Swordsman,Moja_Era_Goblin Warbanner,Moja_Era_Goblin Assassin,Moja_Era_Goblin Sniper,Moja_Era_Khampsa,Moja_Era_Essedarius Vulpis,Moja_Era_Goblin Knight,Moja_Era_Goblin Pillager,Moja_Era_Boar,Moja_Era_Bigfoot,Moja_Era_Giant Scorpion,Moja_Era_Medusa,Moja_Era_Lamia Warrior,Moja_Era_Spider,Moja_Era_Avatar_Earth,Moja_Era_Deep Hydra,Moja_Era_Ophis,Moja_Era_Young Sea Serpent,Moja_Era_Overgrown Crab,Moja_Era_Greater Mutation,Moja_Era_Lesser Crab,Moja_Era_Flesh Demon,Moja_Era_Magog,Moja_Era_Demonic Hound,Moja_Era_Horse_Dark_Knight,Moja_Era_Irritating Demon,Moja_Era_Gnoll Sharpshooter")}
#enddef
#define ALL_UNITS_2LVLS_SOWER_OF_PEACE
{VARIABLE_OP ALL2LVLS_SOWER_OF_PEACE value ("Moja_Era_Elvish Captain,Moja_Era_Elvish Herald,Moja_Era_Elvish Bladespinner,Moja_Era_Elvish Wildblade,Moja_Era_Elvish Warmage,Moja_Era_Elvish Veiledblade,Moja_Era_Forest Mage,Moja_Era_Rats_Knight,Moja_Era_Predator_Rats_Knight,Moja_Era_Amphibians_Rider,Moja_Era_Elven Death Hunter,Moja_Era_Blood Mage,Moja_Era_Elvish Berserker,Moja_Era_Forest Navigator,Moja_Era_Silver Ranger,Moja_Era_Forest Protector,Moja_Era_Desert Sentinel,Moja_Era_Elven Guard,Moja_Era_Elven Mystic,Moja_Era_Elvish Druid,Moja_Era_Fire Faerie,Moja_Era_Elvish Halberdier,Moja_Era_Elvish Hero,Moja_Era_Elvish Lord,Moja_Era_Elf Tracker,Moja_Era_Elf Yak Knight,Moja_Era_Frost Elf Mountaineer,Moja_Era_Frost Elf Gelus,Moja_Era_Elvish Marksman,Moja_Era_Elvish Ranger,Moja_Era_Elvish Rider,Moja_Era_Water_Nymph,Moja_Era_Elvish Sorceress,Moja_Era_Woods Druid,Moja_Era_Pyroation,Moja_Era_Snow Windlasher,Moja_Era_Eagle Master,Moja_Era_Pegasus Knight,Moja_Era_Bear,Moja_Era_Hive Fire Ant,Moja_Era_Hive Soldier Ant,Moja_Era_Hive Flea,Moja_Era_Hive Stag,Moja_Era_Hive Prince,Moja_Era_Hive Queen,Moja_Era_Hive Wasp,Moja_Era_Hive Lanterbug,Moja_Era_Hive Glider,Moja_Era_Hive Mantis,Moja_Era_Hive Skipper,Moja_Era_Hive Termite Soldier,Moja_Era_Hive Tarantula,Moja_Era_Hive Trapdoor Spider,Moja_Era_Hive Infest,Moja_Era_Drow Shadow,Moja_Era_Drow Lord,Moja_Era_Drow Captain,Moja_Era_Drow Warrior,Moja_Era_Drow_Commander,Moja_Era_Drow_Slayer,Moja_Era_Drow_Sworddancer,Moja_Era_Drow Sorcerer,Moja_Era_Drow Sorceress,Moja_Era_Drow Lizard Master,Moja_Era_Drow Dark Wizard,Moja_Era_Drow Dark Witch,Moja_Era_Mentor,Moja_Era_Grand Flyer,Moja_Era_Quickdraw,Moja_Era_Twilight Slayer,Moja_Era_Shadow Raider,Moja_Era_Midnight Stalker,Moja_Era_Faun_Sharpshooter,Moja_Era_Faun_Captain,Moja_Era_Faun_Spearman,Moja_Era_Undine,Moja_Era_Golem_Wood_Defender,Moja_Era_Elder Wose,Moja_Era_Huge Plant,Moja_Era_Elder Cactose,Moja_Era_Moving Fortress,Moja_Era_Greater Spriggan,Moja_Era_Kodama,Moja_Era_Leshi,Moja_Era_Vine Tiger,Moja_Era_Elvish Ancestor,Moja_Era_Taraxippon,Moja_Era_Nightmare,Moja_Era_Pegusa,Moja_Era_Great Wolf,Moja_Era_Mermaid Priestess,Moja_Era_Mermaid Enchantress,Moja_Era_Merman Spearman,Moja_Era_Merman Netcaster,Moja_Era_Drider Witch")}
#enddef
Code: Select all
#define RANDOM_UNIT_01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE
{VARIABLE_OP CHOSEN01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE rand (Moja_Era_Drake Burner,Moja_Era_Wyvern,Moja_Era_Wyvern Rider,Moja_Era_Drake Brave,Moja_Era_Protective Dragon Turtle,Moja_Era_Elder Dragon Turtle,Moja_Era_Hunting Dragon Turtle,Moja_Era_Drake Clasher,Moja_Era_Drake Fighter,Moja_Era_Drake Glider,Moja_Era_Drake Noble,Moja_Era_Drake Magus,Moja_Era_Infiltrative Dragon Turtle,Moja_Era_Ice Wyrm,Moja_Era_Ryu,Moja_Era_Snapper,Moja_Era_Terrapin,Moja_Era_Saurian Augur,Moja_Era_Shaman Adept,Moja_Era_Saurian Mage,Moja_Era_Saurian Sage,Moja_Era_Saurian Skirmisher,Moja_Era_Saurian Gladiator,Moja_Era_Saurian Shooter,Moja_Era_Saurian Tamer,Moja_Era_Swamp Saurian,Moja_Era_Hill Saurian,Moja_Era_Saurian Lizard Rider,Moja_Era_Sneak,Moja_Era_Toad,Moja_Era_Salamander,Moja_Era_Recruit,Moja_Era_Primeval Cutter,Moja_Era_Primeval Slowfoot,Moja_Era_Primeval Swiftfoot,Moja_Era_Cyclops,Moja_Era_Survivor,Moja_Era_Fire Wisp,Moja_Era_Brazier Creation,Moja_Era_Brazier Whelpling,Moja_Era_Fire Ifreet,Moja_Era_Jinn,Moja_Era_Fire Spirite,Moja_Era_Shanxia,Moja_Era_Rhami,Moja_Era_Ice Heart,Moja_Era_Frozen Soul,Moja_Era_Magic Guardian,Moja_Era_Floating Sword)}
#enddef
#define RANDOM_UNIT_01LVL_SOWER_OF_GREED
{VARIABLE_OP CHOSEN01LVL_SOWER_OF_GREED rand (Moja_Era_Dwarvish Fighter,Moja_Era_Dwarvish Witness,Moja_Era_Dwarvish Masked Fighter,Moja_Era_Dwarvish Masked Guardsman,Moja_Era_Dwarvish Masked Thunderer,Moja_Era_Dwarvish Watcher,Moja_Era_Rune Adept,Moja_Era_Dwarvish Ulfserker,Moja_Era_Triggerman,Moja_Era_Harpoonier,Moja_Era_Alligator Rider,Moja_Era_Amateur Tamer,Moja_Era_Dwarvish Hunter,Moja_Era_Undecided Student,Moja_Era_Ocean Apprentice,Moja_Era_Apothecary,Moja_Era_Dwarvish Rune Warrior,Moja_Era_Dwarvish Guardsman,Moja_Era_Dwarvish Soldier,Moja_Era_Dwarvish Scout,Moja_Era_Dwarvish Thunderer,Moja_Era_Enchanter,Moja_Era_Mechanic,Moja_Era_Parachutist,Moja_Era_Greaser,Moja_Era_Council Member,Moja_Era_Gryphon Rider,Moja_Era_Thief,Moja_Era_Thug,Moja_Era_Footpad,Moja_Era_Malice,Moja_Era_Outlaw Rogue Mage,Moja_Era_Outlaw Overseer,Moja_Era_Bird_Mount,Moja_Era_Wanderer,Moja_Era_Dwarvish Steamwheel,Moja_Era_Striding Machine,Moja_Era_Steam Ulfserker,Moja_Era_Magic Golem,Moja_Era_Automaton,Moja_Era_Mechanical Golem,Moja_Era_Mechanical Contraption,Moja_Era_Worker Droid,Moja_Era_Dwarvish Gyrocopter,Moja_Era_Baloon,Moja_Era_Animated Rock,Moja_Era_Rolling Stones,Moja_Era_Fungoids,Moja_Era_Little Water Serpent,Moja_Era_Sting Ray,Moja_Era_Seal,Moja_Era_Alligator,Moja_Era_Ram,Moja_Era_Giant,Moja_Era_Hidden Face,Moja_Era_Headhunter,Moja_Era_Reducter,Moja_Era_Cursedsword,Moja_Era_Harridan,Moja_Era_Woodsman,Moja_Era_Warrior Princess,Moja_Era_Poacher,Moja_Era_Ruffian,Moja_Era_Hotshot,Moja_Era_Young Sailor,Moja_Era_Outlaw Witch Apprentice,Moja_Era_Hydromancer,Moja_Era_Valkyrie,Moja_Era_Dwarvish Warrior Spirit)}
#enddef
#define RANDOM_UNIT_01LVL_SOWER_OF_DEATH
{VARIABLE_OP CHOSEN01LVL_SOWER_OF_DEATH rand (Moja_Era_Vampire Bat,Moja_Era_Blood Bat,Moja_Era_Blood Born,Moja_Era_Succubus,Moja_Era_Thin Blood,Moja_Era_Blood Apprentice,Moja_Era_Vampire_Fledgeling,Moja_Era_Dark Adept,Moja_Era_Invoker,Moja_Era_Invader,Moja_Era_Chaos Gunner,Moja_Era_Dark Trooper,Moja_Era_Dark Soldier,Moja_Era_Dark Raider,Moja_Era_Dark Spearman,Moja_Era_Dark Bowman,Moja_Era_Skeleton,Moja_Era_Undead Freebooter,Moja_Era_Skeleton Rider,Moja_Era_Chocobone Rider,Moja_Era_Skeleton Archer,Moja_Era_Dark_Wose,Moja_Era_Walking Corpse,Moja_Era_Tomb Mummy,Moja_Era_Phantom Statue,Moja_Era_Gargoyle,Moja_Era_Ghoul,Moja_Era_Soulless,Moja_Era_Tentacle of the Deep,Moja_Era_Floating Young Eye,Moja_Era_Elemental_Air,Moja_Era_Air Wind Herder,Moja_Era_Phantom Widow,Moja_Era_Poltergeist,Moja_Era_Phantom Cloak,Moja_Era_Spirit,Moja_Era_Ghost,Moja_Era_Ghost Spearman,Moja_Era_Phantom Rider,Moja_Era_Tomb Guard,Moja_Era_Horse_Possessed_Demon_Knight,Moja_Era_Demon_Mutant,Moja_Era_Minor Imp,Moja_Era_Imp,Moja_Era_Echidna Low,Moja_Era_Leech,Moja_Era_Lesser Daemon,Moja_Era_Demon Regular,Moja_Era_Demon Cursed,Moja_Era_Demon Imp,Moja_Era_Demon Heterodox,Moja_Era_Demon Leech Rider,Moja_Era_Demon Damned,Moja_Era_Demon Sniper,Moja_Era_Demon Initiate,Moja_Era_Devling Flappers,Moja_Era_Devling Nailers,Moja_Era_Devling Spikers,Moja_Era_Overgrown Devling,Moja_Era_Devling Sneak,Moja_Era_Devling Lurker,Moja_Era_Devling Cursers,Moja_Era_Devling Blasphemists,Moja_Era_Hell Imp,Moja_Era_Hell Fiend,Moja_Era_Hell Scamp,Moja_Era_Cadaver,Moja_Era_Infested,Moja_Era_Leech2,Moja_Era_Virus,Moja_Era_Bacterium,Moja_Era_Charred Zombie,Moja_Era_Fetid,Moja_Era_Host,Moja_Era_Infected Hound,Moja_Era_Dark Current,Moja_Era_Amoeba,Moja_Era_Acid,Moja_Era_Slime,Moja_Era_Infected,Moja_Era_Parasite,Moja_Era_Microbe,Moja_Era_Blob,Moja_Era_Seeded,Moja_Era_Tomb Huntress,Moja_Era_Tomb Dancer)}
#enddef
#define RANDOM_UNIT_01LVL_SOWER_OF_LIGHT
{VARIABLE_OP CHOSEN01LVL_SOWER_OF_LIGHT rand (Moja_Era_Messenger,Moja_Era_Angel Grounded,Moja_Era_Horseman,Moja_Era_Cavalryman,Moja_Era_Mounted Fighter,Moja_Era_Mounted Samurai,Moja_Era_Camel Rider,Moja_Era_Rami,Moja_Era_Khaiyal,Moja_Era_Royal Vassal,Moja_Era_Standard,Moja_Era_Sergeant,Moja_Era_Human Fighter,Moja_Era_Junior Princess,Moja_Era_Junior Prince,Moja_Era_Peasant,Moja_Era_Arif,Moja_Era_Spearman,Moja_Era_Bowman,Moja_Era_Human Aggressor,Moja_Era_Human_Crusader,Moja_Era_Human Warrior,Moja_Era_Human Axeman,Moja_Era_Monk,Moja_Era_Shifter Monk,Moja_Era_Human Crusher,Moja_Era_Human_Snow_Legionnaire,Moja_Era_Scribe,Moja_Era_Gatekeeper,Moja_Era_Seeker,Moja_Era_Weaver,Moja_Era_Courier,Moja_Era_Judiciary,Moja_Era_Sun Shielder,Moja_Era_Fencer,Moja_Era_Zealot,Moja_Era_Wizard,Moja_Era_Heavy Infantryman,Moja_Era_Blacksmith Student,Moja_Era_Armorer,Moja_Era_Sapper,Moja_Era_Legionnaire,Moja_Era_Slinger,Moja_Era_Pelite,Moja_Era_Hardback,Moja_Era_Galley,Moja_Era_Ballista,Moja_Era_Rune Apprentice,Moja_Era_Cool Thunder Mage,Moja_Era_Light Sister Of Light,Moja_Era_Battle Mage,Moja_Era_Elementalist,Moja_Era_Ekim,Moja_Era_Novice Summoner,Moja_Era_Adept Of Light,Moja_Era_Initiate Mage,Moja_Era_Carpet Rider,Moja_Era_Neglect Mage,Moja_Era_Sage,Moja_Era_Mage,Moja_Era_Freak,Moja_Era_Merman Child King,Moja_Era_Merman Young King,Moja_Era_Merman Fighter,Moja_Era_Young Cuttle Fish,Moja_Era_Boatsman,Moja_Era_Baby Sea Turtle,Moja_Era_Calf,Moja_Era_River Calf,Moja_Era_Naffat,Moja_Era_Jundi,Moja_Era_Mudcrawler,Moja_Era_Giant Mudcrawler,Moja_Era_Warrior Spirit,Moja_Era_Giant Rat,Moja_Era_Giant Fury Rat,Moja_Era_Dog,Moja_Era_Harrier,Moja_Era_Attack Dog,Moja_Era_Timber Wolf,Moja_Era_Deadly Eye,Moja_Era_Magical Eye)}
#enddef
#define RANDOM_UNIT_01LVL_SOWER_OF_CHAOS
{VARIABLE_OP CHOSEN01LVL_SOWER_OF_CHAOS rand (Moja_Era_Troll Whelp,Moja_Era_White Whelp,Moja_Era_Warrior_Wolf,Moja_Era_Stalker,Moja_Era_Shapeshifter,Moja_Era_Blackfur,Moja_Era_Orcish Grunt,Moja_Era_Orcish Rider,Moja_Era_Orcish Leader,Moja_Era_Orcish Raider,Moja_Era_Orcish Magni Pugnator,Moja_Era_Orcish Shieldbearer,Moja_Era_Khaganate Warrior,Moja_Era_Khaganate Spearhead,Moja_Era_Khaganate Herder,Moja_Era_Novice Orcish Shaman,Moja_Era_Orcish Serf,Moja_Era_Orcish Archer,Moja_Era_Orcish Warrior 2,Moja_Era_Young Ogre,Moja_Era_Orcish Assassin,Moja_Era_Minotaur Boar Rider,Moja_Era_Minotaur Shaman,Moja_Era_Minotaur Cutthroat,Moja_Era_Minotaur Gore,Moja_Era_Minotaur Behemoth,Moja_Era_Naga Turncoat,Moja_Era_Naga Fighter,Moja_Era_Naga Hunter,Moja_Era_Naga Guardian,Moja_Era_Naga Spear Recruit,Moja_Era_Naga Archer,Moja_Era_Naga Student,Moja_Era_Roc Rider,Moja_Era_Goblin Spearman,Moja_Era_Wolf Rider,Moja_Era_Goblin Archer,Moja_Era_Goblin Hunter,Moja_Era_Goblin Rouser,Moja_Era_Goblin Axeman,Moja_Era_Goblin Wizardling,Moja_Era_Goblin Fighter,Moja_Era_Goblin Impaler,Moja_Era_River Lizard,Moja_Era_Essedarius,Moja_Era_Tusker,Moja_Era_Shoat,Moja_Era_Scorpion,Moja_Era_Lamia,Moja_Era_Little Cute Spider,Moja_Era_Yak,Moja_Era_Young_Bigfoot,Moja_Era_Elemental_Earth,Moja_Era_Baby Sea Serpent,Moja_Era_Crab,Moja_Era_Hydra,Moja_Era_Lesser Mutation,Moja_Era_Wierd Demon,Moja_Era_Gog,Moja_Era_Chaos Hound,Moja_Era_Horse_Dark_Rider,Moja_Era_Lazy Demon,Moja_Era_Gnoll)}
#enddef
#define RANDOM_UNIT_01LVL_SOWER_OF_PEACE
{VARIABLE_OP CHOSEN01LVL_SOWER_OF_PEACE rand (Moja_Era_Elvish Archer,Moja_Era_Elvish Civilian,Moja_Era_Elvish Fighter,Moja_Era_Elf Wanderer,Moja_Era_Elf Yak Rider,Moja_Era_Frost Elf Archer,Moja_Era_Elvish Scout,Moja_Era_Elvish Shaman,Moja_Era_Exiled Alchemist,Moja_Era_Desert Hunter,Moja_Era_Forest Mariner,Moja_Era_Grey Ranger,Moja_Era_Snow Raindancer,Moja_Era_Elvish Fury,Moja_Era_Elvish Warrior,Moja_Era_Fire Sprite,Moja_Era_Water_Dryad,Moja_Era_Wood Mage,Moja_Era_Neophyte,Moja_Era_Explorer_Puck,Moja_Era_Swamp_Explorer,Moja_Era_Eagle Rider,Moja_Era_Pegasus Rider,Moja_Era_Young Bear,Moja_Era_Hive Ant,Moja_Era_Hive Beetle,Moja_Era_Hive Drone,Moja_Era_Hive Firefly,Moja_Era_Hive Gnat,Moja_Era_Hive Fly,Moja_Era_Hive Mosquito,Moja_Era_Hive Hopper,Moja_Era_Hive Termite,Moja_Era_Hive Spider,Moja_Era_Hive Swarm,Moja_Era_Drow_Darkwarrior,Moja_Era_Drow_Bladedancer,Moja_Era_Drow Wizard,Moja_Era_Drow Enchantress,Moja_Era_Drow Hunter,Moja_Era_Drow Noble,Moja_Era_Drow Lizard Rider,Moja_Era_Drow Disciple,Moja_Era_Drow Witch,Moja_Era_Flyer,Moja_Era_Star Shooter,Moja_Era_Moonlight Glider,Moja_Era_Young_Faun,Moja_Era_Tidal,Moja_Era_Spout,Moja_Era_Little_Golem,Moja_Era_Wose Sapling,Moja_Era_Wose,Moja_Era_Big Plant,Moja_Era_Cactose,Moja_Era_Swarm Spawn,Moja_Era_Rebel Swarm,Moja_Era_Surgler Swarm,Moja_Era_Sproutling,Moja_Era_Mandragora,Moja_Era_Spriggan,Moja_Era_Nymph,Moja_Era_Vine Beast,Moja_Era_Elvish Warrior Spirit,Moja_Era_Horse,Moja_Era_Dimensional Gate,Moja_Era_Greater Dimensional Gate,Moja_Era_Mermaid Initiate,Moja_Era_Merman Hunter,Moja_Era_Wolf Cub,Moja_Era_Wolf,Moja_Era_Drider Young Witch)}
#enddef
Code: Select all
#define RANDOM_RECRUITS_01LVLS
name=side 1 turn 1
[set_variable]
name=i
value=1
[/set_variable]
[set_variable]
name=k
value=0
[/set_variable]
[while]
[variable]
name=k
less_than=9
[/variable]
[do]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[store_unit]
[filter]
side=$i
[/filter]
variable=stored_leader
[/store_unit]
{FOREACH stored_leader j}
[if]
[variable]
name=ALL2LVLS_SOWER_OF_PEACE
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_PEACE}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_PEACE
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name=ALL2LVLS_SOWER_OF_CHAOS
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_CHAOS}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_CHAOS
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name=ALL2LVLS_SOWER_OF_LIGHT
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_LIGHT}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_LIGHT
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name=ALL2LVLS_SOWER_OF_DEATH
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_DEATH}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_DEATH
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name="ALL2LVLS_SOWER_OF_GREED"
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_GREED}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_GREED
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[else]
[if]
[variable]
name=ALL2LVLS_SOWER_OF_ANCIENTS_KNOWLEDGE
contains=$stored_leader[$j].type
[/variable]
[then]
[while]
[variable]
name=CountNumber
less_than=$Random_Recruits_Number
[/variable]
[do]
{RANDOM_UNIT_01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE}
[allow_recruit]
side=$i
type=$CHOSEN01LVL_SOWER_OF_ANCIENTS_KNOWLEDGE
[/allow_recruit]
[set_variable]
name=CountNumber
add=1
[/set_variable]
[/do]
[/while]
[set_variable]
name=CountNumber
value=0
[/set_variable]
[/then]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
[/else]
[/if]
{NEXT j}
{CLEAR_VARIABLE stored_leader}
{CLEAR_VARIABLE CountNumber}
[set_variable]
name=i
add=1
[/set_variable]
[set_variable]
name=k
add=1
[/set_variable]
[/do]
[/while]
{CLEAR_VARIABLE i}
#enddef
Code to ask first player about number new recruits:
Code: Select all
#define ASKING_ABOUT_RANDOM_RECRUTS_NUMBER NAME DRT
[option]
message= _ "{NAME}"
[command]
{VARIABLE Random_Recruits_Number {DRT}}
[sound]
name=dragonstick.ogg
[/sound]
[print]
text=Variability: {NAME}
size=40
duration=750
red,green,blue=$RED,$GREEN,$BLUE
[/print]
[/command]
[/option]
#enddef
Code: Select all
[event]
name=side 1 turn 1
first_time_only=yes
[set_variable]
name=RED
rand=1..255
[/set_variable]
[set_variable]
name=GREEN
rand=1..255
[/set_variable]
[set_variable]
name=BLUE
rand=1..255
[/set_variable]
[message]
speaker=narrator
message= _ "Choose number of randomly picked recruits:"
{ASKING_ABOUT_RANDOM_RECRUTS_NUMBER "Few - (4)" 4}
{ASKING_ABOUT_RANDOM_RECRUTS_NUMBER "Several - (7)" 7}
{ASKING_ABOUT_RANDOM_RECRUTS_NUMBER "Normal Amount - (10)" 10}
{ASKING_ABOUT_RANDOM_RECRUTS_NUMBER "More Than Usual - (13)" 13}
{ASKING_ABOUT_RANDOM_RECRUTS_NUMBER "Many - (16)" 16}
[/message]
[allow_undo]
[/allow_undo]
[/event]
Code: Select all
[event]
name=side 1 turn 1
{ALL_UNITS_2LVLS_SOWER_OF_ANCIENTS_KNOWLEDGE}
{ALL_UNITS_2LVLS_SOWER_OF_GREED}
{ALL_UNITS_2LVLS_SOWER_OF_DEATH}
{ALL_UNITS_2LVLS_SOWER_OF_LIGHT}
{ALL_UNITS_2LVLS_SOWER_OF_CHAOS}
{ALL_UNITS_2LVLS_SOWER_OF_PEACE}
{RANDOM_RECRUITS_01LVLS}
[/event]
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
Re: ChaosRider’s WML questions
For the third time, please keep all your WML questions in a single thread (this one) — do not start a new thread for each question.