[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
Meltdown
Posts: 303
Joined: Wed, 6. Nov 02, 21: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: 303
Joined: Wed, 6. Nov 02, 21: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: 303
Joined: Wed, 6. Nov 02, 21: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: 303
Joined: Wed, 6. Nov 02, 21: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: 303
Joined: Wed, 6. Nov 02, 21: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: 303
Joined: Wed, 6. Nov 02, 21: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?

Post Reply

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