[Script] CisorTech Dynamic Bay Configuration - Update V2.0 soon

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

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

Post Reply
Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

[Script] CisorTech Dynamic Bay Configuration - Update V2.0 soon

Post by Cisor » Wed, 4. Jan 06, 19:18

CisorTech(TM) - Dynamic Bay Configuration (DBC).

Version 2.0 is X3 2.0* compatible only.
Version 1.2 is X3 1.0 - 2.02 compatible (but no M7 docking).


NEW: v2.0 with M7 docking and scrambling.... Coming any day now...

Find V2.0 at...


Find V1.2 at... CisorTech Dynamic Bay Configuration V1.2


The Dynamic Bay Configuration upgrade reprograms your TL and M1 robotic systems, dynamically reshaping docking bays to accommodate the ship requesting a docking berth. Since dock space is finite, this upgrade docks larger ships by using multiple unallocated bays.

Note: Both DBC and a Transporter device is required on the TL/M1 to transport the ship onboard.

Although DBC is similar to LV's Dock/Undock at TL/M1, and in fact all credit to LV for getting me started, I go a lot further in both the scope and complexity of the concept.


Simply put, DBC enables you to dock TS/TP and M6/M7 ships at your TL or M1, but it does this and also the following:


1) DBC allocates and manages additional docking bays for each TS/TP/M6/M7, (to placate the logic of finite space) :)

- TP = TP + 1 bays
- TS = TS + 2 bays
- M6 = M6 + 4 bays
- M7 = M7 + 6 bays (V2.0 only)

This functionality is inbuilt and will show as 'Bay Allocated' in your landed ships display, thereby accurately reflecting how many bays there are available.


2) DBC adds a scramble command to launch docked M6/M7's to protect the carrier or to attack enemies. Scrambling is implemented in two ways:

a) As an item in the Additonal Ship Commands. Select the Scramble command and enter null or 1 to Protect, and anything else to Attack Enemies.

b) As hotkeys linked to scramble commands. I use 7 for Scramble to Protect, and 8 for Scramble to Attack Enemies. The hotkeys only work if the TL or M1 is the PLAYERSHIP. (Remember to assign hotkeys in Controls/Interface Menu).


3) DBC integrates seamlessly with the ship's Navigation, Combat and Special systems. Simply instruct your ships as you currently do, and they will dock/undock as if Egosoft intended them to.

Caveat:

Since there is currently no way to move the player to another ship via script, I don't let you dock when you are in the TS/TP/M6/M7 which is trying to dock at the TL/M1. You'll have to use a Transporter Device to get yourself onboard the TL/M1, and then instruct the ship to dock.
When changing ships from the TL/M1 to your TS/TP/M6/M7, however, there is a workaround. You appear to go into a void, but since you have already changed ship you can easily complete the undocking by using any of the usual navigation commands.
Example: use X to change ship, and then FlyToSector to complete the undocking process.


4) A new ware, Dynamic Bay Configuration (DBC) is added which exposes the above DBC functionality. It's a steal at 9 million credits and can be found at Argon Equipment docks.


5) A fully switchable override setup mechanism.

a) Since DBC overrides most of the ship's interface commands, you can toggle the various command overrides on/off individually, or all of them at once. This should allow you to run whatever other mod/script you like even if it conflicts by overriding command 'whatever'. Simply toggle that command to off in 'setup.cisor.dbc' and you'll be good to go. All the other commands will still function normally, and as you know, in X3 there's more than one way to undock a ship.
b) Setting all overrides to off will give you a dock/undock TS/TP/M6 option in the Navigation menu (similar to LV's implementation). The management and allocation of additional docking bays will still work as explained in point 1) above.


6) Comprehensive error handling is built into DBC. The error/warning messages are verbose, but you can toggle this behaviour in plugin.cisor.dbc.errorhandler. Simply change the 'verbose' value to true. Warnings are designed to be unobtrusive, and to mimic existing X3 warnings as much as possible.


7) This is a purely script based implementation so it should work with custom universes and plot games.


Installation.


