[Request]ADS & Smart Turret compatibility

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
ioulaum
Posts: 9
Joined: Thu, 26. Sep 13, 04:39
x4

[Request]ADS & Smart Turret compatibility

Post by ioulaum » Wed, 9. Oct 13, 15:19

Thanks for reading my topic.
There is a request,I'm using Smart Turrets instead of MARS.I want to setting turret mode in ADS,it should be in anarkis.acc.setup.ships.xml at line 76-77,but I don't know how to change MARS variable to Smart turrets.Please help me.

User avatar
anachron13
Posts: 144
Joined: Tue, 2. Nov 10, 23:41
x3tc

Post by anachron13 » Wed, 9. Oct 13, 15:33

You have to modify at least two scripts actually, first in anarkis.acc.setup.ships.xml, add something like this after the check for MARS (should be after line 84 which contain 'end' :

Code: Select all

$smart.check = get global variable: name='Glen.Smart.Turret'
if is datatype[$smart.check] == [DATATYPE_ARRAY]
$st = sprintf: pageid=$page.id textid=261, null, null, null, null, null
add custom menu item to array $menu: text=$st returnvalue=261
$st = sprintf: pageid=$page.id textid=262, null, null, null, null, null
add custom menu item to array $menu: text=$st returnvalue=262
end
then in anarkis.acc.apply.settings, add this between line 46 and 47 :

Code: Select all

else if $v1 == 261
$turret.script = 'glen.turret.smart.cmd.offense'
else if $v1 == 262
$turret.script = 'glen.turret.smart.cmd.defense'
And finally add this to the 8510-L0XX (XX depending of your language settings) t files :

Code: Select all

<t id="261">\033GSmart:\033X Offense</t>
		<t id="262">\033GSmart:\033X Defense</t>
You can add the others smart commands if needed, you will have to find the correct script to launch. If you don't want to edit the t file you can also use the sprint: fmt='text you want' command instead of sprintf: pageid=

ioulaum
Posts: 9
Joined: Thu, 26. Sep 13, 04:39
x4

Post by ioulaum » Wed, 9. Oct 13, 16:32

Sorry,I didn't make things clear.
I also installed Nicoman35's Real Wings Edition.
I followed your instruction,there are only three options to choose,smart turret option not included.

Edit:I think I need to change anarkis.acc.apply.settings.xml,they are not the same file between origin ADS and Real Wings Edition.

User avatar
anachron13
Posts: 144
Joined: Tue, 2. Nov 10, 23:41
x3tc

Post by anachron13 » Wed, 9. Oct 13, 18:48

Hum, the line numbers have probably changed and the returns value may be already used. I will give it a look when at home.

ioulaum
Posts: 9
Joined: Thu, 26. Sep 13, 04:39
x4

Post by ioulaum » Wed, 9. Oct 13, 19:00

I have done it!Understand this script and do some replacement with your code
anarkis.acc.apply.settings.xml

Code: Select all

if $turret.script == 0
while $turret.count > 1
dec $turret.count
skip if $ship-> is script 'glen.turret.smart.cmd.offense' on stack of task=$turret.count
$ship-> launch named script: task=$turret.count scriptname='glen.turret.smart.cmd.offense' prio=0, $turret.count, null, null, null, null
end

else if $turret.script == 1
while $turret.count > 1
dec $turret.count
skip if $ship-> is script 'glen.turret.smart.cmd.attack.target' on stack of task=$turret.count
$ship-> launch named script: task=$turret.count scriptname='glen.turret.smart.cmd.attack.target' prio=0, $turret.count, null, null, null, null
end

else if $turret.script == 2
while $turret.count > 1
dec $turret.count
skip if $ship-> is script 'glen.turret.smart.cmd.defense' on stack of task=$turret.count
$ship-> launch named script: task=$turret.count scriptname='glen.turret.smart.cmd.defense' prio=0, $turret.count, null, null, null, null
end

else if $turret.script == 3
while $turret.count > 1
dec $turret.count
skip if $ship-> is script 'glen.turret.smart.cmd.capture' on stack of task=$turret.count
$ship-> launch named script: task=$turret.count scriptname='glen.turret.smart.cmd.capture' prio=0, $turret.count, null, null, null, null
end

else if $turret.script == 4
while $turret.count > 1
dec $turret.count
skip if $ship-> is script 'glen.turret.smart.cmd.custom' on stack of task=$turret.count
$ship-> launch named script: task=$turret.count scriptname='glen.turret.smart.cmd.custom' prio=0, $turret.count, null, null, null, null

* Debug
if $DEBUG == 1
$txt = $info + $ship + ' turret number: ' + $turret.count + ' is set to Smart Turrets.'
write to log file 8510 append=[TRUE] value=$txt
end
end
else
while $turret.count > 1
dec $turret.count
skip if $ship-> is script 'glen.turret.smart.cmd.offense' on stack of task=$turret.count
$ship-> launch named script: task=$turret.count scriptname='glen.turret.smart.cmd.offense' prio=0, $turret.count, null, null, null, null
end
end
anarkis.acc.setup.ships line 76

Code: Select all

$mars.check = get global variable: name='Glen.Smart.Turret'
t file 8510

Code: Select all

 <t id="245">\033GSmart:\033X Offense</t>
 <t id="246">\033GSmart:\033X Attack My Target</t>
 <t id="247">\033GSmart:\033X Defense</t>
 <t id="248">\033GSmart:\033X Capture</t>
 <t id="249">\033GSmart:\033X Custom</t>
Works fine now!Thank you.

adrianx
Posts: 106
Joined: Sun, 24. Apr 11, 18:45
x3tc

Post by adrianx » Tue, 26. Nov 13, 19:14

Well done, I'd wondered about this myself a few months ago but never got around to looking at it.

You should let Nicoman35 know on http://forum.egosoft.com/viewtopic.php? ... 6&start=75 so he can incorporate your changes in his next version.

Post Reply

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