script-Spawn Ship Commands v 0.2 (10-31-04)

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

script-Spawn Ship Commands v 0.2 (10-31-04)

Post by Kailric »

http://webpages.charter.net/kailric/Xai ... %200.2.zip


Version 0.2 is up. I edited the text file to include the names of the new commands. This will better help while editing these scripts. I have also included a tutorial on how to edit these scripts to do exactly what you would like them to do instead of the default command.



These scripts will spawn ships in different types of scenerios. I use these to test mods and Combat AI scripts. These have been configured to run with any combat scripts wiether default or Xai AI. I will update this further to include some of my special tournament scripts so that you can stage battles between Non player ships and see which one wins and keep a running count of the victor printed to log... sometime in the future.

Edit: added the readme:

These scripts will add these new commands to your piracy menu:
Notes:
-In order for Khaak ships to use their missiles, the race for that ship must be set to Khaak
-these scripts will work with the default AI or the Xai Advanced AI. Non player ships spawned with these scripts useing the Xai Advanced AI will have a random skill set
-this is also a means to build up your combat rank


Commands:

-Select Ship Attack : Select a ship type to attack you
-Instant solo Attack : You must enter the configuration of this script and setup what ship to attack and what race
-SpawnShipsAttack : Spawn any number of ships to attack you. Choose race and type.
-Install Ware: Install any ware on any ship
-Multiware Upgrade : installs max tunning,cargo, etc. and ship specific weapons and missiles and certain softwares
-Spawn PirateBase: spawns a pirate base with a defence of landed ships
-Destroy Target/All Enemys: If you have a target it will detroy the target alone, if you just press enter when asked for the "Option" it will destroy all enemy ships in the sector, if you enter "a" as the "Option" it will detroy all ships in the sector
-Get Loaded Ship : choose a race and it spawns a ship with default items of that race, more items if its the player's ship. Named races (Khaak, Argon, etc.) will cause the ship to start a default action after a short time, if you select "enemy, nuetral, or friendly race" no action will start.
-Simulate AI Battle : spawns 3 ships to attack one ship all AI control, you must set the race and type within the script it self
-Testing Script : this script can be configured to do anything you choose with the scripting commands, by default it prints the name of the targeted ship to log
-Khaak Attack: choose the number of M3s and the Choose the number of M5s and then choose a target for the ships to attack
-Simulate Test 2 :spawns two ships to battle, you must set the race and ship type within the script
-Simulate Test 3 :spawns two ships to battle, you must set the race and ship type within the script
-Guantlet: this will spawn the choosen ship to attack the player, once it is destroyed it will spawn another and continue to do so until the command is stopped
-Destroy flying wares : this is found in the 2 extra ships commands and it will detroy any flying ware. This keeps the space around the player from becomeing cluttered from battle debris
Last edited by Kailric on Mon, 1. Nov 04, 01:28, edited 3 times in total.
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
bladeuk
Posts: 2063
Joined: Sat, 8. May 04, 18:26
x3tc

Post by bladeuk »

ooo thanks, i cant wait to try this out :D :D :D :D :D :D :D
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

bladeuk wrote:ooo thanks, i cant wait to try this out :D :D :D :D :D :D :D
If you have any suggestions let me know, I may can work them up for you.......
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
bladeuk
Posts: 2063
Joined: Sat, 8. May 04, 18:26
x3tc

Post by bladeuk »

just had 5 minutes of fun blowing up raptors, i took on 5 at once at one point :D :D :D , really cool script but is there an option to place them in a sector rather than having them spawn next to you?
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

http://webpages.charter.net/kailric/Xai ... %200.2.zip


Version 0.2 is up. I edited the text file to include the names of the new commands. This will better help while editing these scripts. I have also included a tutorial on how to edit these scripts to do exactly what you would like them to do instead of the default command.

Tutorial:

This tutorial is for version 0.2 of the "Spawn ship Commands". It will demontrate the ease of editing the existing scripts to do what you would like it to do instead of the default setup.

-First find figure out what command you want to edit. For the example we will edit the "Get Loaded Ship"
command.
-Then Enter the script editor by pressing "crl-c" then "s" and then "enter". Now find and highlight the "init.TK.Combat.Simulator.df" script and press "enter". ( If you have not activated the script editor..go into space and type "Thereshallbewings" with a capitol T and if done right you will here a sound and then you can enter the script editor).
-Look for the name of the command that you want to edit..we find "Get Loaded Ship" on lines 24 and 25, look at line 25 and make note of what script is called for this command...it says "AA.BA.Getuship.df"
-Now hit the escape key, makeing sure not to save if you accidently made changes.
-Then find the noted script "AA.BA.Getuship.df" in the list of scripts and when its highlighted press "enter"

