Frage zu Laserinstelletion <RefObj> -> add lasers per value: <Var/Number> flags: <Var

Hier ist der ideale Ort um über Scripts und Mods für X³: Terran Conflict und X³: Albion Prelude zu diskutieren.

Moderators: Scripting / Modding Moderators, Moderatoren für Deutsches X-Forum

User avatar
SuperVegeta
Posts: 1611
Joined: Tue, 20. Dec 05, 11:13
x3tc

Frage zu Laserinstelletion <RefObj> -> add lasers per value: <Var/Number> flags: <Var

Post by SuperVegeta »

Ich bastel grad an der x534 Mission für X3TC rum, ich hab so ziehmlich
allses bereits in griff, da vieles in der Version 338 in X3R bereits so
vorbereitet wurde das die Mission recht leicht an MODs anzupassen ist
und TC ist in dem Sinne auch nichts anderes wie ein MOD

Ein großes Prob ist die Laserinstallation einer guten Laserconfig,
für X3R STD hatte ich ja alle Schiffe und die gewünschte LAserconfig
in riesigen Datenbänken voreingestellt, für etwwa 200 Schiffe.
das ist natürlich sehr unpraktisch und inkompatible mit MODs und auch X3TC
dazu kommt X3TC hat 367 Schiffe und MODs für TC sicher ~500
unmöglich sowas als Datenbank

Hier kommt mir der neue Code für TC gerade recht, ich hab aber ein paar
probs mit dem
Frage weiß jemand wie dieser Code zu bedienen ist
Was muß wie bei "per Value" und "Flags" rein ????
<RefObj> -> add lasers per value: <Var/Number> flags: <Var/Number>

bei den Meisten Schiffe funzt er auch bei folgender einstellung
<Ship> -> add lasers per value: <12> flags: <null>
bei Huge Ships 2x ausgeführt

bei dem Xenon Tarnschiff (das ist das "Unbekannte Objekt" M3)
ShipType->Race=Xenon->Unbekannte Objekt Ihr versteht schon
das Schiff hat 8 Laserslots Haupt

bei ihm funzt es nicht, es wird nur 1 ISE installiert
bei Einstellung 100 statt 12 werden 4 EMP installiert
bei Einstellung 50 wieder 1 ISE installiert


bei einem Titantest
wurden bei 12er einstellung 2x ausgeführt zwischen etwa 4-8 verschiedene Lasertypen und davon je 4-20 Stück installiert

wichtig ist alle Slots sollen belegt werden mit einer vernünftigen kombination
Draguun
Posts: 293
Joined: Mon, 19. Jan 09, 17:30
x3tc

Post by Draguun »

Wie wäre es hiermit :
MADxHAWK wrote:Dieses Kommando fügt dem <RefObj> Laser hinzu wobei value <Var/Number> und flags <Var/Number> die Stärke der Bewaffnung angeben. Value=0 und flags=0 entsprechen hierbei keiner Bewaffung, Value=100 und flags=100 volle Bewaffnungmit den stärksten verwendbaren Lasern.
:wink:
Steht quasi hier
***modified*** und............geht auch nicht anders.
User avatar
SuperVegeta
Posts: 1611
Joined: Tue, 20. Dec 05, 11:13
x3tc

Post by SuperVegeta »

THX

Ich dacht das warn neuer Code, ich hab immer bei TC Knowlegebase gesucht, der weil ist der bloß umgezogen,
darum iss mir der auch jetz erst aufgefallen.

OK muß jetz mal testen
User avatar
SuperVegeta
Posts: 1611
Joined: Tue, 20. Dec 05, 11:13
x3tc

Post by SuperVegeta »

Naja so toll funzt die Codezeile nun aber doch nicht, vor allem da sie meist nur die Hälfte der Slots belegt,
Hab ich jetzt eine Neue Install-Default-Ithems Libery für X3-TC geschrieben,
hat zwar den ganzen Tag gedauert aber hier ist sie:
Ich Post sie mal... nur so:
Los gehts mit IDI.04
===============================================
Script x534.lib.IDI.04
Version: 400
for Script Engine Version: 43
Description
MAIN: Insall Default Items
Arguments

* 1: Ship , Var/Ship , 'Ship'
* 2: Xenon.P.TS , Value , 'Xenon.P.TS'

Source Text

