Lasertower Disaster

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
trekkie33
Posts: 94
Joined: Tue, 29. Dec 09, 19:55
x3tc

Lasertower Disaster

Post by trekkie33 » Sun, 7. Mar 10, 00:42

I found a really good way to take care of the kha'ak. 8)

Just script in some lasertowers and deploy a few thousand of them in each of the kha'ak systems.

Works Great!... :) Except... Now My computer runs at a few frames a minute because it has to keep track of them all... :headbang:

Looks like I need to find a way to get rid of a few thousand lasertowers. :roll:

Obviously I do not want to spend the next 5 weeks destroying them one by one. I can destroy a few hundred at one time with torpedoes if there close enough together to all be in the blast range.

Is there anyway I could reprogram a torpedo to have a larger blast radius. Or maybe wipe them out using script? :gruebel:

Any suggestions?

User avatar
Deadbeat_Spinn
Posts: 6483
Joined: Wed, 19. Nov 08, 20:47
x3tc

Post by Deadbeat_Spinn » Sun, 7. Mar 10, 00:49

IIRC, you could go into the Tmissile files and up the value of a given missile/torpedo so it would be far more powerful than originally intended. Not sure if the increased power of an altered missile/torpedo would increase the blast radius though.

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Sun, 7. Mar 10, 00:51

trekkie33
Just script in some lasertowers and deploy a few thousand of them in each of the kha'ak systems.
Did you write the script that deployed them? If so, It should then be possable for you to write another script that destroys them.

Or, you could script in 10,000 fighter drones and send them in to destroy the LT's. I can just imagine what that would do to your FPS.

Or use Cycrows cheat script to destroy all in sector.

MarCon

trekkie33
Posts: 94
Joined: Tue, 29. Dec 09, 19:55
x3tc

Reply

Post by trekkie33 » Sun, 7. Mar 10, 01:03

I actually just created an add ware script and added them to mammoths and then deployed them in key locations in the sectors.

User avatar
Lord Dakier
Posts: 3243
Joined: Fri, 8. Dec 06, 13:45
x4

Post by Lord Dakier » Sun, 7. Mar 10, 01:09

Just leave the sector and when the Khaak come back they should destroy them eventually.

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Sun, 7. Mar 10, 01:14

Ok, fair enough, keeps it versatile.

So you have some scripting experience then. My suggestion would be, creat a script that gets the objects from a sector filtered by type. there is a couple of ways you can do that. Then cycle these, the LT's, through a loop with the destroy command. You can either specify the sector in the script or get user input so you can pick the sector when you run the script.

It will give you some more scripting practice if nothing else. I found the best way to learn is pick something you want to do and keep fiddling until it does it.

MarCon

trekkie33
Posts: 94
Joined: Tue, 29. Dec 09, 19:55
x3tc

Reply

Post by trekkie33 » Sun, 7. Mar 10, 01:28

In response to a previous post, this also effects me when I am OOS so it is not a graphics issue it is a processing issue.

argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

Post by argon_emperor » Sun, 7. Mar 10, 01:33

Code: Select all

001   $ships =  get ship array: of race $race class/type=$object.class
002   if $ships
003   |$Size =  size of array $ships
004   |while $Size
005   ||dec $Size = 
006   ||$ship = $ships[$Size]
007   ||$ship -> destruct: show no explosion=[TRUE]
008   |end
009   end
010   return null
Just replace the $race with Player and $object.class with Lasertower.
It's a script I occasionally use to clean out the universe of things... :roll:
[ external image ]
***modified***
"You can get more of what you want with kind words and a gun, than you can with just kind words" - Al Capone

trekkie33
Posts: 94
Joined: Tue, 29. Dec 09, 19:55
x3tc

Reply

Post by trekkie33 » Sun, 7. Mar 10, 02:51

I cannot find the "|$Size = size of array $ships" command in the script editor.
Could you tell me where it is?

trekkie33
Posts: 94
Joined: Tue, 29. Dec 09, 19:55
x3tc

Copying Scripts

Post by trekkie33 » Sun, 7. Mar 10, 02:56

In another thread, someone provided me a script they had created.

Is there any way for me to copy it into the script editor without having to look up all of the command lines in the script editor.


{Better asked in the original thread, I think; merged - Carlo}

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Sun, 7. Mar 10, 03:18

You could ask them if they are willing to post or PM you a DL link to the script. If they are willing to post it on a file share site.

I don't know if its possable to just copy paste it into an external editor.

It's not possable to do this with the in game editor.

You could have asked this in the other thread possably.

MarCon

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Sun, 7. Mar 10, 03:20

In general -> arrays -> 6 down

Looks like this
<RetVar/IF> size of array <Var/Array>

MarCon

argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

Post by argon_emperor » Sun, 7. Mar 10, 03:36