V2.0 : Use Cycrows package manager to install/uninstall.

V1.2 : Extract the rar file to you X3 - Reunion folder.


Version 2.0 link pending...

Old version v1.2
CisorTech Dynamic Bay Configuration V1.2


Changelog:

V2.0

- Included M7's
- Change package format to Cycrow installer .spk
- Built in allocated bays safety check

Version 1.2: Released 25/01/2006

Version 1.1: Released 14/01/2006

- Included Scramble To Protect and Scramble to Attack Enemies commands in Additional Ship Commands and as hotkeys
- Use sTransporter mechanism to also dock/undock Fighters
- Shows normal ship command messages - not DBC Dock/Undock
- Incorporated Jump To Ship in Jump To Station command
- DBC now for sale in Argon Equipment Docks
- All the menu based Jump Commands now allow you to give a null return to the 'followers' question. (This defaults to True)

Version 1.0: Released 04/01/2006

Credits:

CisorTech (TM).
LV for Dock/Undock TS/TP at M1.
Many X2/X3 scriptors from whom I learnt.

Language: 44 (other language contributions welcomed)
PageID: 8920
WareID: 5893/5894
Commands: 255 A_CISOR_DBC & 1237 A_CISOR_SCRAMBLE

Conflicts. Awaiting a ware number change approval to remove conflict with 1243.
Last edited by Cisor on Wed, 20. Dec 06, 16:13, edited 19 times in total.

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Wed, 4. Jan 06, 19:24

as a bit off 'done this in X2' advise ..

when you spawn a neutral sat. as ship (not the ware) in the carrier ..

it wont show up ..
so you can mimick(?) it so that 1 TS takes 2 bays (or more) ..

however dont forget that players can mess things up so make sure they do get removed when needed else you'll end up with a carrier that has 0 free docking slots and also no docked ships .. (it wont show the sats. in the 'landed ships' screen)

Edit;
didnt see the link .. anyway .. nice script ;)


G

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Wed, 4. Jan 06, 19:33

Thanx, Red Spot. I got around this by adding an Unknown Enemy ship with race Unknown to the ship. The player cannot touch it, so the only way to get it out is to undock via my commands.

But thanx for the advise anyhow. I'd like to know what you think of the implementation. (A behind the scenes kinda look).

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Wed, 4. Jan 06, 19:37

well to give you some 'I took a look at the scripts' feedback ..

I think its very nicelly done ..

however I get the feeling it could be easier than how you did it ..

like for instance having a script run on a task on the carrier that has 'bigger' ships docked ..
have this check for those ships and if there are chages update the amount of 'dummy ships' ..
than you dont have to run 'special scripts' on these ships for about every command ..
(wich in the end might go wrong when people undock ships with other 'custom commands' or when an other scripter also does the same)



G

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Wed, 4. Jan 06, 19:49

Red Spot: Yes, I considered that, but since I have to Transport the ship off anyway - to actually get it off since it won't just undock - I have to catch all the various means of undocking.

And the continuously running script is something I abhor as a programmer. If you ask me that is the NO. 2 cause of hanging games and crashing X2/X3's.
The No. 1 reason being bad code, of course :)

But.... you make perfect sense in that another scipt could bypass my various undocking routines and then I'd be stuck with a ship full of allocators so....

I cave.

I'll write a routine to check every x seconds that the load still makes senses. RATS.

Thanx so much for the thoughts.

Edit: That's also of course the problem with running this perfectly for a week on my system. I'm in control so don't do the unthinkables.

But since that's what this phase is for.... please folks, give it all you got so I can make this near unbreakable as possible..

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Wed, 4. Jan 06, 20:02

BTW: How do I get my link to be a clickable url? I've got the Url brackets and all as you can see, but no clickability....

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Wed, 4. Jan 06, 20:16

you could do it like this ..


-make a command to dock ship at carrier (TS/TP(/M6) only)
have it check the ships environment and sector ..
if the sector is not the environment
get the environments position ..
put ship in sector near environment
return null
else

