[Script] Ship Hijacker v1.1 by Nividium 05/01/09

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

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

Post Reply
Hieronymos
Posts: 830
Joined: Fri, 30. Dec 05, 22:14
x3

Post by Hieronymos » Thu, 7. May 09, 07:01

It beats me why the Devs didn't include TS's at least within the category of boardable ships...I used to love using LV's HAT v1.2 to prey upon Paranid superfreighters in 3R.

SinisterDeath
Posts: 228
Joined: Sun, 26. Apr 09, 04:32
x4

Post by SinisterDeath » Thu, 7. May 09, 07:42

Is it possible to get this script to work with a station?
I ask because on a plot mission, an NPC will not enter my ship, and I believe the only way I can get it to work, is to have him bail from the station...

mikthescot
Posts: 84
Joined: Sun, 11. Jan 09, 13:50
x3tc

Post by mikthescot » Wed, 13. May 09, 15:35

can it be done without the plugin manager
??

GFHuber
Posts: 51
Joined: Fri, 29. Oct 04, 18:15
x3tc

Post by GFHuber » Wed, 20. May 09, 23:31

First.

I bow to you Nividium i love having a second game for Piracy only your mods mean a lot of fun.

Second.

If you think the Mod is to easy or to much like a cheat... don't use it ;)

Third.

@SinisterDeath

Check for Livesupport... an read the Mission description again sometimes they demand an TP instead of a crumpy smely rusty cargohold with an half death Livesupport.

jimhsu77479
Posts: 168
Joined: Sun, 25. Nov 07, 22:39
x4

Post by jimhsu77479 » Thu, 21. May 09, 00:57

Just for reference here's a summary of how I plan to modify this mod:

* Use microchips instead of computer components
* Reduce shield threshold from 500 to 4000 and enable capture of all ship types
* Consume microchips when transferred over
* Have a system where e.g. one microchip is needed for every 5m in ship value (so a fighter would need one and a M2 would need a few dozen)

Deadaim
Posts: 61
Joined: Sun, 12. Jun 05, 05:22
x2

Post by Deadaim » Thu, 21. May 09, 07:03

If someone could tell me how to mod the script to allow for big ship capping that would be cool...or if you have a modified version of the script that would be even better.

User avatar
Nividium
Posts: 800
Joined: Tue, 21. Aug 07, 01:31

Post by Nividium » Thu, 21. May 09, 08:47

Deadaim wrote:If someone could tell me how to mod the script to allow for big ship capping that would be cool...or if you have a modified version of the script that would be even better.
The script isn't really designed for huge ships. Their shield regeneration rate is too fast and large chunks of regen amounts per cycle. You would need to increase the "buffer" amount of shield remaining in order to jack a huge ship. You need to find in the script the part that compares shield values, it is currently set to 500. You need to increase that to maybe 4000 or something for huge ships. Ie; in reality the shields wouldn't need to be 0 but because they regenerate so fast and in big chunks this 4000 or so increase would give you some time for the script to begin processing before the ship has a chance to regenerate to much.

Here are the lines of code and there line numbers to help you find the values to change.

049
050 if $shields > 500
051 goto label error
052 end
053
054 if $shields <= 500

Deadaim
Posts: 61
Joined: Sun, 12. Jun 05, 05:22
x2

Post by Deadaim » Thu, 21. May 09, 10:30

Thanks...sorry for being such a noob about this but how exactly do I edit the script to make the changes?

User avatar
Nividium
Posts: 800
Joined: Tue, 21. Aug 07, 01:31

Post by Nividium » Thu, 21. May 09, 12:37

