Find mission objects directly with Find_Object - how?

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Trajan von Olb
Posts: 573
Joined: Wed, 4. Feb 04, 21:39
x3tc

Find mission objects directly with Find_Object - how?

Post by Trajan von Olb »

Hi,

with my More Hotkeys - Advanced Targeting I have redefined targeting, and it actually works great (who wants to use SirNuke's Python tool).

But now I noticed that sometimes mission targets are "empty space" or ships cannot be switched on as mission targets (because they are too far away). I don't even want to talk about mines that are not recognised. Finally, I also find a hotkey good: "next mission target".

But how do I find these things? I work with "Find_Object" etc., is there perhaps some entry with "match" that I can use? How do the quest objects define themselves and how do I find them?

Thanks for answers. I would really like to extend the goal finding, I'm annoyed myself that I now have to take the mouse in my hand again every time for a mission, and that's exactly what I wanted to avoid :-)

Greetings

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)
kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Re: Find mission objects directly with Find_Object - how?

Post by kuertee »

Unfortunately, I don't think that's easy to do.

Mission targets (object or point in space) are saved in each mission.
To access them, you need to have the mission script reference.
And I don't think there's a register of all active missions that is accessible via the MD.
And when you do have that mission's script, you need to know which variable to access. They can be built differently.

But you can access the current active mission's autopilot target in the MD with: "player.activemissionwaypoint".
Trajan von Olb
Posts: 573
Joined: Wed, 4. Feb 04, 21:39
x3tc

Re: Find mission objects directly with Find_Object - how?

Post by Trajan von Olb »

Thank you very much! That should already help!

Can this variable theoretically also contain several waypoints (as with mines or laser towers), i.e. as an arrey? And - please excuse my lack of expertise - how do I tell e.g. "find object" to search EVERYWHERE, i.e. without any class at all? Alternatively, what "class" does "empty space" have?

Thanks as always for answers :-) You are great!

Greetings

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)
kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Re: Find mission objects directly with Find_Object - how?

Post by kuertee »

Unfortunately, no.
player.activemissionwaypoint is only the autopilot's next waypoint to its destination.
when a mission is active, and the mission script has set an object or position in space as a mission target or destination, then player.activemissionwaypoint guides the autopilot to that object or position.

Return to “X4: Foundations - Scripts and Modding”