I don't know how to use "SIGNAL_CAPTURED" for the moment...
I sliced the end part of your "plugin.boarding.tele" script (after the % boarding teleport counter)
1 part for "EMPTY.SHIPS" (ships at NEUTRAL race, bailed crew)
and
1 part for "REGULAR.BOARDING" (Cycrow code)
For the "EMPTY.SHIPS" part my objectives is:
- Keep hull integrity (even if newbies marines in boarding crew)
- Switch quickly victim ship "NEUTRAL RACE" to "PLAYER RACE"
- Delete marines of the boarding crew from the attacker ship
- Re-create marines (sames names, sames skills, etc...) in victim ship
- Check for the RIGHT ARRAY and NUMBER of marines boarding the victim ship
- Keep hardware of boarded ship (as mentioned in previous post)
There is the end lines of "my" "plugin.boarding.tele"
Code: Select all
***
***
***
* boarded
if $done >= 100
$text = sprintf: pageid=$page.id textid=36, $aim, null, null, null, null
display subtitle text: text=$text duration=2000 ms
$count = size of array $aTakeMarines
* ------------ SHIP EMPTY ------------------
$mar.arr = $aim->get marines array
if $mar.arr == null
$empty.ship = [TRUE]
= wait randomly from 2000 to 3000 ms
START speak text: page=13 id=131 priority=10
$aim->set owner race to {Player}
= $aim->install 1 units of {Cargo Lifesupport System}
$mars.ejd = array alloc: size=0
$aMarines = $SHIP->get marines array
$sorted.mar.array = [THIS]->call script 'lib.cycrow.sortmarines' : a.marine=$aMarines a.type=null
$cnt.aMar = size of array $sorted.mar.array
while $cnt.aMar
if $aim -> free space for marines
$mar = $sorted.mar.array[$cnt.aMar]
$mar.name = $mar->get pilot name
$mar.race = $mar->get owner race
$mar.figh = $mar->get marine fighting skill
$mar.figh.new = [THIS]->call script 'plugin.boarding.marinesxp.solo' : skill=$mar.figh empty.ship=[TRUE]
$mar.hack = $mar->get marine hacking skill
$mar.hack.new = [THIS]->call script 'plugin.boarding.marinesxp.solo' : skill=$mar.hack empty.ship=[TRUE]
$mar.mech = $mar->get marine mechanical skill
$mar.mech.new = [THIS]->call script 'plugin.boarding.marinesxp.solo' : skill=$mar.mech empty.ship=[TRUE]
$mar.engi = $mar->get marine engineering skill
$mar.engi.new = [THIS]->call script 'plugin.boarding.marinesxp.solo' : skill=$mar.engi empty.ship=[TRUE]
$face = random value from zero to 4 - 1
$voice = random value from zero to 4 - 1
$psgr = $aim->create passenger in ship: name=$mar.name race=$mar.race voice=$voice face=$face
if $psgr->exists
$psgr->create marine from passenger: fighting=$mar.figh.new hacking=$mar.hack.new mechanical=$mar.mech.new engineering=$mar.engi.new
end
append $mar to array $mars.ejd
end
dec $cnt.aMar =
= $aim->add marine $mar to attack group on ship
$aim->set relation against {Player} to {Friend}
end
= wait 100 ms
$sector = [PLAYERSHIP]->get sector
$flags = [Find.Nearest] | [Find.Multiple]
$cnt.mars.ejd = size of array $mars.ejd
$cntr = 0
while 1
$astros = find ship: sector=$sector class or type={Astronaut 2064} race=null flags=$flags refobj=$SHIP maxdist=2000 maxnum=100 refpos=null
if $astros
$astro = $astros[0]
$astro->set relation against {Player} to {Friend}
if $astro->exists
$astro->destruct: show no explosion=[TRUE]
inc $cntr =
end
end
if $cntr == $cnt.mars.ejd
break
end
= wait randomly from 100 to 200 ms
end
= wait 1000 ms
$text = sprintf: fmt='Boarding success! (%s) tranfering control.', $aim, null, null, null, null
display subtitle text: text=$text duration=2000 ms
else
* ------------ NORMAL BOARDING ------------------
$empty.ship = [FALSE]
while $count
dec $count =
$m = $aTakeMarines[$count]
= $aim->add marine $m to attack group on ship
end
end
* PSCO1 keep initial ship's hardware BEGIN
$hw.arr = $aim->get ship hardware as array
$cnt.hw = array alloc: size=0
$size.hw = size of array $hw.arr
* Get initial hardware qty
$i = 0
while $i < $size.hw
$item = $hw.arr[$i]
$item.cnt = $aim->get amount of ware $item in cargo bay
append $item.cnt to array $cnt.hw
inc $i =
end
* Wait for boarding success
while [PLAYERSHIP]->is $aim a enemy
= wait 1000 ms
end
* Install for Shields
* Add for Equipment
= wait 2000 ms
* Clear hardware qty
sub.hwRemove:
$hw.arr2 = $aim->get ship hardware as array
$size.hw2 = size of array $hw.arr2
while $size.hw2 > 0
$item = $hw.arr2[0]
$item.cntremv = $aim->get amount of ware $item in cargo bay
$item.cntremv = -$item.cntremv
= $aim->install $item.cntremv units of $item
* = $aim->add $item.cnt units of $item
$text = sprintf: fmt='%s Removed', $item, null, null, null, null
display subtitle text: text=$text duration=800 ms
= wait 1000 ms
gosub sub.hwRemove
end
endsub
* Restore hardware qty
$i = 0
while $i < $size.hw
$item = $hw.arr[$i]
$item.qty = $cnt.hw[$i]
= $aim->install $item.qty units of $item
inc $i =
end
$aim->set current shield strength to 0
* PSCO1 Marines gain XP
if $empty.ship == [FALSE]
$bMarines = $aim->get marines array
$cnt.aMar = size of array $bMarines
while $cnt.aMar
dec $cnt.aMar =
$mar = $bMarines[$cnt.aMar]
$mar.name = $mar->get pilot name
$mar.race = $mar->get owner race
$mar.figh = $mar->get marine fighting skill
$mar.figh.new = [THIS]->call script 'plugin.boarding.marinesxp.solo' : skill=$mar.figh empty.ship=[FALSE]
$mar->set marine skill: engineering=$mar.figh.new
$mar.hack = $mar->get marine hacking skill
$mar.hack.new = [THIS]->call script 'plugin.boarding.marinesxp.solo' : skill=$mar.hack empty.ship=[FALSE]
$mar->set marine skill: hacking=$mar.hack.new
$mar.mech = $mar->get marine mechanical skill
$mar.mech.new = [THIS]->call script 'plugin.boarding.marinesxp.solo' : skill=$mar.mech empty.ship=[FALSE]
$mar->set marine skill: mechanical=$mar.mech.new
$mar.engi = $mar->get marine engineering skill
$mar.engi.new = [THIS]->call script 'plugin.boarding.marinesxp.solo' : skill=$mar.engi empty.ship=[FALSE]
$mar->set marine skill: engineering=$mar.engi.new
end
end
* ----------------- PSCO1 keep initial ship's hardware END --------------------
* failed
else
START speak text: page=13 id=604 priority=10
$text = sprintf: pageid=$page.id textid=37, $aim, null, null, null, null
display subtitle text: text=$text duration=2000 ms
$count = size of array $aTakeMarines
while $count
dec $count =
$m = $aTakeMarines[$count]
$m->destruct: show no explosion=[TRUE]
end
end
return null
This code work approximatively well, but I ve no choice to delete fast as possible all the ejected boarding crew
All my marines are teleported to the victim ship with the right array and number (with delete/re-create code)
The vanilla boarding routine work but just ~10 seconds then stop (maybe because the victim ship is already PLAYER RACE)
I didnt found how to just delete some marines in the attacker ship...
Certainly not conventionnal way but it work...