Script to move the player from one ship to another

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
Esc.Control
Posts: 66
Joined: Tue, 3. Jun 08, 05:31

Script to move the player from one ship to another

Post by Esc.Control » Mon, 9. Nov 15, 10:49

I've been studying all the documentation I can find, and I've yet to find anything that lays down exactly how to do this.

Desired behavior: A script command that will physically move the player from piloting one ship to another ship, in this case from a carrier ship to a fighter docked at that carrier, thereby launching the fighter. This is the exact same thing that would happen if you clicked on the fighter in your [R]Property Menu, then used Advanced > [X]Change Ship


In case you're curious, the end goal is to have a script that I can hotkey that will instantly do the following:
1) Put me into my personal fighter craft
2) Put the carrier on Attack All Enemies
3) Possibly launch some fighter wings based on context. Worry about this part later.

Obviously I can issue all those commands manually, but after doing so manually for the ten-thousandth time, I figure it's time to pursue some automation.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Mon, 9. Nov 15, 10:55

At the end of the General Object Commands you can find the command: <RetVar/IF> move player to ship <Var/Ship>: Teleport=<Var/Number>. You might have to undock the fighter from the carrier first.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Esc.Control
Posts: 66
Joined: Tue, 3. Jun 08, 05:31

Post by Esc.Control » Mon, 9. Nov 15, 10:58

Yup, there it is, plain as day. Shame I couldn't see that before I opened my big mouth. Thank you for the help!

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Mon, 9. Nov 15, 10:59

There is a command available to move the player from one ship to another.

its,

Code: Select all

<RetVar/IF> move player to ship <Var/Ship>: Teleport=<Var/Number> 
Var/Ship is the target ship you wish to move too. If Teleport is true, then the teleport animation is displayed, otherwise it just moves straight away.

To use this command, both ships must be in the same environment, so first tell the fighter to undock, then call the command once the fighter is in space

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”