[Script] Station Capture Through TL Boarding [UPDATE V1.1]

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
User avatar
RoverTX
Posts: 1426
Joined: Wed, 16. Nov 11, 18:37
x4

[Script] Station Capture Through TL Boarding [UPDATE V1.1]

Post by RoverTX » Mon, 14. Jan 13, 06:49

STCAP:

Version 1.1 Update: Please Read Update Details at bottom of the post.

There have been plenty of scripts in the past that seek to make Stations capture-able. These scripts fall into issues because NPC stations aren't always even the same type as player stations, and they are set up totally differently when it comes to wares and game mechanics. So moving a NPC stations to player control can be tricky.

This scripts has the same ends but it seeks to allow player to gain control of enemy factions stations by adding a chance that Stations will appear in TLs after they are boarded.

It works by going through every shipyard in the Galaxy and finding all the docks and stations for sale for each race. Then using that info to add a station when a TL is captured from the TLs maker's race.

This makes this mod work with most other mods by only adding stations which are for sale. Which means no weird stations in TLs hulls and any new mod addition stations should show up.

Download

Future Plans:

Adding the ability to change the weight of Food and Bio Stations in a T file. By weight I mean change how likely they are to show up, the more weighted being the more likely they are to show up.

Figure out a way to weight all different types of stations, ie Laser Forges, Shield Plants, Missile Forges, Tech Stations, etc etc.

General overview and re-balance depending on people say there are too many or two few stations appearing for pirating.


Post:

If you run into any issues don't be afraid to post. I tested the script, but I am always afraid that I left something out of the SPK or used the wrong version of a script so don't be afraid to point out a bug.

History:

V1
- Launch


V1.1
- TLs are now put into TLs cargo after capture instead of over time.

- No longer weights food or adds in IBL or PBG forges to avoid issues with mods that really modify Tstations.

-The ALplugin now runs every 5 minutes, but only queries for stations every 12 runs (every hour). This means your going to need to reint script cache, and possible turn the plugin on and off just in case to get the new version to start up. It will take upwards of an hour and a half for the new version to kick in. If it doesn't post a bug report and I will go over my code again.

-Added in the T file. Just plain forgot about it like a moron...Its just the description but I figure that's important lawl...
Last edited by RoverTX on Fri, 18. Jan 13, 09:00, edited 4 times in total.

SyberSmoke
Posts: 650
Joined: Sat, 11. Feb 12, 04:03
x4

Post by SyberSmoke » Mon, 14. Jan 13, 11:01

So...you have to capture a TL instead of just capturing the station it's self like in the mod below? Huh...
http://forum.egosoft.com/viewtopic.php?t=250936

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Mon, 14. Jan 13, 11:07

I like the idea. :)
SyberSmoke wrote:So...you have to capture a TL instead of just capturing the station it's self like in the mod below? Huh...
Capturing the TL with the station aboard has the big advantage that you can build the station wherever you want afterwards. Whereby capturing the station directly where it stands might mean that you're stuck in enemy territory then.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Vayde
Posts: 849
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Mon, 14. Jan 13, 13:07

Does this script run at regular intervals or just once when activated?

I'll give it some serious testing over the next few days.
Still life in the old dog yet...

User avatar
RoverTX
Posts: 1426
Joined: Wed, 16. Nov 11, 18:37
x4

Post by RoverTX » Tue, 15. Jan 13, 21:24

It should run every hour and half. I tested it by forcing the event, but some natural real world testing would be nice. It works via AL plugin. Sorry for the delay in response had some work I had to deal with.

User avatar
RoverTX
Posts: 1426
Joined: Wed, 16. Nov 11, 18:37
x4

Post by RoverTX » Tue, 15. Jan 13, 21:24

SyberSmoke wrote:So...you have to capture a TL instead of just capturing the station it's self like in the mod below? Huh...
http://forum.egosoft.com/viewtopic.php?t=250936
Yes thats correct.

User avatar
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden » Tue, 15. Jan 13, 22:18

