[X3 Script] Lasertower Array [2.0.01 compatible Upgrade]

The place to discuss scripting and game modifications for X³: Reunion.

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

Tritous
Posts: 899
Joined: Sat, 15. Jan 05, 17:20
x3tc

hmmmm

Post by Tritous » Sun, 22. Jan 06, 00:21

a few comments (as always from me lol) ...

firstly...hell yeah!!!!! finally a use for lasertowers...

secondly it would be much much much more appropriate to take lasertowers from the ship's cargo, otherwise I think there are ways of getting delivery services and stuff. what I read makes it sound like you just subtract the money and spawn them. perhaps that's the best way of doing it as far as shields are involved, but definately using lasertowers in cargo is the best way.

thirdly...would love to be able to do it remotely using my ships. I should be able to get a demeter superfreighter to jump into a sector and rapidly deploy 4 rings of lasertowers of different radiae then have if jump back to my lasertower complex. a Paranid SF can hold about 150 laswertowers at max, closer to 100 if you have JD fuel and a load of 125MW shield (hint hint).

still, I may get this script anyway, although in its current form it's a type of cheating. sick of losing nemesis' in ianamus zura. the teladi shipyard keeps spawning pirates, and the 3 M6s there are struggling. the three I have holding the xenon in nearby seem to be doing far better lol. damn pirate teladi.
Give a man a fire, he'll stay warm for a day
Set a man on fire, he'll stay warm for the rest of his life ;)

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13296
Joined: Sun, 15. Feb 04, 20:12
x4

Re: hmmmm

Post by euclid » Sun, 22. Jan 06, 13:48

Tritous wrote: ...... it would be much much much more appropriate to take lasertowers from the ship's cargo....
That's possible but would restrict the application of the script. How players would have 30, 60, 90, etc. LT's available? How long would it take to collect/produce them?
..would love to be able to do it remotely using my ships.......
I've chosen the player ship method to make thing not too easy. A remote deployment, athough possible without problem, would have a slight taste of cheating IMO. Provided you have the necessary cash you could overwhelm the X3 universe with LT arrays in a few minutes.
......a Paranid SF can hold about 150 laswertowers at max, closer to 100 if you have JD fuel and a load of 125MW shield (hint hint).....
That's the combination of your first two points. Besides my responses above there is a severe risk that your SF get attacked and destroyed while moving into position - a very expensive loss.
......in its current form it's a type of cheating.....
You pay for them and for the upgrades. You can see it as a kind of delivery, deploy and upgrade service where you have to be present personally (like placing a station). Not really a cheat IMO.


However, fell free to adjust the script to your personal needs. After all it's about fun :grin:


Cheers Euclid

User avatar
Trevelvis
Posts: 1042
Joined: Sun, 4. Apr 04, 15:20
xr

Post by Trevelvis » Sun, 22. Jan 06, 14:16

Is there anyway there can be a bit in the script that allows you to pick up the lasertowers later as I used this script for a Border control mission and it worked great but afterwards it was a real pain manually picking them up also the mission I did it with I only got paided 6.7 million so it wouldnt be fianancally viable to leave them . Thanks

Tritous
Posts: 899
Joined: Sat, 15. Jan 05, 17:20
x3tc

hmmm

Post by Tritous » Sun, 22. Jan 06, 14:17

as for getting hold of them...in my old game I have a megacomplex of 280 stations. it includes 6 lasertower fabs, and currently I get half a dozen every 20 minutes. in total I have about 600 and can't get rid of the things fast enough lol. the fab also produces about 6 125mw shields every 2 hours....among a LOT of other things. surely that's the best way of making a non cheat script since you need to get the towers to deploy. what the script would be doing then would be helping you transport the towers into an organised array. (from a scripting point of view you could say it was destroying 30 laser towers in the cargo then respawning 30 into space)

lasertowers are hard to get unless you make them yourself. if you do, there is no limit to how many and how fast you can make them. ore mines and SPPs are not hard to get for support....the limit is how fast I can get rid of and deploy the things lol
Give a man a fire, he'll stay warm for a day
Set a man on fire, he'll stay warm for the rest of his life ;)

User avatar
Malakie
Posts: 1061
Joined: Tue, 13. Apr 04, 23:08
x4

suggestion

