Page 1 of 1

Cycle through all units of the same type, every where.

Posted: Fri Apr 07, 2023 1:13 pm
by omero
Thus, this is my biggest 'wish'...

Sometimes, you sent one Galleon on a far away destination... Where is it now?
You want to 'cycle' through all the Engineers? You select one, then cycle through all Engineers to find them, no matter what they're doing. Ever happened to set them on 'autosettle' and then they go hiding in cities doing their stuff? It becomes a pain hunting them down when you need just one to deal with pollution. Or maybe you set an Explorer, or a Trireme on 'autoexplore'... They could be anywhere now.
This also could help reviewing all the situations where military units are involved, since you know you have a 'fortified' Marine out there in a forest... Alone and neglected.

The 'Find Nearest' option is not much helpful on large maps :|

Re: Cycle through all units of the same type, every where.

Posted: Fri Apr 07, 2023 2:01 pm
by cazfi
Not exactly what you requested, but selecting "World" range on gtk-client unit selection dialog might sometimes help in such situations.

Re: Cycle through all units of the same type, every where.

Posted: Wed May 03, 2023 7:22 am
by omero
cazfi wrote: Fri Apr 07, 2023 2:01 pm Not exactly what you requested, but selecting "World" range on gtk-client unit selection dialog might sometimes help in such situations.
Just wondering about ... Would it be possible to have a LUA script that will _hotlink/box/frame_ all units of one type in every spot of the map?
That would already help much tracking down 'lost' units when one just 'scrolls' around on the map view.

EDIT: Yes, the "World" range will select them all but that is sometimes undesirable (accidentally triggering a mass suicidal mission) :shock:
EDIT2: Just wondering if it is technically/theoretically possible, not asking someone to code the LUA script for me :-D

Re: Cycle through all units of the same type, every where.

Posted: Thu May 04, 2023 9:02 am
by Ignatus
omero wrote: Wed May 03, 2023 7:22 am Just wondering about ... Would it be possible to have a LUA script that will _hotlink/box/frame_ all units of one type in every spot of the map?
That would already help much tracking down 'lost' units when one just 'scrolls' around on the map view.

EDIT: Yes, the "World" range will select them all but that is sometimes undesirable (accidentally triggering a mass suicidal mission) :shock:
EDIT2: Just wondering if it is technically/theoretically possible, not asking someone to code the LUA script for me :-D
In the current client, it's not possible, but I have once developed a (2.6 compatible) client with some options for selecting and centering from Lua, see viewtopic.php?p=101904

Re: Cycle through all units of the same type, every where.

Posted: Thu May 11, 2023 12:00 pm
by omero
Ignatus wrote: Thu May 04, 2023 9:02 am In the current client, it's not possible, but I have once developed a (2.6 compatible) client with some options for selecting and centering from Lua, see viewtopic.php?p=101904
Not sure what "current client" is referring to... For me, it is v2.6.9 :)
And since v2.6 is what I am "bound" to, then Thank You for the suggested topic!
I have started reading and it will require some time to "digest" all that :D

After all, it only took me a decade+ to switch from v2.4->v2.6...
Time and Patience, the two most formidable warriors ;)

Re: Cycle through all units of the same type, every where.

Posted: Thu May 11, 2023 1:44 pm
by cazfi
omero wrote: Thu May 11, 2023 12:00 pm Not sure what "current client" is referring to... For me, it is v2.6.9 :)
And since v2.6 is what I am "bound" to, then Thank You for the suggested topic!
I have started reading and it will require some time to "digest" all that :D

After all, it only took me a decade+ to switch from v2.4->v2.6...
Year2038 support is in review to become part of freeciv-2.6 too: osdn #47710

Re: Cycle through all units of the same type, every where.

Posted: Tue May 16, 2023 6:35 am
by nef
omero wrote: Wed May 03, 2023 7:22 am
Just wondering about ... Would it be possible to have a LUA script that will _hotlink/box/frame_ all units of one type in every spot of the map?
That would already help much tracking down 'lost' units when one just 'scrolls' around on the map view.
I will add this to my list of SP utilities: I am always looking out for ideas. I already have code (twice over) to do this for explicitly nominated units (or cities) but they do other things as well. There are limited options in featured text, so at the moment all I can think of is for you (as the user) to specify the unit type either by rule name or id.

I might add it does work: it will locate the unit no matter what it is doing. Moreover, you only need to do it once for units you currently have. The hotlink follows the unit. A question: would it be useful if the list printed in chat log (etc.) included user text so you can be selective hunting down particular units?

Re: Cycle through all units of the same type, every where.

Posted: Wed May 17, 2023 4:58 am
by omero
nef wrote: Tue May 16, 2023 6:35 am
omero wrote: Wed May 03, 2023 7:22 am
Just wondering about ... Would it be possible to have a LUA script that will _hotlink/box/frame_ all units of one type in every spot of the map?
That would already help much tracking down 'lost' units when one just 'scrolls' around on the map view.
I will add this to my list of SP utilities: I am always looking out for ideas. I already have code (twice over) to do this for explicitly nominated units (or cities) but they do other things as well. There are limited options in featured text, so at the moment all I can think of is for you (as the user) to specify the unit type either by rule name or id.

I might add it does work: it will locate the unit no matter what it is doing. Moreover, you only need to do it once for units you currently have. The hotlink follows the unit. A question: would it be useful if the list printed in chat log (etc.) included user text so you can be selective hunting down particular units?
YES! (I could not resist pulling this off)
Me, (the user)... I would surely answer YES (of course). An ambiguous answer to an ambiguous question, because me (<random name goes here>) is not everyone else.

Let me elaborate on more serious ground (v2.6-wise):
Cities are an interesting option, but you see them on plain sight already (on the map).
You also see immediately when they're in turmoil (the angry fist)... But that's another topic.

The units however are not so trivial to track down (because they can be doing something _inside_ a city). What those units are doing is ... Irrelevant.

What is relevant is... Where are they NOW on the map once you have lost track of them? One can cycle through EVERY single city, and 'wake up' every single unit that such city has inside or supports (near, far from...) and it soon becomes a tedious exercise of patience and determination.

Highlight them with a 'frame'.
Let (<random name>) player _spot_ them easily on the map!

From (<random name>) single player point of view, having those 'lost units' listed somewhere (anywhere) would be _PERFECT_, but again... Uhm. ANYWHERE! Just somewhere... Even just the 'frame' would be already GREAT!

Cheers o/