Capturing the TL with the station aboard has the big advantage that you can build the station wherever you want afterwards. Whereby capturing the station directly where it stands might mean that you're stuck in enemy territory then.
Raiding a station and stealing the goods would be cool (why overtake it if you can just take the goods?). Bring a ship with Marines close to the target, execute script and let them "raid" it.
With risks involved of course, Marines could die, mission could fail completely, police could show up, etc.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image

Vayde
Posts: 849
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Wed, 16. Jan 13, 15:02

Hi RoverTX,

I've been putting your script through it's paces and I have to say it does exactly what it says it will do :)

Using cycrows cheat pack I've just completed a check on the TL's in my universe on a new game start. I equipped myself with a squad of top notch marines and set about boarding them.

After 18 missions I had 13 new stations, 5 were lost as destroyed equipment. Best result was a Paranid eq dock from a Hercules in Paranid Prime.

As this script puts only buyable stations on to TL's, if another script or mod adds say the PHQ or other rare stations, would the scripts add those also?
Still life in the old dog yet...

User avatar
RoverTX
Posts: 1426
Joined: Wed, 16. Nov 11, 18:37
x4

Post by RoverTX » Wed, 16. Jan 13, 17:52

Yes it would. It also adds pirate IBL and PBG forges no matter what to yaki TLs.

Thrandisher
Posts: 357
Joined: Sun, 1. Jul 07, 03:33
x4

Post by Thrandisher » Thu, 17. Jan 13, 12:39

Think ive ran into a bug with this script right now. Right now im doing a XTC 2.0 universe. I had a hired TL before i on this script and had him flying to a sector wo wait for me. Well i forgot about him untill a little bit ago. I jumped into that sector and hailed him to drop my Advance Sat factory and i had the option of droping 3 stations. 1 was the sat factory, other was a water one which i dont remember buying, but i could have bought it but just didnt remember it, and i had a ***UNDEFINED*** cargo to drop.

Im assuming the unknown was probably added as one of the factory's from this script, but what it mainly leads me to wonder is. How will effect TL's who can be hired? Ive checked a few other TL's to hire and so far each one already had cargo and was to buzy to let me hire them. Ive never seen that message before.

Also it makes me curious to wonder if you hired a TL, told it to dock and put in a small station in it and had it go dock somewhere, if you were to wait for the TL to get a new station and then have it drop said station, while it still had the one i bought, then had it wait some more, if it would generate another factory that you could drop and own, then wait more and repeat.

Great idea for a script tho, exspecialy for the person who likes to play as a pirate like i useally end up doing.

Ill do some more testing with it over the next few day's when i have time.



EDIT: Its undefined, not unknown. And since i posted this i moved the hired TL in question to another sector to drop off my water plant and a second undefined factory apeared in his cargo haul. I took a chance and placed it and its product it was making was wheat.
The mongrels will never get over THIS wall.

User avatar
RoverTX
Posts: 1426
Joined: Wed, 16. Nov 11, 18:37
x4

Post by RoverTX » Thu, 17. Jan 13, 19:57

XTC must mess with the basic food facts or the IBL or PBG forge entries... I might have to make a second version for XTC then or any other major mod that messes with the basic factories.

As for stopping them from showing up in hired TLs thats an interesting issue... Going to have to take some thought to figure it out. I forgot you could even do that because I always end up buying a TL right off the bat as a mobile base... I guess I am going to have to exclude the TLs running the hireable job, which shouldn't be that hard, I just wish there was a better way to do that, but I doubt I can have the script figure out when the TL was or was not hired...

Edit: OH I got it, if the hired TL thing isn't hard code I could just modify that to remove all TLs once it is hired! Will look into doing this when I get back home tonight.

Edit2: Looks like I might have to go back to the drawing board. I think the TL hiring is hard coded. So I think I am going to have to add a signal to all TLs ships that check to see if they have been captured by the player, and if so select a random Station and try to add it. The logic will bacicly be the same but the stations arrays will get saved to globals, and the signal will be set instead of adding the station.

Edit3: Ok I really can't find anywhere to modify the hiring of TLs.

I made a post in the general S&M question thread, and if no one can provide some insight by monday(I am busy till then) I will just redo it so the stations are added via signals that trigger when the TL is captured.

