[Library] V1.0final 29.01.05 Manage forbidden areas

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

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

Post Reply
Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

[Library] V1.0final 29.01.05 Manage forbidden areas

Post by Naffarin » Sun, 22. Jan 06, 13:07

What's this ?
Following an idea of Lucike in the german forum to block certain sectors or stations to be used by the station traders i came up with this library which may be used commonly.

Common library for scripters to manage forbidden sectors and stations on player request

The script package contains additional user commands to forbid or allow sectors or stations to be flown to.
The library file is for scripters which want to use the player info about which sectors/stations may be accessed and which not.

Th library itself will not change anything, it depends on other script packages to use it. The game internal flight logic is not being modified. Players installing this library without any script package which uses this library will NOT take advantage of the new commands.

Download: library for managing forbidden areas

Usage (Players):

The script package will add 4 new commands, 2 in the additional ship commands and 2 in the general section of the playership.

Additional ship commmand: Allow/Forbid sector
This command will ask you to choose a sector, and block it, if it was not blocked before.
It will allow it if the sector itself or only one/more of the stations were blocked before.

Additional ship commmand: Allow/Forbid station
This command will ask you to choose a station, and block it, if it was not blocked before.
It will allow it if it was previously blocked before.

General command: Allow/Forbid sector
This command will ask you to choose a sector, and block it, if it was not blocked before.
It will allow it if the sector itself or only one/more of the stations were blocked before.
It will propagate the setting to all player owned ships. The setting depends on the effect of the command on the current playership,
so if the player ship was allowed to enter the sector before and it is now forbidden, all ships will be forbidden to enter,
regardless of their previous setting. The setting is basically overwritten on all ships.

General command: Allow/Forbid station
This command will ask you to choose a sector, and block it, if it was not blocked before.
It will allow it if the sector itself or only one/more of the stations were blocked before.
It will propagate the setting to all player owned ships. The setting depends on the effect of the command on the current playership,
so if the player ship was allowed to enter the sector before and it is now forbidden, all ships will be forbidden to enter,
regardless of their previous setting.

Usage (scripters):

The script file lib.manageForbiddenAreas contains the code to manage the forbidden areas. The parameter signature is:

Arg 1: VAR/Sector forbiddenSector, mandatory, not null
Arg 2: VAR/Station forbiddenStation
Arg 3: VAR/Number mode, possible values 0-4
mode 0: set the object (sector or station) to forbidden if it is currently allowed, set the object to allowed if it is currently forbidden. (negates current setting)
mode 1: query status of object (sector or station), see return codes
mode 2: overwrite current status on [THIS] for obejct (sector or station) to forbidden
mode 3: overwrite current status on [THIS] for obejct (sector or station) to allowed
mode 4: return current array of forbidden objects consisting of pairs of ( VAR/Sector, {ARRAY of VAR/Station}) per entry

Return value:
TRUE, if the object is blocked after the requested action
FALSE, if the object is allowed after the requested action
ARRAY, only in mode 4

Installation:
Install the package file with cycrows x3 script installer, download in this thread http://forum.egosoft.com/viewtopic.php?t=121351

Deinstallation:
Remove the package file with cycrows x3 script installer, download in this thread http://forum.egosoft.com/viewtopic.php?t=121351

Script attributes:

T File 8110 - Common library, forbid or allow sectors/stations
<t id="1221">COMMAND_TYPE_SHIP_21</t>
<t id="1222">COMMAND_TYPE_SHIP_22</t>
<t id="860">COMMAND_TYPE_GENERAL_60</t>
<t id="861">COMMAND_TYPE_GENERAL_61</t>

Page ID 8110
Commandcode 1221,1222,860 and 861
Last edited by Naffarin on Sun, 29. Jan 06, 15:27, edited 1 time in total.

User avatar
Burianek
Posts: 2981
Joined: Mon, 29. Dec 03, 03:29
x3tc

Post by Burianek » Sun, 22. Jan 06, 19:58

I'm assuming that this forbids the sectors as destinations, but it's still perfectly possible to cross forbidden sectors?
"Nature's first green is gold" . . . stay golden.

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Sun, 22. Jan 06, 20:01

No, it only holds the forbidden status for a sector...it has no pathfinding algorithm included, it is a mere lookup table.

User avatar
Stevio
Posts: 2271
Joined: Sat, 4. Jun 05, 10:36
x3tc

Post by Stevio » Sun, 22. Jan 06, 20:03

this is a great idea i hate it when my UT's and station traders go into a sector where there is known xenon or pirate activity.

(and using Cycrows Installer aswell, it just keeps getting better)
(i wish more scripters would start using Cycrows script installer)

cheers

stevio

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Sun, 22. Jan 06, 20:05

but you should be aware that this library only has an effect if another scrit actually makes use of it :)

So, the mk3 traders will still continue to walk into dangerous areas because they don't use this library.

User avatar
Stevio
Posts: 2271
Joined: Sat, 4. Jun 05, 10:36
x3tc

Post by Stevio » Sun, 22. Jan 06, 20:09

is there away to make Mk3 use this library?

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Sun, 22. Jan 06, 20:16

Yes and no...since the mk3 is jsut a script it could be programmed to use it, but the mk3 uses a lot of basic scripts which are part of the default engine for the move to station and jump to station parts. So it could be rewritten to avoid selecting destinations, but it could not be prevented all the time that a trader wanders through a sector e.g. when he failed to jump to a sector and uses normal drives.

954flyer
Posts: 329
Joined: Wed, 9. Nov 05, 20:24
x3

Post by 954flyer » Sun, 22. Jan 06, 20:39

