Page 1 of 1

Two questions on Rulesets

Posted: Fri Feb 16, 2018 9:25 pm
by drakeraider
Hey guys. Question.

Or two.

First. How do I conditionally disable buildings in a ruleset?
for instance, forcing the player to pick between two different Wonders. Having one constructed disables the other for the player. Or something like that. I recall Oracle and Hanging Gardens being mutually exclusive under certain rules but I don't remember how.

And I am working with 2.5.10

Other question?
Can I make the game post custom strings under specific circumstances? Like, triggering a certain effect has a notification printed to the messages log.

Thanks guys!

Re: Two questions on Rulesets

Posted: Fri Feb 16, 2018 9:35 pm
by GriffonSpade
drakeraider wrote:Hey guys. Question.

Or two.

First. How do I conditionally disable buildings in a ruleset?
for instance, forcing the player to pick between two different Wonders. Having one constructed disables the other for the player. Or something like that. I recall Oracle and Hanging Gardens being mutually exclusive under certain rules but I don't remember how.

And I am working with 2.5.10

Other question?
Can I make the game post custom strings under specific circumstances? Like, triggering a certain effect has a notification printed to the messages log.

Thanks guys!


In 2.5, you can negate their building requirements and their effects both, but not technically obsolete them.

In 2.6, the obsolete_by becomes a table that works like effects.ruleset.

For the description of how to negate, see here: http://freeciv.wikia.com/wiki/Editing_Effects (The set isn't finished for full release, but this page has enough to work with)

Edit:Fixt

Re: Two questions on Rulesets

Posted: Fri Feb 16, 2018 10:18 pm
by Corbeau
GriffonSpade wrote:In 2.5, you can only make them negate each other's effects in effects.ruleset. They'll still be buildable.

Are you sure? I have this in my ruleset which I still haven't tested so I'm not sure if it really works as intended:

Code: Select all

[building_manufaktur]
name      = _("Manufaktur")
genus      = "Improvement"
reqs   =
    { "type", "name", "range", "negated"
      "Tech", "Monarchy", "Player", FALSE
      "Tech", "Industrialization", "Player", TRUE
      "Building", "Factory", "City", TRUE
    }


The intention is: Manufaktur can NOT be built if you discovered Industrialization OR if there is a Factory in the city. (For the Wonder, replace "City" in the last line with "Player")

Re: Two questions on Rulesets

Posted: Fri Feb 16, 2018 10:43 pm
by GriffonSpade
Corbeau wrote:
GriffonSpade wrote:In 2.5, you can only make them negate each other's effects in effects.ruleset. They'll still be buildable.

Are you sure? I have this in my ruleset which I still haven't tested so I'm not sure if it really works as intended:
reqs =
{ "type", "name", "range", "negated"


/facepalm. Yeah, I forgot about negated in the Reqs in buildings. Was thinking strictly about obsolete_by and effects. Never entered my mind to block it on the other end.

Re: Two questions on Rulesets

Posted: Sat Feb 17, 2018 2:45 am
by cazfi
drakeraider wrote:I recall Oracle and Hanging Gardens being mutually exclusive under certain rules but I don't remember how.

Variant2 ruleset does that.

Re: Two questions on Rulesets

Posted: Sat Feb 17, 2018 7:55 am
by drakeraider
Corbeu, are you intending on transferring your ruleset to 2.6? I am building my personal on top of yours, because I like how you handled combat and upkeep. But I'm a huge fan of Culture gameplay, so I would love to see a version for the next gen.

Back on topic, thank you everyone for your help on this, I'm going to try it out right away. Also. Is there any discovery on the Printed strings or messages?

Re: Two questions on Rulesets

Posted: Sat Feb 17, 2018 10:09 am
by JTN
drakeraider wrote:Can I make the game post custom strings under specific circumstances? Like, triggering a certain effect has a notification printed to the messages log.

You would probably need to use Lua scripting for that; there are only a few places where the ruleset lets you specify messages (e.g. the Philosophy Bonus_Tech hack).

Re: Two questions on Rulesets

Posted: Sat Feb 17, 2018 12:30 pm
by Corbeau
drakeraider wrote:Corbeu, are you intending on transferring your ruleset to 2.6? I am building my personal on top of yours, because I like how you handled combat and upkeep. But I'm a huge fan of Culture gameplay, so I would love to see a version for the next gen.


Answered here ;)