Post by Malakie » Thu, 26. Jan 06, 01:55

Hi,

Is there any way to get this script to work with other ships instead of the ship I am in??

I did not understand that it only created the array around the ship my pilot is flying directly at first... I kept sending one of my ships to a location and telling it to deploy but it did not do anything... or so I thought. Imagine my surprise when I looked outside and saw over 100 laser towers pointed at me suddenly!! Thank god they were on my side! :o This is probably my funniest X3 moment to date).

And thank god for the retrieve deployed item command from another script (I think it is AalaardB's). I had to have one of my largest freighters retrieve all those towers.. imagine if I had to do it manually..

Anyhow, it would cool if there were some way to tell a different ship to do this so I could continue doing other things...

Malakie

User avatar
NZ-Wanderer
Posts: 1623
Joined: Thu, 5. Aug 04, 01:57
x4

Post by NZ-Wanderer » Thu, 26. Jan 06, 04:03

I have found if I want to ring a gate, using 700 is a good number, it seems to be the right amount to take any enemy out that dares jump through the gate :)

bengoin wrote:what would be a good number to add the the radius?
Link to the list of Mods working in X4-Foundations and also Link to the list of Mods working in X-Rebirth

NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.

ericbab
Posts: 68
Joined: Wed, 6. Jul 05, 16:19
x3

Re: suggestion

Post by ericbab » Thu, 26. Jan 06, 10:35

Malakie wrote:Hi,

Is there any way to get this script to work with other ships instead of the ship I am in??

I did not understand that it only created the array around the ship my pilot is flying directly at first... I kept sending one of my ships to a location and telling it to deploy but it did not do anything... or so I thought. Imagine my surprise when I looked outside and saw over 100 laser towers pointed at me suddenly!! Thank god they were on my side! :o This is probably my funniest X3 moment to date).

