Need help with ruleset

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Post Reply
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Need help with ruleset

Post by Alien Valkyrie »

I didn't know where to put this, so I'm just posting it here:
I'm creating a mod-like ruleset. However, I encountered a problem:
I wanted to create different nations with different starting technologies, but it seems there's a maximum of 10 for the nation_*.init_techs option.
Is it possible to increase this cap?
~ AVL
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: Need help with ruleset

Post by cazfi »

The limit is hardcoded, so you cannot change it with modifying any rules or settings files.

But do you really need more than 10 specific techs for each nation? You shouldn't be adding any techs that all nations have this way. There's global init techs (also limited to 10 entries) for techs that all nations have, and if that's not setting you high enough in the tech tree, maybe you should modify tech tree by removing gameplay-wise meaningless (everyone always have them, so what's the point of requiring them for anything?) techs.
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Need help with ruleset

Post by Alien Valkyrie »

It's just so that the different nations should start with completely different technologies, so global_init_techs won't help. Well, maybe I'll find some way to do it. Where there's a will, there's a way.
~ AVL
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Need help with ruleset

Post by JTN »

If you really want to grant lots of technologies at the start, I think you could do it via Lua scripting. You could hook the turn_started event to a function which iterates over players with player_iterate, looking at (Player):nation and calling Player:give_technology() as appropriate. (Obviously this won't show up in the nation help.)

However, as cazfi says, it seems odd to grant a whole pile of technologies; if you don't have to work for them, what's the point in having them distinct?

If what you really wanted was completely or partially separate tech trees for different nations, investigate the "root_req" property of techs. A tech X with root_req Y is completely unavailable to a player who doesn't have Y. By making Y have itself as a root_req you can make it and its descendants completely unreachable except by special circumstances, such as being in init_techs. Then you can have a base tech in init_techs (let's say unimaginatively "Being An Aztec"), and make your Aztec-specific techs have "Being An Aztec" as a root_req. Then by default the Aztec techs won't even appear in the tech tree of players who aren't Aztecs.

Or at least, that's the theory. Warning: some aspects of root_req are a bit flaky still, I think. Use a recent Freeciv for best results.
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Need help with ruleset

Post by Alien Valkyrie »

I have already worked with root_req(in Freeciv 2.3.3, haven't testet 2.3.4 yet) and it's working great for different tech trees.
The idea with the Lua scripting seems great for other stuff, I'll just have to get into Lua again, and Freeciv scripting in general. Thanks for the ideas! :D
~ AVL
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Need help with ruleset

Post by Alien Valkyrie »

I'm sorry for double posting, but otherwise, this would probably be overseen.

Completely different topic: It seems there's no way to have different GameLoss units. As mentioned above, I am working with root_req, and in the ruleset I'm creating, there are three different tribes. Since they look very differently from each other, I wanted to create three leader units, each requiring the init_tech only the correct tribe has. The three units have the same unit_*.name(for translation compatibility etc.), but each has an individual unit_*.rule_name. Still though, the first one in the file is always used. Is there any way to fix that?
~ AVL
Post Reply