EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[X3 Script] Lasertower Array [2.0.01 compatible Upgrade]
Post new topic Reply to topic Goto page 1, 2, 3  Next
View previous topic :: View next topic
Author Message
euclid





Joined: 15 Feb 2004
Posts: 7213 on topic
Location: Gower, South Wales
Thank you for registering your game
modified
PostPosted: Thu, 12. Jan 06, 19:13    Post subject: [X3 Script] Lasertower Array [2.0.01 compatible Upgrade] Reply with quote Print

Lasertower Array (download)
=====================

New Version - 2.0.01 compatible !!!

New features:

#1 Lasertowers now come automatically with 125 MJ shields: As part of the 2.0.01 Update all purchased or produced Lasertowers have 125 MJ shields. There is no need anymore to upgrade the shields from 25 MJ to 125 MJ.

#2 Remote placement: You do not need to be in the same sector anymore. The position of the Lasertowerarray is no longer determined by the player's ship. Instead just select a sector and within a position using numpad 2,4,6,8.

#3 Names for yout LT's are generated: As an additional user input a 'name' is requirered. All 30 Lasertowers are then named as 'name'0 to 'name'29.




Installation:

Copy the setup.lasertowerarray.xml and the lasertowerarray.xml into the 'scripts' folder of your 'X3' folder, and copy the 447003.xml into the 't' folder.



Usage:

