Sides

The place to post your WML questions and answers.

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.
quartex
Inactive Developer
Posts: 2258
Joined: December 22nd, 2003, 4:17 am
Location: Boston, MA

Post by quartex »

Noyga wrote:No, currently any side you use must have a starting location.
Pardon me, but that's not quite true. In my campaign I have a lot of sides that don't have starting locations. That's becuase they don't have a leader at the start of the scenario. A side without a leader does not need a starting location to put the leader on.

So you can create a new side and add the tag no_leader=yes. Obviously if you do this you wouldn't define a leader unit when you define the side.

Later if you want to creater a leader who can recruit units then just create a unit with the tag canrecruit=1 in the unit description and put him on a keep hex.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

The "And" tag is only needed for complex situations, since all if-conditions must evaluate true by default. In other words, the original code was correct syntax and preferrable.

But, just to clear things up:

Code: Select all

[if] 

    [variable] 
    name=turn_number 
    equals=6 
    [/variable] 
    [variable] 
    name=side_number 
    equals=5 
    [/variable] 
    
   [then] 
  ...
Is the same thing as:

Code: Select all

[if] 
  [and]
 
   [variable]
    name=turn_number 
    equals=6 
    [/variable] 
    [variable] 
    name=side_number 
    equals=5 
    [/variable] 

  [/and]  
   [then] 
  ...
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

Sapient is right here, and is only needed for complex conditions where it can be used as brackets, since by default all the conditions are anded.
It is useful when you want to and a more comple condition, for example :
A and (B or C) would be :

Code: Select all

[and]
   A
[/and]
[and]
  [or]
     B
  [/or]
  [or]
     C
  [/or]
[/and]
Notice that the first [and] and the first [or] are not necessary, but i find more convenient to have all the conditions at the same level.


A and B and C would be :

Code: Select all

A
B
C
since [and] are used by default, they are not necessary here.

The [and] tag is a new feature of v1.1.2
Post Reply