001 * =============================================================
002 * Script by SuperVegeta
003 * =============================================================
004 $null = null
005 $Claster = null
006 $Huge = null
007
008 if $Ship -> is of class Riesenschiff
009 if not $Ship -> is of class TL
010 ║║$Huge = $Ship
011 end
012 else if $Ship -> is of class Kha'ak Cluster
013 $Claster = $Ship
014 goto label nicht.kombi
015 else
016 if $Xenon.P.TS
017 ║║goto label nicht.kombi
018 end
019 end
020 * =============================================================
021 * Ship Install Weapons
022 @ = [THIS] -> call script 'x534.lib.IDI.07' : Ship=$Ship Xenon.P.TS=$Xenon.P.TS
023 * =============================================================
024 * Ship Install Max Laderaum
025 @ = $null -> call script 'x534.lib.IDI.00' : Ship=$Ship
026 goto label for.all
027 nicht.kombi:
028 $Ship -> add default items to ship
029
030 * For All Ship
031 for.all:
032
033 * Ship Install Max Type and Max Num of Shild
034 if $Xenon.P.TS
035 $max.Shild.Type = $Ship -> get max. shield type that can be installed
036 @ = $null -> call script 'x534.lib.IDI.02' : Ship=$Ship Number=1 Ware=$max.Shild.Type
037 else
038 @ = $null -> call script 'x534.lib.IDI.06' : Ship=$Ship
039 end
040
041 * Ship Install Max Laderaum
042 @ = $null -> call script 'x534.lib.IDI.00' : Ship=$Ship
043
044 * Ship Install Software Items
045 @ = $null -> call script 'x534.lib.IDI.01' : Ship=$Ship
046
047 * Ship Install Max Triebwerk and Ruderoptimierung
048 @ = $null -> call script 'x534.lib.IDI.03' : Ship=$Ship
049
050 * Install Munition
051 @ = [THIS] -> call script 'x534.lib.IDI.05' : Ship=$Ship
052
053 * Install Missilles
054 @ = $null -> call script 'x534.lib.IDI.11' : Ship=$Ship
055
056 * Install KampfDrohnen
057 @ = $null -> call script 'x534.lib.IDI.12' : Ship=$Ship
058
059 return null
==============================================
==============================================
Weiter mit der IDI.07
Ist die Haupt routine für die Waffeninstallation
==============================================
Script x534.lib.IDI.07
Version: 400
for Script Engine Version: 43
Description
x534: Install Weapon auto for Ships
Arguments

* 1: Ship , Var/Ship , 'Ship'
* 2: Xenon.P.TS , Value , 'Xenon.P.TS'

Source Text

001 * =============================================================
002 * Script by SuperVegeta
003 * =============================================================
004 $null = null
005 $Claster = null
006 $Huge = null
007
008 if $Ship -> is of class Riesenschiff
009 if not $Ship -> is of class TL
010 ║║$Huge = $Ship
011 end
012 else if $Ship -> is of class Kha'ak Cluster
013 return null
014 else
015 if $Xenon.P.TS
016 end
017 end
018 * =============================================================
019 $TID = $Ship -> get number of turrets
020 while $TID
021 dec $TID =
022 skip if not $Ship -> can turret $TID fire missiles
023 ║║continue
024 $LB = $Ship -> get max. number of lasers in turret $TID
025 if $LB
026 ║║if $Ship -> is of class Großschiff
027 ║║║if $TID == 0
028 ║║║║@ $Leaser.0.1 = [THIS] -> call script 'x534.lib.IDI.09' : Ship=$Ship TSP=$Xenon.P.TS TID=$TID High=1,Low=2,Rand=0=1
029 ║║║else
030 ║║║║@ $Leaser.0.1 = [THIS] -> call script 'x534.lib.IDI.09' : Ship=$Ship TSP=$Xenon.P.TS TID=$TID High=1,Low=2,Rand=0=2
031 ║║║end
032 ║║else if $Ship -> is of class Kampfschiff
033 ║║║if $TID == 0
034 ║║║║@ $Leaser.0.1 = [THIS] -> call script 'x534.lib.IDI.09' : Ship=$Ship TSP=$Xenon.P.TS TID=$TID High=1,Low=2,Rand=0=1
035 ║║║else
036 ║║║║@ $Leaser.0.1 = [THIS] -> call script 'x534.lib.IDI.09' : Ship=$Ship TSP=$Xenon.P.TS TID=$TID High=1,Low=2,Rand=0=2
037 ║║║end
038 ║║else if $Huge == $Ship
039 ║║║@ $Leaser.0.1 = [THIS] -> call script 'x534.lib.IDI.09' : Ship=$Ship TSP=$Xenon.P.TS TID=$TID High=1,Low=2,Rand=0=1
040 ║║║@ $Variation.Laser = [THIS] -> call script 'x534.lib.IDI.09' : Ship=$Ship TSP=$Xenon.P.TS TID=$TID High=1,Low=2,Rand=0=2
041 ║║else
042 ║║║@ $Leaser.0.1 = [THIS] -> call script 'x534.lib.IDI.09' : Ship=$Ship TSP=$Xenon.P.TS TID=$TID High=1,Low=2,Rand=0=0
043 ║║end
044 ║║skip if $Huge == $Ship
045 ║║║$Variation.Laser = null
046 ║║@ = [THIS] -> call script 'x534.lib.IDI.10' : Ship=$Ship Turret.ID=$TID LeaserBays=$LB Leaser.Type=$Leaser.0.1 Variations.Leaser.Type=$Variation.Laser
047 end
048 end
049 return null
==============================================
==============================================
Weiter mit der IDI.09
Wählt einen Laser für das Turret aus
(Auswahlmöglichkeiten: Rand Stärkeren Halfte; Rand Schwächeren Hälfte; Random 100%; Stärksten; Schwächsten)
==============================================
Script x534.lib.IDI.09
Version: 400
for Script Engine Version: 43
Description
X534 get Laser HV LOW Rand of TID
Arguments

