Feature request: Unrefuelable units

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
danau
Posts: 15
Joined: Wed Apr 25, 2018 6:13 pm

Feature request: Unrefuelable units

Post by danau »

I'm working on a ruleset where I would like to implement missiles as a combination of two different types of units:
- "transported missile"
- "launched missile"

The transported type is the default unit, and it gets converted into the launched type when the missile gets launched.
Nearly all functionality seems to exist to implement this, but the "launched missile" should only exist for 1 or 2 turns.
Fuel seems the natural way to limit the lifespan of this launched missile unit, except that the launched missile should not refuel in cities, but I didn't find any options to prevent a specific unit from refuelling in cities.
I checked existing rulesets (v3.0.6) looked at action_enablers, and checked the forum (http://forum.freeciv.org/f/viewtopic.php?p=103572 and http://forum.freeciv.org/f/viewtopic.php?p=102839 seemed somewhat related).
cazfi
Elite
Posts: 3111
Joined: Tue Jan 29, 2013 6:54 pm

Re: Feature request: Unrefuelable units

Post by cazfi »

Not sure if you could implement this by the Retire unit effect (the mechanism that makes barbarian leaders to disappear)
cazfi
Elite
Posts: 3111
Joined: Tue Jan 29, 2013 6:54 pm

Re: Feature request: Unrefuelable units

Post by cazfi »

cazfi wrote: Sun Oct 15, 2023 3:14 pm Not sure if you could implement this by the Retire unit effect (the mechanism that makes barbarian leaders to disappear)
Likely not, as there's no sensible requirement type to check how long it's since unit converted. Opened tickets to implement such requirement: osdn #48848 and its dependency osdn #48847
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Feature request: Unrefuelable units

Post by Ignatus »

cazfi wrote: Sun Oct 15, 2023 3:14 pm Not sure if you could implement this by the Retire unit effect (the mechanism that makes barbarian leaders to disappear)
You can't since retirement does not work within 3 tiles from enemy units or cities. The "use it or lose it" design for launched missiles is a long problem still without a perfect solution, I would suggest tracking launch and subsequent removal by scripting.
danau
Posts: 15
Joined: Wed Apr 25, 2018 6:13 pm

Re: Feature request: Unrefuelable units

Post by danau »

Thanks for opening the tickets; tracking the total lifetime of the unit (and putting a maximum on it) sounds like a proper solution.

A (lua) script to track launches is also possible (for human players). It's actually quite easy for launched missiles that only exist 1 turn; just remove all units of that type at the end of the turn (or beginning of the next turn).
The custom script will not work for AI-players, because we do need a way to communicate the "use it or lose it" nature of the launched missile to the AI.
---
Danau (Peter van der Meer)
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Feature request: Unrefuelable units

Post by Ignatus »

danau wrote: Sun Oct 15, 2023 8:04 pm The custom script will not work for AI-players, because we do need a way to communicate the "use it or lose it" nature of the launched missile to the AI.
If I recall it well, AI's management of missiles includes little transportation on their own. Or we can tell the script to spare poor stupid AIs.
Post Reply