Khaak invasion script.

General discussions about the games by Egosoft including X-BTF, XT, X², X³: Reunion, X³: Terran Conflict and X³: Albion Prelude.

Moderator: Moderators for English X Forum

User avatar
mostlikely
Posts: 157
Joined: Sat, 29. Nov 03, 23:20
x4

Khaak invasion script.

Post by mostlikely »

I currently have no hosting.. so I'm going to write it like this.. ;)

Pretty simple script that gives all the khaak ships in the galaxy the order to come to you.. and well.. ;)
They fly the normal way.. so by gates.. wich is... interesting... but slow ..kinda..

You can easaly rewrite it to remove all khaak from the map or make another race invade your current sector = good learning material.

If anyone wants to host the .xml just call.
Enjoy.


Script khaak.invasion
Version: 0
for Script Engine Version: 22

Description:
Orders all khaak ships in galaxy to attack the sector the player is currently in
Arguments:
Null

Source Text:
001 *$writer = 'Mostlikey'
002 $race = Khaak
003 $total = 0
004 $sect = 0
005 $mx = get max sectors in x direction
006 $my = get max sectors in y direction
007 $ps = get player ship
008 $playersector = $ps -> get sector
009 $x = 0
010 while $x < $mx
011 $y = 0
012 while $y < $my
013 $sect = $sect + 1
014 $sector = get sector from universe index: x=$x, y=$y
015 $list = find ship: sector=$sector class or type=null race=$race flags=[Find.Multiple] refobj=null maxdist=9999999 maxnum=999999999 refpos=null
016 $i = size of array $list
017 $total = $i + $total
018 $j = 0
019 while $j < $i
020 $ship = $list[$j]
021 START $ship -> command COMMAND_INVASION : arg1=$playersector, arg2=null, arg3=null, arg4=null
022 $j = $j + 1
023 end
024 $y = $y + 1
025 end
026 $x = $x + 1
027 end
028 $output = $total + ' ' + $race + ' ships ordered to attack sector ' + $playersector
029 write to player logbook $output
030 return null
P88
Posts: 1456
Joined: Wed, 6. Nov 02, 20:31
x2

Post by P88 »

so basically if you don't keep on the move, sooner or later the Khaak will wipe out every sector in the universe (the ones you have visited/are in)?

002 $race = Khaak

changed to

002 $race = Argon

does that mean the Argon will attack every sector you are in? instead of the Khaak?
User avatar
mostlikely
Posts: 157
Joined: Sat, 29. Nov 03, 23:20
x4

Post by mostlikely »

No no.. it's not that complex..
The script just tells all khaak that are in the galaxy now to move to the sector you are in at the moment you activate the script.
After they all get to that sector (if not killed underway) they just hang around and do their usual khaak (killing) stuff.
It's a one shot script so all newly spawned khaak do their normal stuff and moving to an different sector does make the invading khaak follow you.

Calling all argon to an split sector would have some nice effects I reccon..
Krak
Posts: 56
Joined: Tue, 2. Sep 03, 01:02
x2

Post by Krak »

mostlikely wrote:No no.. it's not that complex..
The script just tells all khaak that are in the galaxy now to move to the sector you are in at the moment you activate the script.
After they all get to that sector (if not killed underway) they just hang around and do their usual khaak (killing) stuff.
It's a one shot script so all newly spawned khaak do their normal stuff and moving to an different sector does make the invading khaak follow you.

Calling all argon to an split sector would have some nice effects I reccon..
Or call all xenon :twisted:

Return to “X Trilogy Universe”