Assigning flag "BarbarianOnly" to units prevents ruleset to be loaded (v2.6.8)

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Post Reply
omero
Posts: 48
Joined: Fri Mar 31, 2023 10:43 am

Assigning flag "BarbarianOnly" to units prevents ruleset to be loaded (v2.6.8)

Post by omero »

Hello,
I was trying to introduce a couple of units that would belong only to barbarian nations.
I added for each unit the "BarbarianOnly" flag but alas, this seems to cause troubles at ruleset loading time.

Code: Select all

2: Loading rulesets.
1: "/home/omero/freeciv268/share/freeciv/orxperimental/units.ruleset" unit_type "Pirate": bad role name "BarbarianOnly".
1: "/home/omero/freeciv268/share/freeciv/orxperimental/units.ruleset" unit_type "Corsair": bad role name "BarbarianOnly".
2: Loading rulesets.
Failed loading rulesets from directory "orxperimental", using "classic"
ChangeLog seems indicating the flag is available but maybe not fully implemented yet?
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Assigning flag "BarbarianOnly" to units prevents ruleset to be loaded (v2.6.8)

Post by Ignatus »

omero wrote: Tue Apr 18, 2023 12:40 pm Hello,
I was trying to introduce a couple of units that would belong only to barbarian nations.
I added for each unit the "BarbarianOnly" flag but alas, this seems to cause troubles at ruleset loading time.

Code: Select all

2: Loading rulesets.
1: "/home/omero/freeciv268/share/freeciv/orxperimental/units.ruleset" unit_type "Pirate": bad role name "BarbarianOnly".
1: "/home/omero/freeciv268/share/freeciv/orxperimental/units.ruleset" unit_type "Corsair": bad role name "BarbarianOnly".
2: Loading rulesets.
Failed loading rulesets from directory "orxperimental", using "classic"
ChangeLog seems indicating the flag is available but maybe not fully implemented yet?
"BarbarianOnly" is a flag. The output suggests you added it as a role. Likely, that's the problem.
omero
Posts: 48
Joined: Fri Mar 31, 2023 10:43 am

Re: Assigning flag "BarbarianOnly" to units prevents ruleset to be loaded (v2.6.8)

Post by omero »

Ignatus wrote: Tue Apr 18, 2023 2:03 pm BarbarianOnly" is a flag. The output suggests you added it as a role. Likely, that's the problem.
No. The problem is sleep deprivation... I feel so ... Embarrassed! And thank you for the quick reply. Of course! That was the problem :-D

But now a further question arises.
Is it possible to have such 'specific' units not appearing at all in the 'tech three' chart?

I like to play with several AIs (single player here) and I fancy to have the Barbarians play the 'needle of the scale' role... They should be annoying to everyone and also have their own kinds, like corsairs, pirates, etc.

Including some ships of their own.
I'd like them to have some 'custom' ships, not the trite caravel all the times...

I would like to introduce for instance 'brigands', spawning from huts (instead of the horsemen)... And maybe to have some of those 'friendly mercenaries' joining your cause look a bit more exotic than that old Lost Legion...

In other words, I'd like to introduce some 'variable' elements, but not allow those units to be built by neither AIs or Players alike, and certainly not having them 'spoiled away' in the tech three.

Surprise :mrgreen: !
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Assigning flag "BarbarianOnly" to units prevents ruleset to be loaded (v2.6.8)

Post by Ignatus »

omero wrote: Tue Apr 18, 2023 2:46 pm Including some ships of their own.
I'd like them to have some 'custom' ships, not the trite caravel all the times...

I would like to introduce for instance 'brigands', spawning from huts (instead of the horsemen)... And maybe to have some of those 'friendly mercenaries' joining your cause look a bit more exotic than that old Lost Legion...
There is "BarbarianBoatTech" role in a development version, but not in the release one. So all that could be currently done for more flexible barbarian types is writing scripts and generate the uprisings "yourself". Note that find.role_unit_type() and some similar hardcoded functions provide you with not a random type (depends on ruleset unit type ordering and technical progress).
omero
Posts: 48
Joined: Fri Mar 31, 2023 10:43 am

Re: Assigning flag "BarbarianOnly" to units prevents ruleset to be loaded (v2.6.8)

Post by omero »

Ignatus wrote: Thu Apr 20, 2023 7:49 am There is "BarbarianBoatTech" role in a development version, but not in the release one.
For the records, I managed to introduce a few BarbarianOnly (flag) units in my (v2.6) orxperimental ruleset. I shamelessly pilf... ahm... borrowed some sprites from 'augmented2' modpack (for the sharing of which I am very thankful to all involved in that project!).

For the boats, BarbarianBoat+BarbarianBuild (roles) and BarbarianOnly (flag) does the trick. They still appear in the Tech Tree, however they're described in the help as exclusive of barbarians (as intended). Similarly, that also works for the units.

Having BarbarianBoatTech would of course be much more beneficial (timing the appearance more appropriately), but ... I suppose that being limited to v2.6 has his drawbacks.

Cheers!
Post Reply