[S] Library for Border - Core Sector - Security Level

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

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

Post Reply
User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

[S] Library for Border - Core Sector - Security Level

Post by Gazz » Sun, 20. Jan 08, 00:20

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: Select all

@ $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. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Lancefighter
Posts: 2936
Joined: Sun, 19. Dec 04, 03:41
xr

Post by Lancefighter » Sun, 20. Jan 08, 02:13

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...

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sun, 20. Jan 08, 03:21

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. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
ninjitsumonk
Posts: 1309
Joined: Thu, 1. Mar 07, 10:21
x3

Post by ninjitsumonk » Mon, 11. Feb 08, 17:05

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:
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.

User avatar
nirwin
Posts: 1185
Joined: Wed, 2. Nov 05, 00:07
x3tc

Post by nirwin » Mon, 11. Feb 08, 17:43

Oooh, this could prove very useful to me sometime in the future. Bookmarking now.

Good work.
Nirwin
------
Sector Takeover | Unlimited Resources (x2/x3)

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Mon, 11. Feb 08, 18:37

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.
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.
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. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
ninjitsumonk
Posts: 1309
Joined: Thu, 1. Mar 07, 10:21
x3

Post by ninjitsumonk » Mon, 11. Feb 08, 19:47

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:
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.

shilhi
Posts: 640
Joined: Sun, 15. Apr 07, 23:28
x3tc

Post by shilhi » Sat, 8. Mar 08, 02:56

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 :wink: ) but how do I install this?

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sat, 8. Mar 08, 15:32

This is a library function for other scripters. It has no direct use for a player.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Post Reply

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