enemy ships

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

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

RoguePhotonic
Posts: 1282
Joined: Thu, 18. Mar 04, 02:03
x2

enemy ships

Post by RoguePhotonic »

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 :twisted:
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

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.


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
RoguePhotonic
Posts: 1282
Joined: Thu, 18. Mar 04, 02:03
x2

Post by RoguePhotonic »

:D :thumb_up: going to try it now.
RoguePhotonic
Posts: 1282
Joined: Thu, 18. Mar 04, 02:03
x2

Post by RoguePhotonic »

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.
BradThorn
Posts: 671
Joined: Mon, 3. Nov 03, 23:07
x2

Post by BradThorn »

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.
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)

Alternatively you can change it to a variable that asks you what type of ship to create every time it's run.

HTH
RoguePhotonic
Posts: 1282
Joined: Thu, 18. Mar 04, 02:03
x2

Post by RoguePhotonic »

Well I do change wha type of ships but I never through about who owns them lol...so my khaak M2's and enemy argon titans were owned by pirates :lol:
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

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!!
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
RoguePhotonic
Posts: 1282
Joined: Thu, 18. Mar 04, 02:03
x2

Post by RoguePhotonic »

Cool works good...only thing I dislike is the attack me thing..sometimes I just like to let loose enemy's on sectors :twisted: ...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.
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

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

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