Deadaim wrote:Thanks...sorry for being such a noob about this but how exactly do I edit the script to make the changes?
You already have the script installed, right. You have also enabled the Script Editor by doing the "Thereshallbewings" bit as well, right. So, now activate the Script Editor [shift][c][s]. Now highlight the script "ship.hijacker.main" and click on it, this will open the script into the Script Editor. Now remove code lines 028-037 (by pressing the [delete] key, to enable hijacking of M1,M2 ships. Now go to line 050 and change the 500 to 4000. Now go to line 054 and change that 500 to 4000. Save the script by clicking the top/right button that looks like this [<<<] a pop up will appear asking if you want to save the script, answer yes.

SinisterDeath
Posts: 228
Joined: Sun, 26. Apr 09, 04:32
x4

Post by SinisterDeath » Sat, 23. May 09, 00:57

GFHuber wrote:
@SinisterDeath

Check for Livesupport... an read the Mission description again sometimes they demand an TP instead of a crumpy smely rusty cargohold with an half death Livesupport.
I got a TP. :(

k8d0s
Posts: 2
Joined: Thu, 28. May 09, 16:07

Post by k8d0s » Thu, 28. May 09, 16:19

I have a problem with this script: I captured a Xenon P without problems. After the capture the P keeps getting an autopilot order to "Fly to Xenon sector 472" (or another Xenon sector, I don't remember exactly). Even if I pilot that ship the autopilot interrupt what I'm doing to go to Xenon sector 472, where it is destroyed (obviously). Are there task or jobs that aren't erased by this script (so they keep coming)? The P I captured isn't in a mission, it spawned in Black Hole Sun (as part of a Xenon attack I think).

User avatar
Nividium
Posts: 800
Joined: Tue, 21. Aug 07, 01:31

Post by Nividium » Thu, 28. May 09, 19:50

Yes, there is a flaw in the script as it stands now. It is missing a "null" script. This null script should be called in order to erase the previous orders the ship has. Did you try issuing a navigation "standby" order to the ship? That might help. Like I say the script has this flaw and I don't think I'll be updating the script package with additional scripts including a "null" or changing the code any time soon. Try issueing dif orders to the ship or sell the ship I guess.

k8d0s
Posts: 2
Joined: Thu, 28. May 09, 16:07

Post by k8d0s » Fri, 29. May 09, 19:46

I tried a "idle" order and a "null" order; I also modified your script to include commands like "exclude from any patrol" etc... but nothing changed.

Oh well, I'll wait for your update (take your time of course)... in the meantime I'll try to capture only "unbound" ships!

Thank you for the assistance.

Meltdown
Posts: 337
Joined: Wed, 6. Nov 02, 20:31

Post by Meltdown » Mon, 1. Jun 09, 06:23

I like the premise of this script a lot. I used BSE in X3R, and while the results were fun, the universe quickly filled up with TONS of abandoned ships, especially after the 'nids got mad and started blasting everything that came in their sectors.

A quick trip through pirate or 'nid sectors with the Starburst equipped with the capping extension would net me a whole new fleet, which was fun for a while, but then it became a tad bit ludicrous to find dozens upon dozens of empty ships all over the place.

With this script I should be able to cap what I want, when I want it, and the rest of the universe should be none the wiser.

I have a question though. I'd like to improve the script by replacing compcomps (hehe, "compcomp" reminds me of Hardwar :) ) with microchips, or possibly a whole new ware if I manage to figure out how to implement it in the game; I'd also like to have the ware in question destroyed after the ship is capped (IMO the process should have SOME cost), and I'd like to increase the shield threshold, since it seems it's giving people trouble. (note: I haven't yet actually tried the script, but I will soon)

My question is: after these mods are done, can I upload the revamped script somewhere and link it in this thread? I will, obviously, not take credit where credit isn't mine. :p
Eat, drink and be merry, for tomorrow you may die.

Meltdown
Posts: 337
Joined: Wed, 6. Nov 02, 20:31

Post by Meltdown » Thu, 4. Jun 09, 07:27

Ok, I've been playing around with it for a while, and I've found the stock version completely useless. This is not meant as an insult, mind you; it's just that ALL captured ships engage their autopilot continuously, and always go to an "idle" order seconds after you've told them to do anything. This makes it impossible to even order them to a shipyard to be sold.

I've conducted further testing with Cycrow's cheat menu, using the "take ownership" command. It appears that (at least in 2.0a) the AI routines are tied to the ship, and changing ownership will not reset everything; giving the ships orders via scripts won't work either. As a result, capping this way becomes pretty much impossible.

I haven't tested if this keeps being the case even if you, or the ship, change sector, but even if it was it'd still be a problem.

I might have an idea for reworking the script into a functional version, with several radical changes. I'll try to do this tomorrow, since now it's late and I'm off to bed. :p
Eat, drink and be merry, for tomorrow you may die.

Meltdown
Posts: 337
Joined: Wed, 6. Nov 02, 20:31

Post by Meltdown » Thu, 4. Jun 09, 19:52

I modded the script with the "force eject" command in place of the race change. It works, but it has the side effect of the target ship behaving just as if it's capped normally, i.e. losing most of its cargo. Some might see this as desirable, because it reduces the "cheat factor" - the cargo and equipment of a ship can easily double or triple its market value.

The modded script needs some more polishing, then it's ready. Nividium, are you interested in having a look at it? I can mail it to you and you can put it up along your original one if it satisfies you.

I have another idea that might work involving ship cloning, but it'll require extensive script rewriting and it might take me a while.

What really beats me, though. is that I had a look at the "bribe a pilot" script, and it handles the property change in the exact same way as the original hijacking script; yet, once the pilot is bribed the ship successfully resets and executes orders without engaging the autopilot every few seconds.

I'm officially stumped.

Edit: huh, weird, I edited the original hijack script by changing the order of actions so as to make it the same as the bribe script, and I added the 1-2 second random waiting time. Now it works as intended.
Eat, drink and be merry, for tomorrow you may die.

M3ds
Posts: 11
Joined: Thu, 4. Jun 09, 20:15

Problems capping the pilots?

Post by M3ds » Thu, 4. Jun 09, 20:19

Has anyone else had problems picking up the pilots after they eject in the advanced suits?
Ive got LifeSupport and enough cargo space.
Also the pilot dusn't move at all, hes just sitting there at 0mps

Anyone any ideas?

Thanx

Meltdown
Posts: 337
Joined: Wed, 6. Nov 02, 20:31

Post by Meltdown » Thu, 4. Jun 09, 21:35

Dunno, haven't picked any up so far. Will give it a try and report.

Edit: indeed, they just bounce off me and aren't picked up. Hmm.

Edit2: solved. The script creates an advanced spacesuit when the ship is capped, which the game treats as a ship, not as a suit. I changed it to create a normal space suit, and that gets picked up as any other pilot.
Eat, drink and be merry, for tomorrow you may die.

M3ds
Posts: 11
Joined: Thu, 4. Jun 09, 20:15

DaYMN

Post by M3ds » Thu, 4. Jun 09, 22:26

Thats was quick. Every credit and much respect to ya!

Where do i get the updated version? Same place i downloaded the first one at the start of the thread?

Thanx agen man ur a god!

Meltdown
Posts: 337
Joined: Wed, 6. Nov 02, 20:31

Post by Meltdown » Thu, 4. Jun 09, 22:53

Ok, here are my corrected versions of the hijacker script. You have to first install Nividium's hijacker, then replace the ship.hijacker.main.xml file in the "scripts" folder of your X3TC installation with the one provided in the zip.


Version 1: hijacking maintained as in the original script (ship changes ownership with all its equipment and cargo), but with additions that reset the ship's AI so you can actually use it.
Other changes:
- The hijacker no longer runs on computer components. It now needs microchips. Being more expensive and harder to find, it makes it much less of a cheat.
- Once transferred, the microchip is lost forever. You will not find it in the cargobay of the captured ship.
- The astronaut that leaves the ship is a spacesuit, not an advanced spacesuit. This makes it possible to capture it.
- The astronaut is no longer created at x+125, y+125, z+125; instead, it's created at x+50, y+50, z+50. It was a bit weird to cap a ship and see an astronaut materialize a good distance away. Note: this could give trouble with M6+ ships - I haven't yet tested that.
- Race of spacesuit is no longer that of the ship's previous owner; it's now "Neutral race". I think this solves an issue I was having with my reputation changing if I shot the astronaut.
- Shield threshold over which the transfer fails raised from 500 to 1200 to make it easier to actually cap ships, instead of forever damaging their hull

I've tested this modified script a while, and it *seems* to work fine. I haven't had capped ships activate their autopilot and screw up any longer, so I'm assuming it's OK.


Version 2: ship hijacking no longer occurs by race change; instead, the pilot is forced to eject. The result is exactly the same as if the ship was captured normally: shields are almost always destroyed, along with most of the cargo, and the ship must be claimed before you can use it.

Shield threshold is 1200 as in version 1; also like version 1, it works on microchips.

Update: the game doesn't allow you to claim M6 ships, but the script allows you to force-eject them. This means that M6s whose crew has ejected will stay dead in space without you being able to claim them (the menu choice doesn't appear at all). I haven't tested this yet, but I assume it should be possible to take control of said ships using the cheat scripts, specifically the "take ownership" one. It wouldn't actually be a cheat, since the ship has already undergone the eject routine, so it'll have shields disabled and all; you're just claiming it with another method.

There's a small bug in version 2: I noticed that the astronaut flying away from the ship does not always appear . I'm pretty sure this depends on the "force eject" script action, and as such there's nothing I can do about it.


Version 1 is now much more balanced than before in my opinion, but it still makes for a very easy life. A M3 with full equipment and cargo will net you a nice sum.
Version 2 is even less of a cheat, it basically just adds a fixed expense in order to insure normal capping.

I'm thinking of further modification in order to change the amount of chips required in relation to ship type/size (say, M5=1MC, M4=2MC, M3=3MC, M6=10MC etc). I'm also thinking of enabling a fast capture mode that costs more (say, four times the MCs, but takes a third of the time to work) for those instances where the crap's hitting the fan and you really need to get the hell away NOW, but you'd still like to do it with a new ship in tow.

But I'm done scripting for today, so this will have to wait. :p

A last note: I haven't spk-ed my script-mod because the script still belongs to Nividium - this is just an addition to his script. He'll decide what to do with it.
Last edited by Meltdown on Tue, 9. Jun 09, 23:33, edited 3 times in total.
Eat, drink and be merry, for tomorrow you may die.

Post Reply

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