
enemy ships
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 1282
- Joined: Thu, 18. Mar 04, 02:03
enemy ships
I already have scripts to spawn as many of my ships as I want but is there one to spawn enemy ones that will attack?....I want to have some fun and spawn fleets of M2's and let them go at it 

-
- Posts: 985
- Joined: Sun, 7. Dec 03, 05:15
http://webpages.charter.net/kailric/A.S ... Attack.rar
here is a link that might get you started. I use a variant of this script all the time to spawn enemies ..in line 013 just change the ship type and owner to what ever you want. And change the "2000" in line 007 to spawn the ship as close as you want.
here is a link that might get you started. I use a variant of this script all the time to spawn enemies ..in line 013 just change the ship type and owner to what ever you want. And change the "2000" in line 007 to spawn the ship as close as you want.
Code: Select all
001
002 $ted = get player ship
003 $env = $ted -> get environment
004 $x = $ted -> get x position
005 $y = $ted -> get y position
006 $z = $ted -> get z position
007 $far = $z + 2000
008 $random1 = random value from 100 to 400 - 1
009 $random2 = random value from 100 to 400 - 1
010 $yrand = $y + $random1
011 $xrand = $x + $random2
012
013 $bounty = create ship: type=Pirate Orinoco owner=Pirates addto=$env x=$xrand y=$yrand z=$far
014 $bounty -> add default items to ship
015
016 @ = $bounty -> call script '!ship.cmd.attack.std' : the victim=[PLAYERSHIP] do not follow in new sector=null
017 return $bounty
"Try not. Do or do not, there is no try."-Yoda
"[Its] time for the human race to enter the solar system"-Dan Quayle
"[Its] time for the human race to enter the solar system"-Dan Quayle
-
- Posts: 1282
- Joined: Thu, 18. Mar 04, 02:03
-
- Posts: 671
- Joined: Mon, 3. Nov 03, 23:07
OK, easy fix. Go edit the script. Instead of Race = Pirates, select Race = Khaak. Then change type = Pirate Orinoco to Khaak Cluster or something to that effect. I'm pretty sure they're in there. I think you can select the type of cluster (it's size basically)RoguePhotonic wrote:Works good...only thing I dislike is one ship at a time...i'd like to have a verson that works through menu's such as making ships for yourself..picking how many and the type and location in a sector you want them.
Alternatively you can change it to a variable that asks you what type of ship to create every time it's run.
HTH
-
- Posts: 1282
- Joined: Thu, 18. Mar 04, 02:03
-
- Posts: 985
- Joined: Sun, 7. Dec 03, 05:15
ok here is a quick fix
how is this one?
http://webpages.charter.net/kailric/A.S ... k.menu.rar
Actually I am glad you asked this...been wondering just how to spawn more than one at a time to attack you and I figured it out on this one..
I was just using a script call to attack, but that didn't work as once you call the attack script the script thats spawns the ships ends and want start again.
But I add the prefix-Start at the begining of the script and it starts the attack script and continues with the spawning script..cool..thanks for the insperation!!
how is this one?
http://webpages.charter.net/kailric/A.S ... k.menu.rar
Actually I am glad you asked this...been wondering just how to spawn more than one at a time to attack you and I figured it out on this one..
I was just using a script call to attack, but that didn't work as once you call the attack script the script thats spawns the ships ends and want start again.
But I add the prefix-Start at the begining of the script and it starts the attack script and continues with the spawning script..cool..thanks for the insperation!!
"Try not. Do or do not, there is no try."-Yoda
"[Its] time for the human race to enter the solar system"-Dan Quayle
"[Its] time for the human race to enter the solar system"-Dan Quayle
-
- Posts: 1282
- Joined: Thu, 18. Mar 04, 02:03
Cool works good...only thing I dislike is the attack me thing..sometimes I just like to let loose enemy's on sectors
...hell even the khaak ships I spawn will follow me through the gates if I leave the sector....
I think I remember seeing where it says to attack me...I will just see if I can change that command.

I think I remember seeing where it says to attack me...I will just see if I can change that command.
-
- Posts: 985
- Joined: Sun, 7. Dec 03, 05:15
just delete the line that calls the "ship.cmd.attack" script. The ships will then spawn and then after several seconds the AI of the race you chose will automaticly take over and they will act on there own. Pirates will pirate, Khaak will khaak and such..
"Try not. Do or do not, there is no try."-Yoda
"[Its] time for the human race to enter the solar system"-Dan Quayle
"[Its] time for the human race to enter the solar system"-Dan Quayle