[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: Scripting / Modding Moderators, Moderators for English X Forum

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

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

Sorry to pester

Post by M3ds » Fri, 5. Jun 09, 00:33

Sorry man, I dont wanna pester you.

I replaced the ship.hijacker.main file with the version 1 file you posted but when I loaded up the game again, the whole command/hotkey had dissapeared in the controls interface menu. Do you think I could be doing something wrong?

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

Post by Meltdown » Fri, 5. Jun 09, 01:14

Huh... weird. My script doesn't touch the hotkeys.
Did you remove the original script before you put my replacement in the scripts folder? Cos you're not supposed to do that...
Eat, drink and be merry, for tomorrow you may die.

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

Post by M3ds » Fri, 5. Jun 09, 01:32

Well I used the Plugin manager to install the Origional Hijacker .spk
Then I went into my TC directory/Scripts deleted the Ship.Hijack.Main file and then copied yours in its place. Is that right? or so I keep both the script files?

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

Post by M3ds » Fri, 5. Jun 09, 01:49

ive checked the script editor and it has the hijack setup script which sets up the hotkey but theres no Ship.Hijack.Main, even though I have your script in the scripts folder.

.
.
.

Yea I've checked it agen and I dont know why but it dusnt seem to be Identifying your version of ship.hijackers.main, I'tll only show the origional version from the origional .spk file in the script editor

Im confused lol
Last edited by M3ds on Fri, 5. Jun 09, 02:01, edited 1 time in total.

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

Post by Meltdown » Fri, 5. Jun 09, 02:01

It's supposed to be called "ship.hijacker.main.xml". If you don't see it in your scripts folder, then either you've screwed up unpacking it, or I screwed up making the zip file. I just checked the zip and it seems fine, with no paths... just grab it off the Winzip/Winrar screen and drag-drop it to the scripts folder, it should then be in place.

Edit: so wait, you have the script in your "scripts" folder, but the game can't see it?

Weird, it works perfectly here :/

Let me check again...

Edit: hmm, something's wrong, there's a size mismatch.. I probably need to repack and reupload them.
Eat, drink and be merry, for tomorrow you may die.

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

Post by M3ds » Fri, 5. Jun 09, 02:08

Yea that it, its in there, unzipped n stuff but the in game script editor cant seem to detect it.

Thanx for all this btw man, sorry im a bit of a noob with all this

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

Post by Meltdown » Fri, 5. Jun 09, 02:19

I've reuploaded them. Hopefully they'll now work. If they don't I really have no idea what the heck's going on...

Uninstall and reinstall Nividium's original hijacker, then don't remove the original file. Unzip the modded one right into scripts, and tell it yes when it asks if you want to replace the original. If it doesn't ask you if you want to replace it, something's wrong...
Eat, drink and be merry, for tomorrow you may die.

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

Post by M3ds » Fri, 5. Jun 09, 02:24

thanx dude, ill give it a try now. Fingers crossed 8)

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

Post by M3ds » Fri, 5. Jun 09, 03:21

it works fine now, Awsome dude thanks allot. Happy days :D

crimson522
Posts: 36
Joined: Thu, 28. May 09, 23:07
x4

Post by crimson522 » Sat, 6. Jun 09, 17:25

i encountered something strange while using this script. whenever i try to cap xenon ships they never obey my commands for long. they will return to what they were doing before i started fighting/cappping them. in my case, i tried capping xenon ships in black hole sun that were on patrol through the sector. all the xenon ships i capped started to fly into the xenon sector above BHS. despite my commands to get them to stop they continued and were subsuqently destroyed by the other xenon on the other side

is this some kind of bug?

jimmydude
Posts: 134
Joined: Sat, 30. Dec 06, 15:56
x3tc

Post by jimmydude » Mon, 8. Jun 09, 02:17

Using Ver.2 (not-quite-cheat) one and I've noticed that it seems to be broken; ship control isn't transferred and the abandoned ships are unclaimable (option is completely missing from HUD context menu)

*Sigh* Tried using this script to get me a quick M6. Now I'm going to have to buy a naff race M6 and spend a few years training some marines... thinking of restarting now I've messed up the game by bumping up my fight rank too high. Can't believe how spectacularly useless Terran tech is (no fighter weapons stronger than an IRE! Even on M3+!)

Phosphene
Posts: 57
Joined: Mon, 26. May 08, 07:23
x3tc

Post by Phosphene » Mon, 8. Jun 09, 10:46

OKay I have a great idea
I make my living capping ships, and I of course had to try this. I went out on a mission that required me to defeat an osprey, which i required me to site there for 10 minutes in the ospreys blind spot railing on it with short bursts from hepts and IREs to depleat the shields. I took down the shields, transferred the chip, and gained control of the osprey beautifully. Got me a cool 12million in the bank or an attack frigate.

