but it was allready reported, lol.
by the by, carriers wernt using its missiles?
it had about 1700 stings on board.

besty
/larxyz
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
Yes, I would have to detect some XRM related value, then pick either vanilla or XRM related wares.DrBullwinkle wrote:If you begin the tuning with "add default wares" then all ships should get the basic weapons; vanilla and modded alike.
If you want to add *more* weapons, then you could add mod-specific weapons.
The result would be that your Kha'ak might be "normal" strength in vanilla, but stronger-than-normal in XRM. I would think that would be acceptable to many players, without requiring you to maintain two versions of the script.
Code: Select all
* lasers
$t = $ship->get number of turrets
while $t
dec $t =
if $ship->can turret $t fire missiles
* Find and install valid missiles instead
continue
end
$l = $ship->get compatible laser array: turret=$t
$range = null
$range.val = 0
$strength = null
$strength.val = 0
$speed = null
$speed.val = 0
$index = size of array $l
while $index
dec $index =
$laser = $l[$index]
$temp = get range of laser $laser
if $temp > $range.val
$range.val = $temp
$range = $laser
end
$temp = get shield damage of laser $laser
$amt = get hull damage of laser $laser
$temp = $temp + $amt
if $temp > $strength.val
$strength.val = $temp
$strength = $laser
end
$temp = get bullet speed of laser $laser
if $temp > $speed.val
$speed.val = $temp
$speed = $laser
end
end
if random value from 0 to 4 - 1
if random value from 0 to 2 - 1
$laser = $range
else
$laser = $strength
end
else
$laser = $speed
end
$slots = $ship->get max. number of lasers in turret $t
= $ship->add $slots units of $laser
while $slots
dec $slots =
$ship->switch laser in turret $t gun $slots to $laser
end
end
Well, I think this is the difference between an advanced scripter and a wannabe like me. Hat down 789. I will try to improve my tune routine by using parts of yours7ate9tin11s wrote:The following code is how I handle weapon compatibility in ik2. Each ship randomly gets lasers which are best in strength, distance, or bullet speed for all turrets. So it does not matter the mod, something will fit in there!
I also have a much more randomized version for 'not best' ships, but enemies always need to be tuned up to the max, right?
-7ate9tin11s
Well, now you will understand why everything is so changeable in IK2, to make it work with any mod I have my little 'examine universe' initialization script (plugin.ik2.init)Nicoman35 wrote:Hey 7ate9tin11s, I used your routine to improve mines and to make it compatible to the vanilla version and to any mod. First I just wanted to make a XRM version, but on your and Doc's demand (and to keep fuss low), I try to get this as compatible as possible.
Ship tuning is no longer a problem. Only one thing left: How to check, if a certain ship class is available or not?
For example: I would like to create an advanced Khaak corvette. But this is only available in XRM, in vanilla only the normal corvette can be used.
a) Is there any command to check for the existance of a certain object class / ship class?
b) Or better check, if XRM is installed?
In case of b), is there any global variable other scripts use to identify XRM?
@ NighTragE There is a .bat file for deleting the KI scripts in the scripts.delete folder. Do you mean that?
Code: Select all
* ship classifications
$small = get ship type array: maker race={Kha'ak 7} class={M5 2025}
$temp = get ship type array: maker race={Kha'ak 7} class={M4 2024}
$small = [THIS]->call script '!lib.array.join' : a.arr1=$small a.arr2=$temp
$temp = get ship type array: maker race={Kha'ak 7} class={M3 2023}
$small = [THIS]->call script '!lib.array.join' : a.arr1=$small a.arr2=$temp
$medium = get ship type array: maker race={Kha'ak 7} class={M6 2026}
$temp = get ship type array: maker race={Kha'ak 7} class={M8}
$medium = [THIS]->call script '!lib.array.join' : a.arr1=$medium a.arr2=$temp
$temp = get ship type array: maker race={Kha'ak 7} class={TM 2141}
$medium = [THIS]->call script '!lib.array.join' : a.arr1=$medium a.arr2=$temp
$large = get ship type array: maker race={Kha'ak 7} class={M2 2022}
$temp = get ship type array: maker race={Kha'ak 7} class={M1 2021}
$large = [THIS]->call script '!lib.array.join' : a.arr1=$large a.arr2=$temp
$temp = get ship type array: maker race={Kha'ak 7} class={M0 2020}
$large = [THIS]->call script '!lib.array.join' : a.arr1=$large a.arr2=$temp
$temp = get ship type array: maker race={Kha'ak 7} class={M7 2027}
$large = [THIS]->call script '!lib.array.join' : a.arr1=$large a.arr2=$temp
$temp = get ship type array: maker race={Kha'ak 7} class={TL 2032}
$large = [THIS]->call script '!lib.array.join' : a.arr1=$large a.arr2=$temp