[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

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: 13300
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: 22230
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: 13300
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: 22230
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: 13300
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: 13300
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: 13300
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: 22230
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: 13300
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 ????

kitkat_mike
Posts: 8
Joined: Wed, 1. Mar 06, 07:47
x3

Post by kitkat_mike » Tue, 2. May 06, 22:32

Good script.

Could you make a similar script to lay mine fields?

szuur
Posts: 543
Joined: Fri, 12. Aug 05, 22:26
x3

Post by szuur » Fri, 21. Jul 06, 18:22

nice script
question is it possible to make a circle with em witha second command or something.
so in stead of random places u would make a circle around a gate. could come in handy when placing em around a jumpgate,perhaps a 2nd number for different amouts of lasertowers
i think i would be something like u pick a gate, Y-Z plane orientation for a west-east gate X- Z for a north or south gate. with a fixed radius of,
i measured it with a disco i went at a side from the gate and it was 1.4 so probly the gd radius of one is 1.8km or something.
think this can be made?

User avatar
Actorius
Posts: 170
Joined: Mon, 10. May 04, 10:47
x4

Post by Actorius » Sat, 22. Jul 06, 11:52

EDIT lol... i made this big huge post without looking to see which thread i was in.... :oops: yes this can be used to make lasertower rings of fire around gates
Attenion: One of your ships is under attack: Heretics End... Attention: One of your ships is under attack: Heretics End... Attent...

Oh shut the @*#@ up its only a bloody adv sat!

Tiedyeguy
Posts: 1156
Joined: Mon, 16. Feb 04, 03:39
x4

Post by Tiedyeguy » Tue, 3. Oct 06, 13:37

This really isn't what I am looking for.... I am looking for something that when LTs are dropped en masse from a cargo hold (I can produce lots of free LTs) it simply aligns them into some sort of equally spaced pattern. That pattern can be a ring, sphere, or wall, I don't care as long as my freely produced LTs don't kill eachother when they fire. Maybe use the extra commands option to input X number of LTs dropped, they are then formed into one of the above patterns without charging me 6-some million credits.
That stated, A. does anybody know of any existing script that is better suited for my needs? If A. is negitive then B. how hard would it be to make something like this?
Thanks a billion in advance, Brian
:EDIT: I found "Ring of Fire" (http://forum2.egosoft.com/viewtopic.php?t=127826) further down the script list. This seems much better suited for what I need. Thanks anyways.

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

Post by euclid » Fri, 10. Nov 06, 17:35

2.0.01 compatible and upgraded version (see first post).

Cheers Euclid

Post Reply

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