* 1: Ship , Value , 'Ship'
* 2: TSP , Value , 'TSP'
* 3: TID , Value , 'TID'
* 4: Type , Value , 'High=1,Low=2,Rand=0'

Source Text

001 * =============================================================
002 * Script by SuperVegeta
003 * =============================================================
004 $null = null
005 @ $Array = [THIS] -> call script 'x534.lib.IDI.08' : Ship=$Ship XTSP=$TSP TID=$TID
006 $Array.size = size of array $Array
007 if $Type == 1
008 $Array.size = $Array.size / 2
009 $rand = = random value from 0 to $Array.size - 1
010 else if $Type == 2
011 $rand = $Array.size / 2
012 $rand = = random value from $rand to $Array.size - 1
013 else if $Type == 0 OR $Type == null
014 $rand = = random value from 0 to $Array.size - 1
015 else if $Type == 3
016 $rand = $Array.size - 1
017 else if $Type == 4
018 $rand = 0
019 end
020 $Laser = $Array[$rand]
021 return $Laser
==============================================
==============================================
Weiter mit der IDI.08
ermittelt ein Array der nutzbaren Laser des Turrets
und sortiert es nach stärke der Laser (stärkste Laser kommt auf Array Index 0, je schwächer sesto höher der Index),
gibt das sortierte Array zurück
-Story-Item-88-89-90==Reparaturlaser, Mobiles Bohrsystem, Traktorstrahl
==============================================
Script x534.lib.IDI.08
Version: 400
for Script Engine Version: 43
Description
X534: get kompatible Laser of TID sorted Damage
Arguments

* 1: Ship , Value , 'Ship'
* 2: XTSP , Value , 'XTSP'
* 3: TID , Value , 'TID'

Source Text