have the script do its checks ..(needed bays etc...)
if it all adds up have the ship get in close (up to now just how you did it)

now look for a certain 'local variable' on the carrier
if it doesnt exist
find a free task on the carrier ..
make an array holding
-the task number
-the ship to dock

start the free task on the carrier and pass the made array to it ..
(ill get back to this task later)

now when an other ship docks
find local variable
it now exists ..
get first array entry (the used task number)
add ship to array ..
restart the task with the new array ..


-The Task
have the task be a loop
set a var to 0 (call it 'dummy.ship.count')
make it run thru the passed array from the 2th entry ..
up the 'dummy.ship.count' when the ship is docked
and clean the ship from the array if it doesnt
now after running thru the array you have 'dummy.ship.count' representing the number off 'dummy ships' that should take bays ..
check the number off docked 'dummy ships' to see if it adds up ..
create or destroy if needed ..
than check the new amount of 'dummy ships'
if its 0 .. set the local var set in the 'dock/undock'script to null and quit the script ..

Edit;
and have a wait off about 5 seconds at the end ..
should be long enough to not be to demanding and short enough to not become annoying ..



G


bendyspex
Posts: 837
Joined: Tue, 13. Apr 04, 10:39
x3

Post by bendyspex » Wed, 4. Jan 06, 20:20

Your brackets are the wrong way around, that is why it is unclickable. By the way, this sounds good. Would it be possible to release a version were it is simply a ware available at equipment docks, that does the special docking for all ships. I would rather not have to go through missions to get it. Maybe thats just because I'm lazy :roll: .

bendyspex
Posts: 837
Joined: Tue, 13. Apr 04, 10:39
x3

Post by bendyspex » Wed, 4. Jan 06, 20:21

Your brackets are the wrong way around, that is why it is unclickable. By the way, this sounds good. Would it be possible to release a version were it is simply a ware available at equipment docks, that does the special docking for all ships. I would rather not have to go through missions to get it. Maybe thats just because I'm lazy :roll: .

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Wed, 4. Jan 06, 20:50

@bendyspex: I'll consider putting it in a equipement dock or 2, but till then, I give you one when you start, so play with that. And the BBS stuff will be fun. I'm a part time writer/novellist, so I've got a mystery with clues and all for you to solve. (When I get around to implementing it).

I don't see where my brackets are the wrong way around. I used the Url button and everything. Colour me confused....

@Red Spot:

1) How did you do the url? Can you give me something I can cut & paste to get it right? (I checked the source of the page but of course that got a <a href on it).

2) Thanx, Red Spot, that pseudo code seems perfectly straight forward, and I'll implement virtually that to check no other scripts knocks my system off track. Thanx.


But..... I kinda wanted to integrate this with the existing commands. The one irritation I had with LV's method, and my early versions while developing this, is that everything becomes a two-step process i.e. undock and then FlyToSector, or undock and then Attack, or undock and then Dock, etc. I found myself forgetting that it was a 'special' ship that'd docked and had to be 'specially' undocked. Many times I thought.... what the heck happened to that ship? I sent it to get energy sells... where is it? Only to find it still sitting in the M1. Unable to undock.
That's why I went for the integration approach. No thinking in the midst of battle, no why the heck hasn't it happened. All automagic.
But of course there is the down side... apart from having to code so many similar scripts... Someone can break the system with another override of one of those commands...
Which is why your idea is so good. Let them. I'll catch it using your code. :)
Your thoughts are much appreciated (as is your code) :), and I would like to know whether you can think of another way around the two-step process.

