 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
Gazz Moderator (Script&Mod)


Joined: 13 Jan 2006 Posts: 12159 on topic Location: Bavaria

|
Posted: Sun, 20. Jan 08, 00:20 Post subject: [S] Library for Border - Core Sector - Security Level |
|
|
My script was trying to find out if XYZ was a core sector.
Alas, there is no (working) script command for that and other than a fixed lookup table, noone had a solid solution for how to find out.
So I had to write my own.
| Code: |
| @ $Test = [THIS] -> call script 'lib.gz.is.a.core.sector' : Sector=$sector |
Script function returns
1 . . . if the provided sector is a CORE sector
null . . . if it's not
null . . . if the sector does not exist.
Unknown or pirate sectors all follow the same rules as border sectors so my script can not tell the difference.
If a sector is given to the player with the set owner instruction, the library will return the same result as before.
If Argon Prime is player owned it is still a core sector, Ore Belt is not.
Tested with X3 v2.5. Results were 100 % on target.
It will work with other versions but I have no idea if the results will be correct.
Download
This is freeware for all I care.
Everyone has my permission to use it and include it in script packages.
_________________ My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
Dogs and colour blindness explained: People with green eyes can't see dogs. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Lancefighter
Joined: 19 Dec 2004 Posts: 2935 on topic

|
Posted: Sun, 20. Jan 08, 02:13 Post subject: |
|
|
question - does it actually figure out if the sector is core/not somehow, or does it rather just look at a list?
_________________ in the market for a new sig, willing to pay 1 billion credits for a proper sig... |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Gazz Moderator (Script&Mod)


Joined: 13 Jan 2006 Posts: 12159 on topic Location: Bavaria

|
Posted: Sun, 20. Jan 08, 03:21 Post subject: |
|
|
| Lancefighter wrote: |
| question - does it actually figure out if the sector is core/not somehow, or does it rather just look at a list? |
The script is 26 lines total so there definitely is no list.
I use a formula and it should work with every kind of mod and galaxy.
Heh. I just saw that Cycrow put this function on the wishlist in 2006. =)
Come to think of it... there is one thing I still want to improve.
There will be an update...
EDIT: There has been an update.
The script can cause an unavoidable hickup if run In Sector so now it remembers the results and subsequent queries on the same sector are super fast.
I want to use this function on a possibly large number of scripts so it had better be fast.
Okay, so it got a few more lines now but I figure that's acceptable for being 100x as fast.
_________________ My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
Dogs and colour blindness explained: People with green eyes can't see dogs. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
ninjitsumonk

Joined: 01 Mar 2007 Posts: 1309 on topic Location: Yardley wood/warstock planetary defence base.

|
Posted: Mon, 11. Feb 08, 17:05 Post subject: |
|
|
hi gazz, this is an interesting take on how to check whether a sector is a core or border one. wouldn't have though of this myself, i've been trying to play with the find random sector..... secturity... but I can't quite work out how the command works yet, so I figured this script may be useful.
Just a some questions;
1-how does the notoriety of the buster in question and whether its allowed to dock or not define whether a sector is border or core?
2-am I allowed to completely tear apart your script for my needs? and if so, do you want credit(for the concept if nothing else)
Cheers
_________________
| Archeo Avis wrote: |
| Quote: |
| if you take out phrasing and root notes and just look at the notes, they are the same |
So what you're saying is, if you ignore everything that's different and focus only on the one thing that's the same, they're same.
Good God.
|
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
nirwin

Joined: 02 Nov 2005 Posts: 1185 on topic Location: UK

|
Posted: Mon, 11. Feb 08, 17:43 Post subject: |
|
|
Oooh, this could prove very useful to me sometime in the future. Bookmarking now.
Good work.
_________________ Nirwin
------
Sector Takeover | Unlimited Resources (x2/x3) |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Gazz Moderator (Script&Mod)


Joined: 13 Jan 2006 Posts: 12159 on topic Location: Bavaria

|
Posted: Mon, 11. Feb 08, 18:37 Post subject: |
|
|
| ninjitsumonk wrote: |
| i've been trying to play with the find random sector..... secturity... but I can't quite work out how the command works yet |
That's because it does not work at all - in regards to "security".
You can set that flag value to 1, 0, "Heinz Helmschtucker" or whatever you feel like.
| Quote: |
| 1-how does the notoriety of the buster in question and whether its allowed to dock or not define whether a sector is border or core? |
Remember how you were allowed to dock in some sectors but not in others at the game start? That rule applies to all ships.
| Quote: |
| 2-am I allowed to completely tear apart your script for my needs? and if so, do you want credit(for the concept if nothing else) |
I don't see how that would help. It can be used as a simple library and it can not find out any more than it already does.
It's easy enough for your script to check if this is a "race" sector with one or 2 lines (checking if race X is in the array of races that interest you) so I intentionally did not include this in the library to keep it flexible.
_________________ My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
Dogs and colour blindness explained: People with green eyes can't see dogs. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
ninjitsumonk

Joined: 01 Mar 2007 Posts: 1309 on topic Location: Yardley wood/warstock planetary defence base.

|
Posted: Mon, 11. Feb 08, 19:47 Post subject: |
|
|
Ah, I didn't want to find anything else out, just do a quick re-write to include it in one of my scripts, so as I'm making an array of all the sectors, I can make an array of their security levels aswel so that later ingame the check is ready and everything is already calculated.
_________________
| Archeo Avis wrote: |
| Quote: |
| if you take out phrasing and root notes and just look at the notes, they are the same |
So what you're saying is, if you ignore everything that's different and focus only on the one thing that's the same, they're same.
Good God.
|
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
shilhi

Joined: 15 Apr 2007
|
Posted: Sat, 8. Mar 08, 02:56 Post subject: |
|
|
So, basically when I conquer an Argon sector, I can actually set the sectors security? Also, dont think of me as a noob(not too much of a noob anyway ) but how do I install this?
|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Gazz Moderator (Script&Mod)


Joined: 13 Jan 2006 Posts: 12159 on topic Location: Bavaria

|
Posted: Sat, 8. Mar 08, 15:32 Post subject: |
|
|
This is a library function for other scripters. It has no direct use for a player.
_________________ My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
Dogs and colour blindness explained: People with green eyes can't see dogs. |
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
|
|