How to define a non-base buildable extra?

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Post Reply
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

How to define a non-base buildable extra?

Post by Corbeau »

I created a Resort extra (more trade to hills and mountains). However, the only way to build it is through "Base" mechanic: menu Combat -> Build Base etc. Is there any way to put it into the same category as irrigation and mine, possibly give it a shortcut?
--
* 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...
cazfi
Elite
Posts: 3065
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to define a non-base buildable extra?

Post by cazfi »

Corbeau wrote: Wed Feb 07, 2024 11:39 am I created a Resort extra (more trade to hills and mountains). However, the only way to build it is through "Base" mechanic: menu Combat -> Build Base etc. Is there any way to put it into the same category as irrigation and mine, possibly give it a shortcut?
That's controlled by the "cause" field of the extra.
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: How to define a non-base buildable extra?

Post by Corbeau »

So what should I put as "cause"?
--
* 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...
cazfi
Elite
Posts: 3065
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to define a non-base buildable extra?

Post by cazfi »

Corbeau wrote: Wed Feb 07, 2024 5:00 pm So what should I put as "cause"?

Code: Select all

; causes                  = events that can create extra type.
;                           "Irrigation", "Mine", "Hut", "Pollution", "Fallout",
;                           "Appear", "Resource", "Base", or "Road"
;                           (the last three require a corresponding
;                           [resource_*] / [base_*] / [road_*] section)
If you want to make it like Irrigation, make "Irrigation" its cause. If you want to make it like Mine, make "Mine" its cause.
Though thinking about it, you likely find the Base mechanism better after all. At least that gives you two distinct keys (shift+F & shift+E) to share between the base types, whereas irrigation and mine have just one key each (i & m).
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: How to define a non-base buildable extra?

Post by Corbeau »

No, I want to add it as a new type. If I want to build a Resort on a hill, "Irrigation" irrigates and "mine" mines. I need a new one.

Same for bases. I assume one is for fort and the other for airbase? Again, I need a new one, not overwrite the existing one.
--
* 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...
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: How to define a non-base buildable extra?

Post by Ignatus »

Corbeau wrote: Thu Feb 08, 2024 10:35 am Same for bases. I assume one is for fort and the other for airbase? Again, I need a new one, not overwrite the existing one.
Likely, you should in [base_resort] write gui_type = "Other", that detatches your base from standard keys and menu items labels for which defined in [extraui] section. I don't know well but likely building it will be possible with activate unit, hit D, click the unit's tile.
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: How to define a non-base buildable extra?

Post by Corbeau »

Ignatus wrote: Fri Feb 09, 2024 5:48 amgui_type = "Other"
This is already the case.
--
* 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