Now if I can just get the link working.... (Why on earth doesn't the url button brackets work?)

Edit: Ok, got it figured. Just needed the http part. Who woulda thought?

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Wed, 4. Jan 06, 21:10

link ..
just add "http://" (no url tags)


script ..

you can still hook the commands up to the default commands ..
just dont put the creation/removal of 'dummy ships' in there ..
let it be done by a seperate script that always will get launched when using a 'dock at' command for these ships ..

than it might become a bit messed up if an other scripter does the same with the default commands .. but it wont 'break' your script..
cause 'dummy ships' will get added and removed ..

(something I didnt mention earlier .. but in that 'Task' update the 'local var' as well when things change ..set it to 'null' if the task is going to end)


G

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Wed, 4. Jan 06, 21:19

Red Spot: Cheers. I owe you a beverage of your choice. (Seems to me there should be a way to do that internationally, you know, pay for a drink at a pub in another country - open a onetime chit as it were. And here we are thinking we're civilised....)

LOL. I'm sure that setting to null must have given you a few headaches before... :)

I'll do as you suggest tomorrow and post an update thereafter. Bulletproofing is always a very good idea.
:D

bendyspex
Posts: 837
Joined: Tue, 13. Apr 04, 10:39
x3

Post by bendyspex » Wed, 4. Jan 06, 21:24

Sorry, my advice was wrong, I just thought that you had got the first and second brackets the wrong way around.
That's OK if you get one at the start, and a good story sounds like a good idea. I just didn't want to have to go through lost of missions like, go to this ship, kill this ship, go back to this ship, go to this sector. If it has lots of good parts in then I will enjoy it. Will the story be long enough to count as another plot, or will it just be 2 or 3 missions. Either way, it still sounds good.

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Wed, 4. Jan 06, 21:38

bendyspex: It's a full on detective story, partially based on a scifi short story I wrote in the 1980's for a pulp magazine (showing my age here). Since I retain ownership and I doubt it got much beyond the borders of South Africa, I thought it'd fit quite well into the X-verse.
You read the linear BBS messages, mull over the content/clues and then go about your business. The story should come to you when you're in two/three sectors of the next plot event.
There's no go there and kill this. Not until the end, and by then you should want to.

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Wed, 4. Jan 06, 22:13

Cisor wrote:Red Spot: Cheers. I owe you a beverage of your choice. (Seems to me there should be a way to do that internationally, you know, pay for a drink at a pub in another country - open a onetime chit as it were. And here we are thinking we're civilised....)

LOL. I'm sure that setting to null must have given you a few headaches before... :)

I'll do as you suggest tomorrow and post an update thereafter. Bulletproofing is always a very good idea.
:D

I know a good liquer(?) store closeby .. :roll: :D



G

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Wed, 4. Jan 06, 22:29

Red Spot: From the look of that 'liquor' I'd guess you've been down that road already :D
Or maybe that's just the glass of red I'm nursing talking...

DarthVain
Posts: 845
Joined: Mon, 2. Jun 03, 11:53
x3tc

Post by DarthVain » Thu, 5. Jan 06, 00:05

Excellent!! :thumb_up: Looking forward to using this one.
Another one bites the dust!!

DarthVain

User avatar
Rakeris
Posts: 407
Joined: Wed, 31. Dec 03, 04:25
x4

Post by Rakeris » Thu, 5. Jan 06, 00:42

Looks great, I'll give it a run down and see if I can find any problems. Probably later tonight or tomorrow as I'm having a few problems of my own, my game has decided it's going to freeze 1 and 1/2 minutes after I load my save, need to find out why.

Also, with the story (sounds great btw, always liked a good plot to go with scripts/mods etc.) will you be able to buy them after you get done with the BBS plot?

RRRoamer
Posts: 332
Joined: Sat, 21. Feb 04, 02:27
x4

Post by RRRoamer » Thu, 5. Jan 06, 00:46

Cisor wrote:Red Spot: Cheers. I owe you a beverage of your choice. (Seems to me there should be a way to do that internationally, you know, pay for a drink at a pub in another country - open a onetime chit as it were. And here we are thinking we're civilised....) :D
I think I'll patent this idea! Or maybe you should beat me too it! With everyone getting connected online like we are these days, I could REALLY see this getting used. Maybe a 10 cent per transaction IP fee and a 50 cent (or so) fee for the sending and receiving bar (each), so that drink would end up costing $1.10 more than "normal". It would probably work too.... ;)

Oh, and I love the script idea as well!
--RRRoamer

Post Reply

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