-Now we are in the script..the first thing we need to do is add a new argument. Find the Arguments section and scroll down until you highling <new argument> and press "enter".
-Now type in this word.."sector", press "enter", then you will be given a list of "script inputs", scroll down until you find the one that says Var/Sector and hit enter, and then the next part just asks for a name of this argument...we will name it what else but "sector", then hit "enter" again.
-Next scroll down the list of code until you get to line 9, when it is highlighted press the right arrow key until you highlight the "addto=$env" part, then press "enter". Now scroll down the list of Available Varables until you find the one named "sector" and press enter. Now hit "escape" key and when asked to save select yes. Hit escape again to exit the edit scripts part of the script editor.
-Now highlight the command "Reinit Script Caches" and press "enter", this will cause the changes that you just made to become available in your commands.
-Now run the "Get Loaded Ship" command again and you will now notice a new argument. You now have to select a sector for the ship to spawn in, and it will spawn with the exact coordinates your ship is at but in the sector choosen. Try this with a Nav Satilite with the player as its owner to test it out...
-Your done!!
Happy Scripting!!
Last edited by Kailric on Mon, 1. Nov 04, 01:26, edited 1 time in total.
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

bladeuk wrote:just had 5 minutes of fun blowing up raptors, i took on 5 at once at one point :D :D :D , really cool script but is there an option to place them in a sector rather than having them spawn next to you?
I posted a new version and have included a tutorial on how to edit these scripts to better suit your purpose...if you still can't figure this out let me know and I will make the script for you, but its pretty simple.
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
bladeuk
Posts: 2063
Joined: Sat, 8. May 04, 18:26
x3tc

Post by bladeuk »

It worked, Thank You so so so so so much

One more question though, when i was doing the var/sector bit i noticed there was a one to do with sector position, could i use this to place ships in a sector at a defined location?

If so would this mean re-writing alot of the script as i noticed it used alot of get player location commands?
matthewfarmery
Posts: 4133
Joined: Fri, 9. Apr 04, 17:49
x3

Post by matthewfarmery »

I tried several times to put pirates base to a certain location, but it didn’t work, unless there’s more that needs to be done, over to Kailric for the answer….
=
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

matthewfarmery wrote:I tried several times to put pirates base to a certain location, but it didn’t work, unless there’s more that needs to be done, over to Kailric for the answer….
It should be pretty simple. Just find the location with your ship. Make note of what the x y and z coordinates are and then go to the command line where the create ship or station is and then enter those numbers in the x y z argument part. Make sure to add the "-" if its a negative number...

Let me know if you need more help...
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
User avatar
Burianek
Posts: 2981
Joined: Mon, 29. Dec 03, 03:29
x3tc

Post by Burianek »

bladeuk wrote:It worked, Thank You so so so so so much

One more question though, when i was doing the var/sector bit i noticed there was a one to do with sector position, could i use this to place ships in a sector at a defined location?

If so would this mean re-writing alot of the script as i noticed it used alot of get player location commands?
Yes you can take a sector position as an argument and then spawn ships there. You don't need to get the playership position, it just saves asking for an argument.
Use that Var/Sector Position as an argument and then break it down into it's components

Code: Select all

$x = $position[0]
$y = $position[1]
$z = $position[2]
$sector = $position[3]
$ship = create ship: blah blah add to= $sector x= $x y= $y z= $z
Done.
Cheers.
"Nature's first green is gold" . . . stay golden.
E.R.Hyland
Posts: 277
Joined: Sun, 4. Apr 04, 00:08
x2

Post by E.R.Hyland »

Can you do a script that will get the Xenon M5,M4,M3's moving around like
they did in X-BTF, or at least one that pops them in random systems like the Khaak do just not Pirate systems. I think Pirate systems have enough problems.
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

E.R.Hyland wrote:Can you do a script that will get the Xenon M5,M4,M3's moving around like
they did in X-BTF, or at least one that pops them in random systems like the Khaak do just not Pirate systems. I think Pirate systems have enough problems.
There may be a script like this already? But yeah that would be an easy thing to do. It would have to be play tested for balance and would take a littile time one of the things I may get around to if noone else does :) I am swampped at the moment though and can't remember what it is I "am" suppose to be doing half the time :evil:
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
E.R.Hyland
Posts: 277
Joined: Sun, 4. Apr 04, 00:08
x2

Post by E.R.Hyland »

There may be a script like this already? But yeah that would be an easy thing to do. It would have to be play tested for balance and would take a littile time one of the things I may get around to if noone else does I am swampped at the moment though and can't remember what it is I "am" suppose to be doing half the time

That would be really cool, as I have looked around but I have not found any Xenon spawning scripts.

I think a cool way to do it would be to put a respawing gate near the Xenon ship yard, and have the Xenon pop up behind the gate when thay jump in (Like a one way linking gate to the other gate.).

I also think it would be nice if the Xenon M1&M2 could be ordered to protect their stations, so they stay off the shiping lane.

Hopefully you'll get some time it would be really nice if the Xenon weren't, so pathetic any more.
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

E.R.Hyland wrote:
That would be really cool, as I have looked around but I have not found any Xenon spawning scripts.

I think a cool way to do it would be to put a respawing gate near the Xenon ship yard, and have the Xenon pop up behind the gate when thay jump in (Like a one way linking gate to the other gate.).

I also think it would be nice if the Xenon M1&M2 could be ordered to protect their stations, so they stay off the shiping lane.

Hopefully you'll get some time it would be really nice if the Xenon weren't, so pathetic any more.
K, I have been working away from home the past few months but this job I am doing is about to get done and then I will be working right next door to home. That means I'll be getting home sooner and have more time to work on scripts...
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle

Return to “X²: The Threat - Scripts and Modding”