Problems with move to debris/asteroid ... turn turret ... command

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
oechre
Posts: 9
Joined: Thu, 28. Jul 11, 15:15

Problems with move to debris/asteroid ... turn turret ... command

Post by oechre » Sat, 28. Jan 12, 11:32

the code I wanted is:

Code: Select all

$return=0
while $return != FLRET_FIREFREE
  $return = [THIS]-> move to debris/asteroid $Debris and turn turret $Turret to target:timeout= 60000
end
This will lock the game because pretty often the command will spam FLRET_ERROR

the workarround I found is to insert the following code into the loop

Code: Select all

if $return == FLRET_ERROR
  =[THIS]->move arround 9500ms
  = wait 10000 ms
end
This solution however is not much to my liking because the ship will eventually find a spot to fire from but it can take a darn long time
Has anyone an idea for a better sollution?

Thanks in advance

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Re: Problems with move to debris/asteroid ... turn turret ... command

Post by Gazz » Sat, 28. Jan 12, 17:32

oechre wrote:This will lock the game because pretty often
Of course. You just don't do loops without a wait.
Even 100ms will prevent the game from locking up.

You could also try evade with "avoid (debris)" to turn the ship away from the debris and possibly get another turret to bear.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

oechre
Posts: 9
Joined: Thu, 28. Jul 11, 15:15

Post by oechre » Sat, 28. Jan 12, 19:10

Thanks a bundle, I was looking for a better fly command then 'move arround'
somehow I overlooked the 'avoid' one.

I'll try it right now to see if it can reduce the time needed to get a FLRET_FIREFREE return :)

Post Reply

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