Page 1 of 1

How to define a non-base buildable extra?

Posted: Wed Feb 07, 2024 11:39 am
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?

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

Posted: Wed Feb 07, 2024 3:32 pm
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.

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

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

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

Posted: Thu Feb 08, 2024 3:23 am
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).

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

Posted: Thu Feb 08, 2024 10:35 am
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.

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

Posted: Fri Feb 09, 2024 5:48 am
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.

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

Posted: Sat Feb 10, 2024 10:33 pm
by Corbeau
Ignatus wrote: Fri Feb 09, 2024 5:48 amgui_type = "Other"
This is already the case.