im trying to create/addapt a script to allow ships to be build on a mobile shipyard.
im trying to use the Xtended scripts as a template, but i have no idea how to aproach this..
so i had a few ideas of wich i dont know if they will work but i hope somebody can help me with this..
There are a few scripts in Xtended of wich i suspect they got something to do with what im trying to achieve..
- plugin.XTC.ALM.POSY.xml
- plugin.XTC.Lib.CalcShipProdVals.xml
- plugin.XTC.Plot.SY.2.7.xml
- plugin.XTC.POSY.Choose.Upgrades.xml
- plugin.XTC.POSY.Equip.ship.xml
- plugin.XTC.POSY.ShowLicenses.xml
- plugin.XTC.POSY.SYBuilt.xml
im not sure if there are more involved with the mobile shipyard production.. if there are, pls let me know..
so, to start with the beginning i start with plugin.XTC.ALM.POSY.xml
Code: Select all
* X-Tended - Terran Conflict
$Page.ID = get global variable: name='XTC.PAGE.FRAMEWORK'
if $state == 'init'
* Shipyards
$docks = get station array: of race [Player] class/type=[Dock]
for each $SY in array $docks
= $null-> call script 'plugin.XTC.POSY.SYBuilt' : SY=$SY
end
else if $state == 'stop'
$shipyards = array alloc: size=0
set global variable: name='XTC.POSY.SYs' value=$shipyards
else if $state == 'repeat'
* Arans
$SYs = get ship array: of race [Player] class/type={Goner Aran (SH_G_MSY)}
$size.SYs = size of array $SYs
$production.lines = array alloc: size=1
while $size.SYs
dec $size.SYs
$SY = $SYs[$size.SYs]
= $null-> call script 'plugin.XTC.POSY.SYBuilt' : SY=$SY
end
* check SY removed?
$shipyards = get global variable: name='XTC.POSY.SYs'
for each $SY in array $shipyards
skip if $SY-> exists
= $null-> call script 'plugin.XTC.POSY.SYKilled' : argument1=$SY
end
* $shipyards = sort array $shipyards
* $shipyards = reverse array $shipyards
* set global variable: name='XTC.POSY.SYs' value=$shipyards
end
return null
return null
now to have this script work with another ship, would it be sufficient to copy this script, rename it and just change the "Arans" and "{Goner Aran (SH_G_MSY)}" to the ones from the ship i want to add..?
or
will it work if i just copy/past this section
Code: Select all
* Arans
$SYs = get ship array: of race [Player] class/type={Goner Aran (SH_G_MSY)}
$size.SYs = size of array $SYs
$production.lines = array alloc: size=1
while $size.SYs
dec $size.SYs
$SY = $SYs[$size.SYs]
= $null-> call script 'plugin.XTC.POSY.SYBuilt' : SY=$SY
end
Code: Select all
* Arans
$SYs = get ship array: of race [Player] class/type={Goner Aran (SH_G_MSY)}
$size.SYs = size of array $SYs
$production.lines = array alloc: size=1
while $size.SYs
dec $size.SYs
$SY = $SYs[$size.SYs]
= $null-> call script 'plugin.XTC.POSY.SYBuilt' : SY=$SY
end
* MyShip
$SYs = get ship array: of race [Player] class/type={Argon MyShip (SH_A_MyShip)}
$size.SYs = size of array $SYs
$production.lines = array alloc: size=1
while $size.SYs
dec $size.SYs
$SY = $SYs[$size.SYs]
= $null-> call script 'plugin.XTC.POSY.SYBuilt' : SY=$SY
end
another idea wich will probbably not work is the abillity to just put MyShip behind "{Goner Aran (SH_G_MSY)}" with a "," in between or something..?
it would look something like this
Code: Select all
$SYs = get ship array: of race [Player] class/type={Goner Aran (SH_G_MSY)},{Argon MyShip (SH_A_MyShip)}