001 * =============================================================
002 * Script by SuperVegeta
003 * =============================================================
004 $null = null
005 $Main.Array = $Ship -> get compatible laser array: turret=$TID
006 skip if $Ship -> get max. number of lasers in turret $TID
007 return null
008 skip if size of array $Main.Array
009 return null
010 $New.Main.Array = array alloc: size=0
011 $Main.Array.size = size of array $Main.Array
012 while $Main.Array.size
013 @ = wait randomly from 1 to 5 ms
014 dec $Main.Array.size =
015 $Laser = $Main.Array[$Main.Array.size]
016 @ $Check = [THIS] -> call script 'x534.plugin.Story.Items.Array.sv' : Item.Number=88
017 skip if $Laser != $Check
018 ║║continue
019 @ $Check = [THIS] -> call script 'x534.plugin.Story.Items.Array.sv' : Item.Number=89
020 skip if $Laser != $Check
021 ║║continue
022 @ $Check = [THIS] -> call script 'x534.plugin.Story.Items.Array.sv' : Item.Number=90
023 skip if $Laser != $Check
024 ║║continue
025 $D.S.1 = get shield damage of laser $Laser
026 $D.H.1 = get hull damage of laser $Laser
027 $D.1 = ( $D.S.1 + $D.H.1 ) / 2
028 if not size of array $New.Main.Array
029 ║║append $Laser to array $New.Main.Array
030 ║║continue
031 end
032 append $Laser to array $New.Main.Array
033 $New.Main.Array.size = size of array $New.Main.Array
034 while $New.Main.Array.size
035 ║║dec $New.Main.Array.size =
036 ║║@ = wait randomly from 1 to 5 ms
037 ║║$LB = $New.Main.Array[$New.Main.Array.size]
038 ║║skip if $Laser != $LB
039 ║║║continue
040 ║║$D.S.1 = get shield damage of laser $LB
041 ║║$D.S.1 = get hull damage of laser $LB
042 ║║$D.2 = ( $D.S.1 + $D.H.1 ) / 2
043 ║║skip if $D.1 > $D.2
044 ║║║break
045 ║║$New.Main.Array[$New.Main.Array.size] = $Laser
046 ║║$Num = $New.Main.Array.size + 1
047 ║║$New.Main.Array[$Num] = $LB
048 end
049 end
050 return $New.Main.Array
Last edited by SuperVegeta on Mon, 12. Oct 09, 14:40, edited 1 time in total.
User avatar
SuperVegeta
Posts: 1611
Joined: Tue, 20. Dec 05, 11:13
x3tc

Post by SuperVegeta »

==============================================
==============================================
Weiter mit der IDI.10
installiert 1-2 Lasertypen in ein Turret
Mod 1 installiert 1 Lasertype in alle Laserbays
Mod 2 installiert 2 Lasertypen in ~50% der Laserbays pro Lasertype
==============================================
Script x534.lib.IDI.10
Version: 301
for Script Engine Version: 43
Description
Install Weapons in of LaserBays in Turrets of Ship
Arguments

* 0: Ship , Var/Ship , 'Ship'
* 1: Turret.ID , Var/Number , 'Turret.ID'
* 2: LeaserBays , Var/Number , 'LeaserBays'
* 3: Leaser.Type , Var/Ware , 'Leaser.Type'
* 4: Variations.Leaser.Type , Var/Ware , 'Variations.Leaser.Type'

Source Text

001 * ==================================================================
002 * Script by SuperVegeta
003 * ==================================================================
004 $null = null
005 $Slot = 0
006
007
008
009 * Install STD.Weapon
010 * ==================================================================
011 if $Variations.Leaser.Type == null
012 while $Slot < $LeaserBays
013 ║║ = $Ship -> add 1 units of $Leaser.Type
014 ║║$Ship -> switch laser in turret $Turret.ID gun $Slot to $Leaser.Type
015 ║║inc $Slot =
016 end
017 * ==================================================================
018
019
020
021
022
023
024 * Mix Weapons
025 * ==================================================================
026 else if $Variations.Leaser.Type != null
027
028 * Formel for Mixberechnung
029 $Varuiation.num = $LeaserBays / 2
030 $Vari.Twin = $Varuiation.num / 2
031 $Slot.Var.1 = $LeaserBays - ( $Varuiation.num + $Vari.Twin + 1 )
032 $Slot.Var.3 = $LeaserBays - $Vari.Twin
033 if not $Vari.Twin >= 1
034 ║║$Slot.Var.1 = $LeaserBays - ( $Varuiation.num + 1 )
035 ║║$Slot.Var.3 = null
036 end
037
038 * Install MixWeapon
039 * ==================================================================
040 while $Slot < $LeaserBays
041 ║║$Leaser = $Leaser.Type
042 ║║
043 ║║if $Slot <= $Slot.Var.1
044 ║║║$Leaser = $Variations.Leaser.Type
045 ║║end
046 ║║if $Slot.Var.3 != null
047 ║║║if $Slot >= $Slot.Var.3
048 ║║║║$Leaser = $Variations.Leaser.Type
049 ║║║end
050 ║║end
051 ║║ = $Ship -> add 1 units of $Leaser
052 ║║$Ship -> switch laser in turret $Turret.ID gun $Slot to $Leaser
053 ║║inc $Slot =
054 end
055 end
056 * ==================================================================
057
058 return $null
059
060
==============================================
==============================================
Weiter mit der IDI.00
Install Laderaum MAX
==============================================
Script x534.lib.IDI.00
Version: 301
for Script Engine Version: 43
Description
Install max amount of Laderaum to Ships
Arguments