And thank god for the retrieve deployed item command from another script (I think it is AalaardB's). I had to have one of my largest freighters retrieve all those towers.. imagine if I had to do it manually..

Anyhow, it would cool if there were some way to tell a different ship to do this so I could continue doing other things...

Malakie
You know the bad thing about retrieving Lasertowers made from this script is when you redeploy them they lose there 125MW and go back to the default 25MW,

could someone make it stop? 83k for each one when relocating, expensive :P

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13296
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Thu, 26. Jan 06, 13:12

Reversing the LTA placement (retrieve them, that is) is not straightforward because the LT's come with 25 MJ shields if you produce, buy or scoop them up.

IMO the best solution would be to convice the Lasertower factories to produce them with 125MH shields in the first place.

Cheers Euclid

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 26. Jan 06, 13:18

u could tag the lasertower by using a local varible

so when thier deployed again if they have this tag, you can put a 125mw shield back on without the lose of money

not sure if this does it yet or not, but it might be worth using the laser towers in the cargo hold to deply instead of creating new ones

if theres not enough for the full array, just charge for the extra ones that are needed

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13296
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Thu, 26. Jan 06, 13:26

Cycrow wrote: u could tag the lasertower by using a local varible....
How does this work? Is it in internal variable like an object id?

Cheers Euclid

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 26. Jan 06, 13:31

local varibles can be attached to any object

im not sure if the local varibles would work on goods in your hold, would be worth testing out, if it doesn't work, u can use it on the ship wih a number of how many laswertowers are upgraded

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13296
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Thu, 26. Jan 06, 16:25

Due to the MSCI handbook all variables defined in a script are temporary, i.e. they are gone once the script has finished. I could not find any section on local variables but I would expect that the temporary nature is the same.

If I understand you correctly then assigning a local variable to an object (lasertower in this case) will stick to it like an object ID. So even after some game play time, loading of savegames etc. this object would still have the local variable attached to it, right?


I'm just curious to clarify this point because I once had a similar idea to tag objects by setting a special object ID. Apparently that is not possible.



Cheers Euclid

User avatar
Malakie
Posts: 1061
Joined: Tue, 13. Apr 04, 23:08
x4

oh how I wish..

Post by Malakie » Sat, 28. Jan 06, 12:01

Cycrow wrote:yeah scripts work the same way as multithreading does
they appear to run simultaneous, but in actual fact, only 1 thread is being process at any given time.

so when u have a script running, no other scripts will get processed until that script has finished, and if it takes long to finish the game cant be updated which gives you the temporary freezing, to solve this, you have interrupts, which will alow the game engine to carry on updating without blocking, so when the script reaches an interupt, more of the game gets process then it returns back this scripts and continues

so even a short wait will allow other scripts and the game engine to inturupt when it needs to process something else, which prevents the freezing.

Oh how I wish the Amiga was still around like in the old days.. Multitasking in true form. Geez I miss being able to run anything I wanted all at the same time.

I still have two of them but obviously I cannot play X3 on it... Now if Egosoft would update the code to take advantage of machines with dual core processing.. perhaps we could get 'some' multitasking out of the game...

Malakie

User avatar
Malakie
Posts: 1061
Joined: Tue, 13. Apr 04, 23:08
x4

HOw about...

Post by Malakie » Sat, 28. Jan 06, 12:03

Hi,

Since you did not or were not able to add a command so we can tell it how many actual laser towers we want, what about a command to remove them all if need be.. It is a real pain when I set them up only to find they end up hitting friendly stations because of where they are located... Picking them up is a real pain especially since you cannot sell them anywhere.

Malakie

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13296
Joined: Sun, 15. Feb 04, 20:12
x4

Re: HOw about...

Post by euclid » Sat, 28. Jan 06, 14:39

Malakie wrote:Hi,

Since you did not or were not able to add a command so we can tell it how many actual laser towers we want, what about a command to remove them all if need be.. It is a real pain when I set them up only to find they end up hitting friendly stations because of where they are located... Picking them up is a real pain especially since you cannot sell them anywhere.

Malakie
The number of LT's to be placed in a single array is fixed because of the finite number representation in scripting. If anyone has an idea how to solve that......

Incorporating a LT collect command is not that easy. First off it would collect all your LT's in a given sector and you may not want that. Secondly you would need a ship with sufficient cargo space to hold all the LT's and, in order not to lose the 125MJ shields, also the shields.

An alternative would be to sell all the deployed LT's in a given sector. That would be possible.

Cheers Euclid

Tritous
Posts: 899
Joined: Sat, 15. Jan 05, 17:20
x3tc

hmmm

Post by Tritous » Sun, 29. Jan 06, 11:35

couldnt you do a target thing that will only collect LTs within a certain radius?
Give a man a fire, he'll stay warm for a day
Set a man on fire, he'll stay warm for the rest of his life ;)

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13296
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Sun, 29. Jan 06, 14:01

Yes, that is possible. But selling them directly instead of collecting is easier to do.

Let's wait what happens in the next patch. Maybe the LT's come with 125MJ shields from the fab. The it's easy to to the collection.


Anyone cares to provide info on my question concerning set object ID or on the nature of local variables (see some posts above)?

Cheers Euclid

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Tue, 31. Jan 06, 00:37

euclid wrote:Due to the MSCI handbook all variables defined in a script are temporary, i.e. they are gone once the script has finished. I could not find any section on local variables but I would expect that the temporary nature is the same.

If I understand you correctly then assigning a local variable to an object (lasertower in this case) will stick to it like an object ID. So even after some game play time, loading of savegames etc. this object would still have the local variable attached to it, right?


I'm just curious to clarify this point because I once had a similar idea to tag objects by setting a special object ID. Apparently that is not possible.

Cheers Euclid
yeah, when attaching local varibles to objects, that varible will then be saved and can be used across scripts and will still exist in save games.
the only problem is, im not sure how lasertowers in your cargo hold are classed.

Local varibles will work on the depolyed LT's easy enough but not sure about when there in your cargo hold, if there classed as individal objects, or just a ware representation

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13296
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Tue, 31. Jan 06, 01:00

Thanks Cycrow!

I'll try it with an LT, collect it and redeploy it. Will see if the tag has survived.

Cheers Euclid

User avatar
Trevelvis
Posts: 1042
Joined: Sun, 4. Apr 04, 15:20
xr

Post by Trevelvis » Tue, 28. Mar 06, 12:01

have found if I want to ring a gate, using 700 is a good number, it seems to be the right amount to take any enemy out that dares jump through the gate
What would be the best plane to build on to stop any ship getting through a gate X-y, x-z or y-z ????

Post Reply

Return to “X³: Reunion - Scripts and Modding”