In my heavily modified game i have modded the Tships and Warelists files to solve a problem id posted about a long time ago - the pain in the behind of buying 20-30 different upgrades for all ships. Basically, ive given most classes their own warelists entry and made most wares built in (with some allowance for ship price/features, eg M3 is better equipped by default than M4, and S/M cargo restrictions)
One of the things I did was to make jumpdrives inbuilt, but this broke autojumping and jumping by the AI in general. I have since narrowed the problem down to this check in the !Move.Jump default script;
Code: Select all
skip if [THIS]->get true amount of ware {Jumpdrive 3983} in cargo bay
return {FLRET_ERROR}
Code: Select all
if [THIS]->is docked
= [THIS]->call script '!move.undock' :
end
skip if [THIS]->get true amount of ware {Jumpdrive 3983} in cargo bay
return {FLRET_ERROR}
$sector = $target
skip if $target->is of class {Sector 2001}
$sector = $target->get sector
$energy = [THIS]->needed jump drive energy for jump to sector $sector
$nume = [THIS]->get true amount of ware {Energy Cells 2013} in cargo bay
skip if $nume >= $energy
return {FLRET_ERROR}
* big ships take longer to jump than fighter escorts. So the escorts fly back
* by having the big ship jump before tellings escorts to jump we avoid that
skip if not [THIS]->is of class {Big Ship 2073}
$r = [THIS]->use jump drive: target=$target
if $withfollowers
$afollowers = [THIS]->get formation follower ships
if $afollowers
$s = size of array $afollowers
while $s > 0
dec $s =
$ship = $afollowers[$s]
$docked = $ship->get environment
if $docked != [THIS]
* 12Jan09: only ships that are not docked at leader undock for jump
$ship->interrupt with script '!ship.signal.leaderjumps' and prio 20: arg1=[THIS] arg2=$target arg3=$withfollowers arg4=null
end
end
end
end
* big ships should already have jumped
skip if [THIS]->is of class {Big Ship 2073}
$r = [THIS]->use jump drive: target=$target
return $r
My first question is - what would be an appropriate check to put in its place so it looks for jumpdrive ware, but does not require it to be 'truly' present in the cargo hold or be an installed, rather than inbuilt, extension?
My second question follows on from this - since most trade ships now have inbuilt jumpdrives, I would like to edit ALL AI ship settings, universe wide, to turn on autojump - ie, to edit their autojump settings. However, editing the Jobs file does not allow this option and im wondering if anyone knows a way to do this.
The last question is more difficult but flows from above - if the above two tasks were achieved, is there any EASY way to get ships with a jumpdrive to refuel their ecell supply when it drops below a certain level, or every so often? (Maybe the 'refuel jump' quantity in autojump settings, so that if they land in a station with ecells they automatically refuel?)
Thanks for all comments and help!