However, this is practically a cheat, although the logisitics are very accurate. I did, however, come up with some great ideas to balance this script.

First of all, to gain control you should be required to hold the shields down for large ships or below a certain amount for small ships, say 30% shields. This grants 100% cap probability at the cost of some damage, perfectly acceptable by anyones standards.

I was thinking about the logistics of a device that could do this, and I got a great idea. You should have two choices with this script. 1, if you hold the shields down or keep them below a certain percentage you can transfer the chip and get 100% cap probability. 2, you could drop the shields and instead of transferring a chip, transfer a warhead that destroys the ship after a certain period of time. This gives you 100% kill probability, an insta kill fire and forget missile for example.


I was thinking about my conflict with the osprey and either of these choices I would have taken without a second thought.

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

Post by Meltdown » Mon, 8. Jun 09, 16:45

crimson522 wrote:i encountered something strange while using this script. whenever i try to cap xenon ships they never obey my commands for long. they will return to what they were doing before i started fighting/cappping them. in my case, i tried capping xenon ships in black hole sun that were on patrol through the sector. all the xenon ships i capped started to fly into the xenon sector above BHS. despite my commands to get them to stop they continued and were subsuqently destroyed by the other xenon on the other side
is this some kind of bug?
Are you using the original script by Nividium or one of my modded ones?
In the first case, it's a bug - the change in owner race doesn't reset the AI due to (most likely) a missing waiting time in the script. In the second case it really shouldn't happen, since my main reason for modding the scripts was to remove precisely that bug. If it still happens I'll be expending more profanity allowance. :p
jimmydude wrote:Using Ver.2 (not-quite-cheat) one and I've noticed that it seems to be broken; ship control isn't transferred and the abandoned ships are unclaimable (option is completely missing from HUD context menu)
This doesn't happen to me at all. A capped ship is claimable as normal - eject, get near, "claim" option becomes available.
If anyone else can confirm this I'll get to work on it in a few days - I'm at my parents' at the moment and I don't have access to my gaming computer. Doubt there's much I can do though, because after the script gets to the "force eject" point everything else in the eject/transfer process is handled by the game engine. If something's broken it's in the "force eject" function, over which I have no power.
Phosphene wrote:First of all, to gain control you should be required to hold the shields down for large ships or below a certain amount for small ships, say 30% shields. This grants 100% cap probability at the cost of some damage, perfectly acceptable by anyones standards.
I don't get what you mean. You already have to beat at the target's shields in order to pass the microchip, and they've got to be at a lot less than 30%. Unless you mean to keep them under 30% during the whole of the capture process... which may be a bit of a problem, since it would limit you to a single capture in any fight with more than one enemy, otherwise the others would pummel you as you concentrated on one target alone.
2, you could drop the shields and instead of transferring a chip, transfer a warhead that destroys the ship after a certain period of time. This gives you 100% kill probability, an insta kill fire and forget missile for example.
If anyone wants to write their own script for this they're welcome, but I don't think I'll be modding this feature in myself (though I can always change my mind, you never know). It just seems to me that this would make it way too easy to blow up big ships. Hell, if all it takes to kill a carrier is to drop its shields and then transfer an armed bomb inside it, why would anyone bother with weapons that damage hull? Every ship in the game would only need shield degrading weapons, a transporter and a few warheads in the cargo bay. The only sensible way to do this would be to make it horribly expensive, but then it'd make more sense to spend the money for big guns, which - unlike warheads - can be re-used after you've blown up a ship.
Eat, drink and be merry, for tomorrow you may die.

jimmydude
Posts: 134
Joined: Sat, 30. Dec 06, 15:56
x3tc

Post by jimmydude » Tue, 9. Jun 09, 14:02

Sorry, think it was my fault - M6s are cappable (in theory) in TC but aren't supposed to be. There was a bug that generated Xenon P/PX in the first FF mission with low Morale and who (if you were lucky) could be capped just like fighters.

In the 2.0 patch Egosoft seem to have made doubly sure that will NEVER happen again - on top of adjusting the Morale of M6s in certain missions it seems they have completely removed the Claim function from M6s' context menus :oops:

Given that you can *claim* any ship in X3R and TC up to 1.4 (its just M6 and up refuse to bail) I'm guessing this is a new feature for 2.0 (even if a bail is forced through scripts the derelict is unclaimable)

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

Post by Meltdown » Tue, 9. Jun 09, 23:36

I get it; the script allows you to force-eject M6s' pilots, but the game doesn't let you claim them, right?
Try using the "take ownership" cheat script. You're not actually cheating, since the ship's already lost the shields and cargo, you're just claiming it in another way. :)
I've edited the modded script post to reflect this.
Eat, drink and be merry, for tomorrow you may die.

Post Reply

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