Page 1 of 1

How to specify the exclusive building

Posted: Mon Jul 20, 2015 10:03 am
by taka
Hi,
I want to build Building_A or Building_B, but I can build both Building_A and Building_B.
Why?

Code: Select all

[building_A]
name		= _("Building A")
genus		= "SmallWonder"
flags		= "SaveSmallWonder"
reqs	=
    { "type", "name", "range"
      "Tech", "Electricity", "Player"
    }
nreqs	=
    { "type", "name", "range"
      "Building", "Building B", "Player"
    }
((snip))

[building_B]
name		= _("Building B")
genus		= "SmallWonder"
flags		= "SaveSmallWonder"
reqs	=
    { "type", "name", "range"
      "Tech", "Mass Production", "Player"
    }
nreqs	=
    { "type", "name", "range"
      "Building", "Building A", "Player"
    }
((snip))
Expectation:
I can't build Building_A if I built Building_B.
I can't build Building_B if I built Building_A.

Re: How to specify the exclusive building

Posted: Mon Jul 20, 2015 6:18 pm
by cazfi
There has never been 'nreqs' field for buildings, only for effects.

However, you can have negated 'reqs'. In versions up to 2.5, the column is called 'negated', in 2.6+ you can use 'present' for that:

Code: Select all

reqs =
 { "type", "name", "range", "negated"
  "Tech", "Electricity", "Player", FALSE
  "Building", "Building B", "Player", TRUE
 }

Code: Select all

reqs =
 { "type", "name", "range", "present"
  "Tech", "Electricity", "Player", TRUE
  "Building", "Building B", "Player", FALSE
 }

Re: How to specify the exclusive building

Posted: Mon Jul 20, 2015 9:50 pm
by taka
That's a good news!