How do I use command.follow? My ship doesn't move. [SOLVED]

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

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

Post Reply
user1679
Posts: 784
Joined: Fri, 20. Jul 18, 23:20

How do I use command.follow? My ship doesn't move. [SOLVED]

Post by user1679 » Thu, 18. Aug 22, 08:24

I was looking at the mod "Mobile Repair Service" and wanted to change the ship's behavior from command.patrol to command.follow but I can't get the ship
to actually move. The UI updates that it is "following Elite Sentinel 1" and "flying to Elite Sentilen 1" but that's all.

The default code is:

<set_command command="command.patrol" />
<set_command_action commandaction="commandaction.standingby" />

Here's what I've tried:

<set_command command="command.follow" param="$target" />
<set_command_action commandaction="commandaction.flying" />

I also tried the following commandaction with the follow command:

<set_command_action commandaction="commandaction.flyingto" param="$target" />
<set_command_action commandaction="commandaction.standingby" />


When $target leaves the sector, the UI updates the "action" to "flying to superhighway" but again, the ship never actually moves.


Thanks for your suggestions!

user1679
Posts: 784
Joined: Fri, 20. Jul 18, 23:20

Re: How do I use command.follow? My ship doesn't move. [SOLVED]

Post by user1679 » Sat, 20. Aug 22, 03:59

I think I figured out the issue.

Assigning the command isn't enough to activate the base aiscript. To do that, you need to use create_job but I can't because
I need the job slot taken up by the repair job. The workaround is to handle the follow movement within the repair aiscript.

Post Reply

Return to “X4: Foundations - Scripts and Modding”