* 0: Ship , Var/Ship , 'Ship'

Source Text

001 * =============================================================
002 * Script by SuperVegeta
003 * =============================================================
004 $Lr = $Ship -> get max upgrades for upgrade Laderaumerweiterung
005 = $Ship -> install $Lr units of Laderaumerweiterung
006 return null
007
008

==============================================
==============================================
Weiter mit der IDI.06
Deinstalliert alle vorhandenen Schilde
Installiert Max Anzahl und Max Type Schilde
Story-Item-73-ist der Größte Schild den es gibt
Story-Item-75-ist die Anzahl an Schilden die eine Station haben soll
==============================================
Script x534.lib.IDI.06
Version: 400
for Script Engine Version: 43
Description
Install Max Shild Type and Num
Arguments

* 1: Ship , Var/Ship , 'Ship'

Source Text

001 * ==================================================================
002 * Script by SuperVegeta
003 * ==================================================================
004 start:
005
006
007 $Bays = $Ship -> get number of shield bays
008 while $Bays
009 dec $Bays =
010 while $Ship -> get shield type in bay $Bays
011 ║║$Type = $Ship -> get shield type in bay $Bays
012 ║║= $Ship -> install -1 units of $Type
013 end
014 end
015
016
017 $Max.Type.Shild = $Ship -> get max. shield type that can be installed
018 $Max.Shild.Bays.Num = $Ship -> get number of shield bays
019 if $Ship -> is of class Station
020 @ $Max.Type.Shild = [THIS] -> call script 'x534.plugin.Story.Items.Array.sv' : Item.Number=73
021 @ $Max.Shild.Bays.Num = [THIS] -> call script 'x534.plugin.Story.Items.Array.sv' : Item.Number=75
022 end
023
024
025 $Bays = 0
026 while $Bays < $Max.Shild.Bays.Num
027 if $Ship -> get shield type in bay $Bays
028 ║║$Type = $Ship -> get shield type in bay $Bays
029 ║║skip if $Type == $Max.Type.Shild
030 ║║║goto label start
031 else
032 ║║= $Ship -> install [TRUE] units of $Max.Type.Shild
033 end
034 inc $Bays =
035 end
036
037
038 $Max.Type.Shild = $Ship -> get maximum shield strength
039 $Ship -> set current shield strength to $Max.Type.Shild
040 return null
==============================================
==============================================
Weiter mit der IDI.01
Installiert Softwares (X3 Standartpacket)
==============================================
Script x534.lib.IDI.01
Version: 400
for Script Engine Version: 43
Description
Install TECH Default Items to Ships
Arguments

* 1: Ship , Var/Ship , 'Ship'

Source Text