You'll find a new ship special command. Click that then select sector/position, radius in metres of the circle of lasertowers (3000 is a good value, don't make it too small), select the orientation (0 for xy plane, 1 for yz plane and 2 for xz plane) and finally choose a name (for example 'Laser Southgate' will name your LT's 'Laser Southgate0' to 'Laser Southgate29').



Enjoy !


Cheers Euclid



Last edited by euclid on Fri, 10. Nov 06, 18:33; edited 5 times in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Skillers





Joined: 24 Apr 2005
Posts: 537 on topic
Location: Omicron Lyrae
Thank you for registering your game
PostPosted: Thu, 12. Jan 06, 19:20    Post subject: Reply with quote Print

Cool. Would be really good if you could select an object as the centre of the ring, like a station, though I guess you can get roung that by moving really close to the station then running it (just don't crash).

I can't wait to be able to afford building a tunnel out of an important gate...


_________________
"Warning, cargo bay now contains; Gate, Home of Light"
Back to top
View user's profile Send private message
bengoin





Joined: 31 Mar 2005
Posts: 161 on topic

Thank you for registering your game
PostPosted: Thu, 12. Jan 06, 21:51    Post subject: Reply with quote Print

looking forward to this

Back to top
View user's profile Send private message MSN Messenger
bendyspex





Joined: 13 Apr 2004
Posts: 708 on topic

Thank you for registering your game
PostPosted: Thu, 12. Jan 06, 22:15    Post subject: Reply with quote Print

Sounds great, this will help a lot in protecting my stations and gates. Thanks

Back to top
View user's profile Send private message
bengoin





Joined: 31 Mar 2005
Posts: 161 on topic

Thank you for registering your game
PostPosted: Thu, 12. Jan 06, 22:41    Post subject: Reply with quote Print

what would be a good number to add the the radius?

Back to top
View user's profile Send private message MSN Messenger
djssuk





Joined: 11 Dec 2003
Posts: 177 on topic

Thank you for registering your game
PostPosted: Thu, 12. Jan 06, 22:59    Post subject: Reply with quote Print

Sounds great.

How about the player specifying the X number of lazer towers and then a point on the map, the radius then calculates X distance bewteewn each one? Just some ideas.

By the way, the link seems to fail at the moment. I will try later.

Thanks

Back to top
View user's profile Send private message
euclid





Joined: 15 Feb 2004
Posts: 7213 on topic
Location: Gower, South Wales
Thank you for registering your game
PostPosted: Thu, 12. Jan 06, 23:33    Post subject: Reply with quote Print

djssuk wrote:

......How about the player specifying the X number of lazer towers and then a point on the map, the radius then calculates X distance bewteewn each one? ..


Yes, initially I had a similar idea. I've spent the last night (5 bloody hours !!) to get a general placement script working.

But the trouble is that the script editor allows only integers between -999,999,999 and 1,410,065,407. You can imagine that basic maths like trigonometric functions, powers, roots etc. are next to impossible.

I've managed to get this working in the early morning hours but there was a big problem: the script puts a heavy load on the program (lag, freeze even ctd) and inserting wait states to fix that made the script to run too long. So I've decided to dump it.

The above script is fast and light - a good compromise IMO.

Quote:

By the way, the link seems to fail at the moment. I will try later.


Yes, the upload has not yet arrived. Can't be long but if you want it right now then PM me your email and I'll send you the zip.

Cheers Euclid

Back to top
View user's profile Send private message Send e-mail MSN Messenger
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 19848 on topic
Location: London
Thank you for registering your game
PostPosted: Thu, 12. Jan 06, 23:40    Post subject: Reply with quote Print

euclid wrote:
djssuk wrote:

......How about the player specifying the X number of lazer towers and then a point on the map, the radius then calculates X distance bewteewn each one? ..


Yes, initially I had a similar idea. I've spent the last night (5 bloody hours !!) to get a general placement script working.

But the trouble is that the script editor allows only integers between -999,999,999 and 1,410,065,407. You can imagine that basic maths like trigonometric functions, powers, roots etc. are next to impossible.

I've managed to get this working in the early morning hours but there was a big problem: the script puts a heavy load on the program (lag, freeze even ctd) and inserting wait states to fix that made the script to run too long. So I've decided to dump it.

The above script is fast and light - a good compromise IMO.

Quote:

By the way, the link seems to fail at the moment. I will try later.


Yes, the upload has not yet arrived. Can't be long but if you want it right now then PM me your email and I'll send you the zip.

Cheers Euclid


there are actually libriaries available to to do fixed point maths, theres the old X2 math library by reven, and AalaarDB has dont one for X3, there are also trigenomitry commands in the script engine, but it uses fixed point maths rather than floating points

as for the waits, e ven a wait of 1ms can help, as it adds an interupt point so other scripts can be run without blocking the game causing the freezeing


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
euclid





Joined: 15 Feb 2004
Posts: 7213 on topic
Location: Gower, South Wales
Thank you for registering your game
PostPosted: Fri, 13. Jan 06, 01:37    Post subject: Reply with quote Print

Cycrow wrote:

...there are actually libriaries available to to do fixed point maths, theres the old X2 math library by reven, and AalaarDB has dont one for X3, there are also trigenomitry commands in the script engine, but it uses fixed point maths rather than floating points

as for the waits, e ven a wait of 1ms can help, as it adds an interupt point so other scripts can be run without blocking the game causing the freezeing


Thanks for the info, Cycrow. Didn't know that 1ms can make that much of a difference. Will try that in my Fear-the-Sphere script (places LT's pseudo-uniformly on a sphere) which takes too much time to execute.

I know reven's libs and have downloaded AalaarDB's 3d-math lib. Also I have played with the built-in sine/cosine funtions but all this did not help very much. Guess it was my fault - first go in that direction Embarassed

One big problem I have is the limited number rep (which makes, for example, a power series approximation very difficult). You not just have to check the upper rep limit but also the lower rep limit and that is time consuming.

A particular problem is to determine the plane perpendicular to a given direction. I've tried the buit-in trigs and then the 3d math lib functions. All results were to imprecise.

I'm working on a general solution for that.



BTW: the download link in my first post is now up and running . Big thanks again to ESD for hosting !


Cheers Euclid

Back to top
View user's profile Send private message Send e-mail MSN Messenger
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 19848 on topic
Location: London
Thank you for registering your game
PostPosted: Fri, 13. Jan 06, 01:44    Post subject: Reply with quote Print

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.


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
RRRoamer





Joined: 21 Feb 2004
Posts: 324 on topic
Location: New Mexico
Thank you for registering your game
PostPosted: Fri, 13. Jan 06, 03:30    Post subject: Reply with quote Print

Actually, to be more specific, scripts run the same way a coopertive multitasking does.


_________________
--RRRoamer
Back to top
View user's profile Send private message
euclid





Joined: 15 Feb 2004
Posts: 7213 on topic
Location: Gower, South Wales
Thank you for registering your game
PostPosted: Fri, 13. Jan 06, 04:43    Post subject: Reply with quote Print

In this case, wouldn't it be wise to use random waits rather than fixed values?

I think wait randomly between .... ms and ..... ms would reduce the probability to have no time gap at all.

This could happen if a large number of scripts are running using fixed wait states. Could explain some lag/freezing/ctd problems.

Cheers Euclid

Back to top
View user's profile Send private message Send e-mail MSN Messenger
ericbab





Joined: 06 Jul 2005
Posts: 68 on topic

Thank you for registering your game
PostPosted: Fri, 13. Jan 06, 05:02    Post subject: Reply with quote Print

May, i Just State that you guys are GOds Among men, using the math leant yesterday, ToDAY!

Back to top
View user's profile Send private message Send e-mail MSN Messenger
BlueSwede





Joined: 07 May 2005
Posts: 243 on topic
Location: Sweden
Thank you for registering your game
PostPosted: Fri, 13. Jan 06, 06:32    Post subject: Reply with quote Print

Exactly how does I check I have any scripts that use "command_special_23 with tid 523"?

I checked that I didn't have any text file 447003 in my t folder

Back to top
View user's profile Send private message
euclid





Joined: 15 Feb 2004
Posts: 7213 on topic
Location: Gower, South Wales
Thank you for registering your game
PostPosted: Fri, 13. Jan 06, 12:16    Post subject: Reply with quote Print

BlueSwede wrote:
Exactly how does I check I have any scripts that use "command_special_23 with tid 523"?

I checked that I didn't have any text file 447003 in my t folder


Due to the list in the sticky these values are not yet been taken. So if you do not run any other (than in the com. script sticky) scripts then this should be fine.

Cheers Euclid

Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Tue, 21. May 13, 03:39

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2009
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.22276 seconds, sql queries = 75