Two questions on Rulesets

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Post Reply
drakeraider
Posts: 27
Joined: Sat Feb 03, 2018 11:49 pm

Two questions on Rulesets

Post 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!
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: Two questions on Rulesets

Post 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
Last edited by GriffonSpade on Fri Feb 16, 2018 10:46 pm, edited 1 time in total.
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: Two questions on Rulesets

Post 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")
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: Two questions on Rulesets

Post 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.
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Two questions on Rulesets

Post 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.
drakeraider
Posts: 27
Joined: Sat Feb 03, 2018 11:49 pm

Re: Two questions on Rulesets

Post 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?
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Two questions on Rulesets

Post 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).
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: Two questions on Rulesets

Post 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 ;)
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
Post Reply