001 * =============================================================
002 * Script by SuperVegeta
003 * =============================================================
004 $Ware = Bioscanner
005 skip if $Ship -> get amount of ware $Ware in cargo bay
006 = $Ship -> install 1 units of $Ware
007 $Ware = Boost Erweiterung
008 skip if $Ship -> get amount of ware $Ware in cargo bay
009 = $Ship -> install 1 units of $Ware
010 $Ware = Duplex Scanner
011 skip if $Ship -> get amount of ware $Ware in cargo bay
012 = $Ship -> install 1 units of $Ware
013 $Ware = Erkundungssoftware
014 skip if $Ship -> get amount of ware $Ware in cargo bay
015 = $Ship -> install 1 units of $Ware
016 $Ware = Frachtscanner
017 skip if $Ship -> get amount of ware $Ware in cargo bay
018 = $Ship -> install 1 units of $Ware
019 $Ware = Handelscomputer-Erweiterung
020 skip if $Ship -> get amount of ware $Ware in cargo bay
021 = $Ship -> install 1 units of $Ware
022 $Ware = Handelserweiterungskit Mk1
023 skip if $Ship -> get amount of ware $Ware in cargo bay
024 = $Ship -> install 1 units of $Ware
025 $Ware = Handelssoftware MK1
026 skip if $Ship -> get amount of ware $Ware in cargo bay
027 = $Ship -> install 1 units of $Ware
028 $Ware = Handelssoftware MK2
029 skip if $Ship -> get amount of ware $Ware in cargo bay
030 = $Ship -> install 1 units of $Ware
031 $Ware = Kampfsoftware MK1
032 skip if $Ship -> get amount of ware $Ware in cargo bay
033 = $Ship -> install 1 units of $Ware
034 $Ware = Kampfsoftware MK2
035 skip if $Ship -> get amount of ware $Ware in cargo bay
036 = $Ship -> install 1 units of $Ware
037 $Ware = Lebenserhaltung für Frachtraum
038 skip if $Ship -> get amount of ware $Ware in cargo bay
039 = $Ship -> install 1 units of $Ware
040 $Ware = Landecomputer
041 skip if $Ship -> get amount of ware $Ware in cargo bay
042 = $Ship -> install 1 units of $Ware
043 $Ware = Mineralienscanner
044 skip if $Ship -> get amount of ware $Ware in cargo bay
045 = $Ship -> install 1 units of $Ware
046 $Ware = Navigationssoftware MK1
047 skip if $Ship -> get amount of ware $Ware in cargo bay
048 = $Ship -> install 1 units of $Ware
049 $Ware = Patrouillensoftware
050 skip if $Ship -> get amount of ware $Ware in cargo bay
051 = $Ship -> install 1 units of $Ware
052 $Ware = Scoutspezialsoftware MK1
053 skip if $Ship -> get amount of ware $Ware in cargo bay
054 = $Ship -> install 1 units of $Ware
055 $Ware = Singularitäts-Zeitverzerrungsantrieb
056 skip if $Ship -> get amount of ware $Ware in cargo bay
057 = $Ship -> install 1 units of $Ware
058 $Ware = Spezialsoftware Mk1
059 skip if $Ship -> get amount of ware $Ware in cargo bay
060 = $Ship -> install 1 units of $Ware
061 $Ware = Sprungantrieb
062 skip if $Ship -> get amount of ware $Ware in cargo bay
063 = $Ship -> install 1 units of $Ware
064 $Ware = Versorgungssoftware
065 skip if $Ship -> get amount of ware $Ware in cargo bay
066 = $Ship -> install 1 units of $Ware
067 $Ware = Triplex Scanner
068 skip if $Ship -> get amount of ware $Ware in cargo bay
069 = $Ship -> install 1 units of $Ware
070 $Ware = Transporter
071 skip if $Ship -> get amount of ware $Ware in cargo bay
072 = $Ship -> install 1 units of $Ware
073
074
075 if $Ship -> is of class Großschiff
076 $Ware = Systemfirewall-Software
077 skip if $Ship -> get amount of ware $Ware in cargo bay
078 ║║= $Ship -> install 1 units of $Ware
079 $Ware = Interne Verteidigungslaser
080 skip if $Ship -> get amount of ware $Ware in cargo bay
081 ║║= $Ship -> install 1 units of $Ware
082 $Ware = Hüllenpolarisierungssystem
083 skip if $Ship -> get amount of ware $Ware in cargo bay
084 ║║= $Ship -> install 1 units of $Ware
085 end
086
087
088 return null
==============================================
==============================================
Weiter mit der IDI.03
ermittelt noch fehlende Ruder und Triebwerkstunings
und installiert sie
==============================================
Script x534.lib.IDI.03
Version: 301
for Script Engine Version: 43
Description
Install max amount of Tt + Ro to Ships
Arguments

* 0: Ship , Var/Ship , 'Ship'

Source Text

001 * =============================================================
002 * Script by SuperVegeta
003 * =============================================================
004 $curRo = $Ship -> get amount of ware Ruder-Optimierung in cargo bay
005 $curTt = $Ship -> get amount of ware Triebwerkstuning in cargo bay
006
007 $Tt = $Ship -> get max upgrades for upgrade Triebwerkstuning
008 $Ro = $Ship -> get max upgrades for upgrade Ruder-Optimierung
009
010 $New.Ro = $Ro - $curRo
011 $New.Tt = $Tt - $curTt
012
013 = $Ship -> install $New.Tt units of Triebwerkstuning
014 = $Ship -> install $New.Ro units of Ruder-Optimierung
015 return null
016
017
==============================================
==============================================
Weiter mit 05
Installiert Munition für Laser wenn benötigt
==============================================
Script x534.lib.IDI.05
Version: 400
for Script Engine Version: 43
Description
Install Munition
Arguments

* 1: Ship , Value , 'Ship'

Source Text

