Hi,
After a short break, things are progressing well. There is now a really well-functioning "line-of-sight" search that replaces the one from Egosoft. With it, you can also precisely aim at distant targets if you know them or if they are large. If necessary, several searches are carried out in which the search radius is always extended slightly if no target was found before. This way you always get exactly the target under the cursor, but if there is nothing there, then also more distant targets up to a search angle of 25 degrees. In addition, the switching on of missiles, enemies, capital ships, fighters, own things, astros, collectibles, gates, stations and even a nearby own ship for landing....
Plus, as a bonus, a teleport hotkey to the target (if allowed) and a laser point scanner to scan distant factories if you aim accurately.... But I might outsource both to another mod, also because I'd like to combine that with a commodity (long range scanner Mk3). Betty is also more talkative now, but that will also be a different MOD.
But now I'm cutting my teeth a bit on the subcomponents, it's not that easy. The kSET mod from you, Kuertee, helps only partially because it is a different approach. I don't want to define variables for it, but always associate everything from the current target.
A few questions about this:
1. if I read a subcomponent from the "player.target", how do I get the associated ship out (to find the next component of the ship, for example)? Haven't found anything on this... EDIT: I've figured it out in the meantime: ".parent"
2. is there another way than find_object_component to find subcomponents? I tried it with find_object and added e.g. class.turret to the search, but that doesn't work. This is about adding subcomponents directly under the cursor, i.e. extending the "line-of-sight" search with subcomponents, which does not work yet...
3. do only wards, L and XL ships really have sub-components? You can also build turrets on an M... But I can't find them with the Egosoft search either...
4. in your mod, Kuertee, there is the line: "<find_object_component groupname="$surfaceElements" object="$lastDefensibleTarget" operational="true" surfaceelement="true" multiple="true">". However, an auto-check with common.xsd and scriptproperties says this is wrong, operational="true" is supposedly not supported there. You might also be able to check it with a do-loop, but I don't know which is better. The way you do it is more elegant, but does it work properly?
5th (slightly different topic): If I add a commodity, e.g. to make advanced target functions (missile unlocking e.g.) dependent on expensive software, then this is no longer save-compatible, or is such a commodity simply ignored when the MOD is deleted again? Is there any way to do this anyway and remain safegame compatible?
6. is there somewhere a good tutorial (written, video translate is very exhausting for me), where the cues etc. is well explained? How do I nest them? Where does the programme jump to when I call cancel_cue? What does "this" or "parent" mean? How do I share variables elegantly in a common namespace, at the moment I do everything via global.xxx, which is perhaps not so clean... Way too many questions to answer directly, therefore tutorial, I need a crash course
As always, thanks for the answers...
Best regards
Schmollo aka Trajan von Olb.
Translated with
www.DeepL.com/Translator (free version)
Mein Traum vom Glück ist der Traum von einer anderen Menschheit. (S. Lem)