Oh yeah, the vertical bars next to some of those lines aren't actually part of the script, they merely indicate the statement blocks' start and end points.
[ external image ]
***modified***
"You can get more of what you want with kind words and a gun, than you can with just kind words" - Al Capone

User avatar
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

Post by Krewzur » Sun, 7. Mar 10, 03:45

It usually works if you copy the text into notepad and then save it so it has .xml at the end of it's name.

Then put that in the scripts folder.

if you save it so it has a name for example like "setup.trekkie33.xml" it will run automatically when the game loads, without having to open the script editor. (But only if your're already playing a modded game)

I think the command line your're looking for is in the "General" section
Corsair 400c // Intel i7 8700k // H100i v2 // ASUS Maximus X Code // ASUS 1080ti Strix OC // 2x8GB Corsair Vengeance 3200MHz // Samsung 960 Evo 250GB // 960GB SanDisk Ultra II // Corsair RM850i

Retiredman
Posts: 795
Joined: Fri, 4. Sep 09, 02:35
x3ap

Post by Retiredman » Sun, 7. Mar 10, 03:51

Just dropping massive amounts of LT's in the sectors will give bad FPS.
more organized way of using them is Gazz's Ring of Fire.

You will lose a few to the Khaak but I placed a ring at the bottom of the Military base in the Khaak sector (pointed from my ship and not the base, in the Y axis)during the OFF. A couple of missions, I didn't even have time to jump to the sector to defend the station. (mission completed)The Ring did all the work and I got credit for it.

Hint for the FF escort missons:
Use the Super Tractor beam and pull the gates close(like next to each other)
Use 2 Rings of 130 towers and aline them on your ship in the X axis at a spacing of 3000. (2.5 - 3K away from the gates)
Then place two rings in the Y, out and centered between the two gates. One at 3000 meters and one at 4K. You would be suprise how the 4 rings protect the convoys. It eats the khaak Corvettes. 520 stealth lasertowers work real nice when you have overlapping fields of fire.

So many evil pirates have been zapped and no access to my hub since all gates have the RoF around them.

A must for any modded game.

User avatar
Carlo the Curious
Posts: 16999
Joined: Mon, 5. Mar 07, 22:03
x4

Post by Carlo the Curious » Sun, 7. Mar 10, 04:01

amurph0 wrote:It usually works if you copy the text into notepad and then save it so it has .xml at the end of it's name.
Does 'usually' mean you have actually done that with an X3 script? I'd be very surprised if it worked, given all the extra XML info in a normal script file.

User avatar
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

Post by Krewzur » Sun, 7. Mar 10, 04:03

Carlo the Curious wrote:
amurph0 wrote:It usually works if you copy the text into notepad and then save it so it has .xml at the end of it's name.
Does 'usually' mean you have actually done that with an X3 script? I'd be very surprised if it worked, given all the extra XML info in a normal script file.
I remember doing it somehow at some point, but it was over a year since i've been scripting for this game so i'm after forgetting :oops:
Corsair 400c // Intel i7 8700k // H100i v2 // ASUS Maximus X Code // ASUS 1080ti Strix OC // 2x8GB Corsair Vengeance 3200MHz // Samsung 960 Evo 250GB // 960GB SanDisk Ultra II // Corsair RM850i

trekkie33
Posts: 94
Joined: Tue, 29. Dec 09, 19:55
x3tc

Reply2

Post by trekkie33 » Sun, 7. Mar 10, 04:14

I created the code in the script editor but it isnot working as pland. The only result I can get is to blow up the ship that I am currently in by setting object.class to ship. When I set object.class to lasertower nothing happens. Is it how I am running the script?

Here is my exact script:

Code: Select all

001   $ships =  get ship array: of race Player class/type=Lasertower
002   if $ships
003   |$size =  size of array $ships
004   |while $size
005   ||dec $size = 
006   ||$ships = $ships[$size]
007   ||$ships -> destruct: show no explosion=[TRUE]
008   |end
009   end
010   return null

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

Post by mark_a_condren » Sun, 7. Mar 10, 04:18

trekkie33

Lines 6 and 7, change $ships to $ship

Code: Select all

006   ||$ships = $ships[$size] 
007   ||$ships -> destruct: show no explosion=[TRUE] 
Change to

Code: Select all

006   ||$ship = $ships[$size] 
007   ||$ship -> destruct: show no explosion=[TRUE] 
You are referencing the array, not and index from it.

EDIT: Don't forget, this will destroy ALL your Lasertowers, no matter where they are. So if you have any that are protecting anything, they will be gone and need replacing using this method.

MarCon

trekkie33
Posts: 94
Joined: Tue, 29. Dec 09, 19:55
x3tc

Thanks

Post by trekkie33 » Sun, 7. Mar 10, 04:36

It worked :)

Thank You for all your assistance.

Now my computer finally runs at normal speed.

i just wonder how I am going to get rid of those blasted kha'ak. :roll:

Oh yah... I just created a destroy all script. :twisted:

Post Reply

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