001 * =============================================================
002 * Script by SuperVegeta
003 * =============================================================
004 $null = null
005 $Array = array alloc: size=0
006
007
008 $main = [SSTYPE_LASER]
009 $sub = get number of subtypes of maintype $main
010 while $sub
011 dec $sub =
012 $Laser = get ware from maintype $main and subtype $sub
013 $Mun = get ammunition of laser $Laser
014 if $Mun != 0 AND $Mun != null
015 ║║append $Laser to array $Array
016 end
017 end
018
019
020 $Array.size = size of array $Array
021 while $Array.size
022 dec $Array.size =
023 $Laser = $Array[$Array.size]
024 $AM = $Ship -> get amount of ware $Laser in cargo bay
025 if $AM
026 ║║$Mun = get ammunition of laser $Laser
027 ║║$Mun.AM = $Ship -> get amount of ware $Mun in cargo bay
028 ║║$Mun.AM = ( $AM * 5 ) - $Mun.AM
029 ║║$free = $Ship -> get free amount of ware $Mun in cargo bay
030 ║║if $free >= $Mun.AM
031 ║║║= $Ship -> add $Mun.AM units of $Mun
032 ║║else
033 ║║║= $Ship -> add $free units of $Mun
034 ║║end
035 end
036 end
037
038
039 return null
Last edited by SuperVegeta on Mon, 12. Oct 09, 15:12, edited 2 times in total.
Draguun
Posts: 293
Joined: Mon, 19. Jan 09, 17:30
x3tc

Post by Draguun »

Looks nice. Allerdings ein wenig lang oder ? Ausrüsten nach default geht bei mir eigentlich gut, bis auf M7 da fehlen immer ein bis zwei Bestückungen im Hauptschacht und bei der Khaak Korvett sind 3x125MJ und 2x25MJ :o installiert. BigShips sind ebenfalls akzeptabel ausgerüstet (bis auf Raketen !!).
Natürlich nicht für MARS, hier brauchts noch Erweiterungen. Ich hab jetzt nur flüchtig drübergeschaut, aber ich glaub deins ist auch nicht MARS tauglich. Was ist eigentlich mit Software, Scanner...hab ich das jetzt bei dir übersehen ? (Kann ja sein)
***modified*** und............geht auch nicht anders.
User avatar
SuperVegeta
Posts: 1611
Joined: Tue, 20. Dec 05, 11:13
x3tc

Post by SuperVegeta »

==============================================
==============================================
Weiter mit 11
Installiert Missiles in 2 Modies
1. für Nicht Missile Boats 1-3 glaub MissileTyps 5 - 20 Stück
2. für Missile Boats M7M M8 u.a. Installiert 50 - 200 Stück aller möglichen Missiles
Story-Item-91-ist die Enterkapsel
==============================================
Script x534.lib.IDI.11
Version: 400
for Script Engine Version: 43
Description
Install Rokets in Ship
Arguments

* 1: Ship , Var/Ship , 'Ship'

Source Text

001 * ==================================================================
002 * Script by SuperVegeta
003 * ==================================================================
004 $null = null
005 @ $Enterkapsel = [THIS] -> call script 'x534.plugin.Story.Items.Array.sv' : Item.Number=91
006 $Array = array alloc: size=0
007 $main = [SSTYPE_MISSILE]
008 $sub = get number of subtypes of maintype $main
009 while $sub
010 dec $sub =
011 $Missille = get ware from maintype $main and subtype $sub
012 skip if $Missille AND $Missille != $Enterkapsel
013 ║║continue
014 $flags = get missile flags of $Missille
015 skip if not ( $flags & [Missile.Dumbfire] ) == [Missile.Dumbfire]
016 ║║continue
017 skip if not $Ship -> can missile $Missille be installed
018 ║║append $Missille to array $Array
019 end
020 * ==================================================================
021 * ==================================================================
022 * ==================================================================
023 if not $Ship -> is missile boat
024 $install = 5
025 skip if not $Ship -> is of class Großschiff
026 ║║$install = 10
027 $int = 2
028 while $int > 0
029 ║║@ = wait 1 ms
030 ║║$Array.size = size of array $Array
031 ║║$rand = = random value from 0 to $Array.size - 1
032 ║║$Missille = $Array[$rand]
033 ║║if $Missille
034 ║║║$free.amount = $Ship -> get free amount of ware $Missille in cargo bay
035 ║║║if $free.amount > $install
036 ║║║║= $Ship -> install $install units of $Missille
037 ║║║else
038 ║║║║= $Ship -> install $free.amount units of $Missille
039 ║║║end
040 ║║end
041 ║║dec $int =
042 end
043 * ==================================================================
044 * ==================================================================
045 * ==================================================================
046 else if $Ship -> is missile boat
047 $install = 50
048 skip if not $Ship -> is of class Großschiff
049 ║║$install = 200
050 $Array.size = size of array $Array
051 $install = $install / $Array.size
052 while $Array.size
053 ║║dec $Array.size =
054 ║║$Missille = $Array[$Array.size]
055 ║║if $Missille
056 ║║║$free.amount = $Ship -> get free amount of ware $Missille in cargo bay
057 ║║║if $free.amount > $install
058 ║║║║= $Ship -> install $install units of $Missille
059 ║║║else
060 ║║║║= $Ship -> install $free.amount units of $Missille
061 ║║║end
062 ║║end
063 ║║dec $int =
064 end
065 end
066 * ==================================================================
067 return null
==============================================
==============================================
Weiter mit 12
Installiert 5-20 eines Kampsdrohnentypes
Kampfdrohne, Kampfdrohne MKII, Kris
==============================================
Script x534.lib.IDI.12
Version: 400
for Script Engine Version: 43
Description
Install KampfDrohnen
Arguments

