Problem i have is how to sort the array into different race objects (ships / stations). lets say for example i just want the Argon ships and stations ending up in the array, can that be done ? or maybe the array can be split into more arrays to store the different race objects?
Any tips or advice would be helpfull.
qwizzie
Code: Select all
$PageID = 9921
load text: id=$PageID
$playership = [PLAYERSHIP]
$sector = $playership-> get sector
$array.ship = $sector-> get ship array from sector/ship/station
$size = size of array $array.ship
while $size > 0
dec $size
$ship = $array.ship[$size]
$is.renamed = $ship-> get local variable: name='AS.Is.Renamed'
if $is.renamed != [TRUE]
$ship-> set local variable: name='AS.Is.Renamed' value=[TRUE]
$old.name = $ship-> get name
$new.name = sprintf: pageid=$PageID textid=100, $old.name, null, null, null, null
$ship-> set name to $new.name
end
do if $size == ($size / 20) * 20
= wait 100 ms
$array.station = $sector-> get station array from sector
$size1 = size of array $array.station
while $size1 > 0
dec $size1
$ship1 = $array.station[$size1]
$is.renamed1 = $ship1-> get local variable: name='AS.Is.Renamed1'
if $is.renamed1 != [TRUE]
$ship1-> set local variable: name='AS.Is.Renamed1' value=[TRUE]
$old.name1 = $ship1-> get name
$new.name1 = sprintf: pageid=$PageID textid=100, $old.name1, null, null, null, null
$ship1-> set name to $new.name1
end
do if $size1 == ($size1 / 20) * 20
= wait 100 ms
end
end
return null
Edit : small correction to code above