Nice work yet again, Naffarin. One question..how will this script work with the sattelite limited Mk 3 trader script by Zzyn?

Found here:
http://forum.egosoft.com/viewtopic.php?t=111488

Im using your station trader script for my stations and complexes(currently using ver 1.20 I believe) and Im also using Zzyn's script for my UT's.

If I set a global command to make a sector off limits, how will that affect the ships(UTs) running the sattelite limited script?

EDIT: Hmm, thinking further on it, I think the UT's wouldnt receive the command to make a sector off limits since they are not running a script with the library included. They should continue to base their moves only on the presence of a sattelite.. Am I right?

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Sun, 22. Jan 06, 20:44

Not at all :)


as i said, this is just a library script, it doesn't change anything. If you don't have other scripts that have been programmed to use this library it doesn't make sense to install it.

So currently only station trader 1.24 are supporting it. No other script will change its behaviour.

954flyer
Posts: 329
Joined: Wed, 9. Nov 05, 20:24
x3

Post by 954flyer » Mon, 23. Jan 06, 05:32

Thanks. I was considering installing the 1.24 version of the station trader so that's why I asked. :thumb_up:

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Sun, 29. Jan 06, 15:27

Update for 1.0 final, using the single ship command will now also generate a report about blocked sectors/stations.

User avatar
Mobuj
Posts: 293
Joined: Wed, 23. Nov 05, 00:30
x3tc

Post by Mobuj » Sun, 12. Feb 06, 14:43

I installed the forboten sectors script with station trader script. Problem is than in the ship I am flying, there are no options under General commands except for the cheats. I have LV's X3 Cheats installed. It has a bunch of commands in Genereal commands (I only use it to start up a new game since I already did a lot of work in my first game, the DDRS additional ships mod was just too tempting). So, is it possible the x3 cheat and forbidden sectors have a conflict? :?

Or, is it just me again? I did read the instructions this time. :oops:
---------------------------
I am Popeye of Borg
You will be askimilated!

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Sun, 12. Feb 06, 15:47

Yes, both scripts conflict in the commands section...i only check the reservations for command slots in the regular scripts sticky and not in the cheat sticky, so i created a conflict with LVs scripts...there currently is no updated script package to resolve the conflict as cheat scripts and regular scripts

Try these two files to resolve the conflict:

This goes into the t directory:

http://home.arcor.de/Naffarin/448110.xml

This goes into the scripts directory:
http://home.arcor.de/Naffarin/setup.plu ... dAreas.xml

Use save as on both links to save them directly.

User avatar
Mobuj
Posts: 293
Joined: Wed, 23. Nov 05, 00:30
x3tc

Post by Mobuj » Sun, 12. Feb 06, 16:32

I added the changed files as directed, really. :wink:

The 2 new commands are added at the top of General Commands. When I select either one I get “Command Rejected” (from the nice lady). There is no pop up of which sector to select or anything else.

Perhaps something else is going on.

Below is a list of the scripts I am currently using: :roll:

Scripts:
StationTrader-V1.24-21.01.2006.spk
XaiCorp-FSUP-X3.2.7.zip
XaiCorp-lib-Setup-X3.310.zip
XaiCorp-MTC-X3.1.7.zip
XaiCorp-RFJ-X3.1.0.zip
XaiCorp-RTD-X3.2.3.zip
Cargo_Delivery_Service_V1.03.spk
dockts.zip
ftu1.1.spk
JumpToMeCommand-V1.10-30.01.2006.spk
mtsproductfinder.zip
RemoveHomebaseCommand-V1.01-30.01.2006.spk
Station_Complex_Relocator_V2.00.spk
Advanced Mineral Scanner
Manageforbiddensectors-V1.0-29.01.2006
AStar_Sector_Pathfinder_Commandsv1.2.renameToZip[1].zip
Flythroughgatecommand1.1.zip
SystemOverrideSoftwareMK2-V1.02-13.01.2006.spk
x3_cheats.zip (LV)

Mods:
DDRS_ShipStation_Mod_V1.0 :D
DDRS.Fixv2-09.zip


BTW, thanks for the quick response. I appreciate all the work you and the other scripters do. Evidence, look at all of dem dar scripts I be using. X3 would not be half the great game it is if not for all the fab help. :)
---------------------------
I am Popeye of Borg
You will be askimilated!

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Sun, 12. Feb 06, 18:16

Works fine here...are you executing it while undocked near a station ? All commands will fail then.

User avatar
Mobuj
Posts: 293
Joined: Wed, 23. Nov 05, 00:30
x3tc

Post by Mobuj » Sun, 12. Feb 06, 21:08

Working fine now. 8)

BTW, when I add more trade ships, will they automagically ignore the forbidden sectors already set?

Automagically: to be able to make something occur where the method can be explained but not caring to know how it works because your happy that it does.
---------------------------
I am Popeye of Borg
You will be askimilated!

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Sun, 12. Feb 06, 22:44

No, new ships don't have any information about forbidden areas as this information is stored locally on the ship. You have to redefine the forbidden areas to become effective for new ships.
*although i think i should change that in the future :) )

fortysix2nz
Posts: 84
Joined: Wed, 3. Dec 03, 09:48
x3

Post by fortysix2nz » Mon, 13. Feb 06, 00:18

Maybe ou could have it so sectors set to ignore from the players ship go into a global variable that all ships check, as well as having local information so you can customise ships. Or a apply to all command. I'll be downloading this when I get home.

I've used your Station Trader script since about day 1, and its been excellent. Does Station Trader include pathfinding, therefor completely avoiding ignored sectors?

Post Reply

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