* 1: Ship , Var/Ship , 'Ship'

Source Text

001 * ==================================================================
002 * Script by SuperVegeta
003 * ==================================================================
004 $null = null
005
006
007 if $Ship -> is of class Kampfschiff
008 $install = 5
009 else if $Ship -> is of class Großschiff
010 $install = 20
011 else
012 $install = 10
013 end
014
015
016 $Kampfdrohnen = null
017
018 $KD1 = Kampfdrohne
019 $KD2 = Kampfdrohne MKII
020 $KD3 = Kris
021
022
023 while $install
024 if not $Ship -> can transport ware $KD1
025 ║║if not $Ship -> can transport ware $KD2
026 ║║║if not $Ship -> can transport ware $KD3
027 ║║║║return null
028 ║║║end
029 ║║end
030 end
031
032
033 if not $Ship -> get free amount of ware $KD1 in cargo bay
034 ║║if not $Ship -> get free amount of ware $KD2 in cargo bay
035 ║║║if not $Ship -> get free amount of ware $KD3 in cargo bay
036 ║║║║return null
037 ║║║end
038 ║║end
039 end
040
041
042 if not $Kampfdrohnen
043 ║║$rand = = random value from 1 to 4 - 1
044 ║║if $rand == 1
045 ║║║$Kampfdrohnen = $KD1
046 ║║else if $rand == 2
047 ║║║$Kampfdrohnen = $KD2
048 ║║else if $rand == 3
049 ║║║$Kampfdrohnen = $KD3
050 ║║end
051 end
052
053
054 if not $Ship -> get free amount of ware $Kampfdrohnen in cargo bay
055 ║║return null
056 end
057
058
059 if $Ship -> get free amount of ware $Kampfdrohnen in cargo bay
060 ║║= $Ship -> install 1 units of $Kampfdrohnen
061 ║║dec $install =
062 end
063 end
064
065
066 return null
==============================================
==============================================
==============================================


Ich hab den Post nochmal auf die entgültige Version gepatcht

Mars nutzt doch das was an bord ist genau wie mein AEGIS
bei Huge Ships außer TL werden 2x 50%Lasersets für jedes Turret Installiert
eins zur Jägerabwehr und eins für GKSabwehr
(Ich könnt das auch so programmiern das 2x 100% sets installiert werden)
eigendlich ist das für den Betrieb mit einem Feuerleit CPU gedacht,
allerdings nicht für MARS,MEFOS,AEGIS sondern einfach nur die EGO.turret.adv Kommandos
Kleine Schiffe mit nur einer Laserconfig bekommen EGO.turret.std Kommandos, halt ohne FeuerleitCPU

auf jeden Fall ist es besser als einfach nur
add Laser pervalue
add Shild pervalue
add default items

die ADD Ships sind Random ausgestattet, die mit dem Script sind
Voll ausgerüstet und einem Playership ebenbührtig, worums mir eigendlich ja ging

Return to “X³: Terran Conflict / Albion Prelude - Scripts und Modding”