You won't know what statins you might end up with before the boarding, but I think thats really the only solution if the hiring is hard coded.

Edit4: I got bored version 1.1 is out should fix the issues seen and make things more stream line. There are a few things with the update so please read over.

Vayde
Posts: 849
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Fri, 18. Jan 13, 22:28

Looking through the MSCI Handbook I found this in General Object commands

Code: Select all

x <RetVar> = <RefObj> is hired
Any use to you?
Still life in the old dog yet...

User avatar
RoverTX
Posts: 1426
Joined: Wed, 16. Nov 11, 18:37
x4

Post by RoverTX » Fri, 18. Jan 13, 23:08

Will test that to see if I could create a signal with it. How did I miss that...

Edit: That would work. Would run a named script on all TLs that would pop up about every second. If it finds they have been hired it will delete all ST sized cargo from its cargo bay. It will then start looking for when the ship is no longer hired and then put the switch back for looking for it to be hired again.

I am going to have to think this one over. The above solutions works, and you would be able to see the stations in the cargo bay, but thats a lot more stuff going on then just a simple CAPTURED_SIGNAL. It boil down to.

Can't see them in cargo bay and a capture signal, and running through the TLs more, but not the shipyards.

OR

Can see them in cargo bay, but using a custom "signal" that might end up being a lot uglier then the built in captured_signal (which I guess is a lot more efficient then any custom one could be) but run through the TLs 12 times less.

I am actually leaning towards the current 1.1 version set up manly because now if people get a fact they dont' like they can just reload to before the ship gets capped, instead of having to go search for another TL which may or may not have the fact they want. Which while the current version is a lot less realistic, its also 10 times less frustrating.

shaw0526
Posts: 26
Joined: Thu, 22. Jul 10, 07:19
x3tc

Post by shaw0526 » Sat, 19. Jan 13, 08:22

Right on, just downloaded and installed. Appreciate the script!
"Courage is the art of being the only one who knows you're scared to death." - Not me

Vayde
Posts: 849
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Sat, 19. Jan 13, 14:12

Do the scripts check to see if the receiving TL is a Casino or Hospital ship?
Still life in the old dog yet...

User avatar
RoverTX
Posts: 1426
Joined: Wed, 16. Nov 11, 18:37
x4

Post by RoverTX » Sat, 19. Jan 13, 17:54

No it doesn't.

All TLs are viable targets. I thought about limiting it to just Supply TLs and Lifters, but then I realized cruise ships carry cargo too. I would though like to remove Hospital ships from the list of possible targets. Just because I feel like the devil for encouraging people to boarding one, but haven't gotten around to it yet. Would have to do some name checks via strings matching.

The other issue is with Mods. Because other mods might change the job or name of supply TLs and lifters I can't really use a whitelist, otherwise I might make it so the script doesn't work at all with certain mods. If I use a blacklist then it might keep growing to accommodate all the mods.

That does remind me though to do a check to not run on invincible ships, other wise this mod might cause trouble with the
Spoiler
Show
TC PHQ mission.
Last edited by RoverTX on Sat, 19. Jan 13, 23:31, edited 1 time in total.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sat, 19. Jan 13, 18:28

The main issue with putting stations on Supply TL's is that the player cannot hire the TL if it already has a station on board. I got a funny reply from a Split TL Captain when I tried to hire him: I already have cargo that is more important than yours!. :)

In vanilla, simply checking the name for "Supply TL" would probably suffice to avoid them.

Re: Hospitals... you could let the player decide his own karma. ;)

User avatar
RoverTX
Posts: 1426
Joined: Wed, 16. Nov 11, 18:37
x4

Post by RoverTX » Sat, 19. Jan 13, 18:30

V1.1 Adds them via a captured signal. So they show up after boarding. Already been 'fixed'. Though looking at other options.

Also some one else reported being able to hire them with stations already in their cargo bay. So I didn't think having the stations in their cargo bay actually lead to them being 'hired'. I have gotten that message before with nothing in their cargo bay except lasers and shields also.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”