[SCRIPT] fix movetosector (now uses jumpdrive)

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

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

User avatar
moggy2
Posts: 4588
Joined: Wed, 6. Nov 02, 21:31
x3ap

[SCRIPT] fix movetosector (now uses jumpdrive)

Post by moggy2 » Mon, 30. Oct 06, 05:03

[Readme] . [Bug Tracking] . [Download]

Script: fix movetosector
Author: Xai Corporation
Download: http://www.xai-corp.net/project/fix-movetosector

update of the core script !move.movetosector, to include using Jumpdrives
Installation:

Zip: If you have the zip file, extract the file to your X3 directory

spk: If you have the spk file for Cycrows' script manager program, you must first install the script manager program. After that simply double clicking on the spk file will install it correctly.

Note: You will need to remove the file !move.movetosector.pck from your scripts directory to make this work. Save this file in a safe place incase you want to uninstall this script, or you want to run an unmodified game.


Usage:

This is a replacement for a core navigation script that is used by the majority of commands. The modification allows any ship traveling to a sector more than 2 jumps away to use it's jumpdrive, if it has enough energy, if it's ''destination'' is set to an object other than the sector. The effect is that the majority of commands will now use jumpdrives automatically, player and NPC ships alike.

This script does not deal with the purchase or resupply of Energy Cells for jump fuel. That has been left for other scripts to deal with.

I saw someone asking about a return home command that used the Jumpdrive. This will fix this problem and allow the return home command, allong with almost all the other commands, to use the Jumpdrive.

Kortako
Posts: 230
Joined: Sat, 22. Jul 06, 05:10
x4

Post by Kortako » Mon, 30. Oct 06, 06:01

I have a quick question. If this script affects NPC ships, especially traders, wouldn't it have an effect on the economy if all of the NPC free traders are jump-driving around the universe?

User avatar
moggy2
Posts: 4588
Joined: Wed, 6. Nov 02, 21:31
x3ap

Post by moggy2 » Mon, 30. Oct 06, 06:36

nobody buys energy for their JD, so the NPC's will very rarely use the JD

Kortako
Posts: 230
Joined: Sat, 22. Jul 06, 05:10
x4

Post by Kortako » Mon, 30. Oct 06, 06:44

Oh, right. Energy. Cool, then, I might just use this.

User avatar
KayEss
Posts: 96
Joined: Sun, 3. Sep 06, 16:52
x4

Post by KayEss » Thu, 25. Jan 07, 07:37

If this were packaged as a 'false mod' (I think the term is) would it then not require the removal of the .pck file?

Those of us on Steam can't remove the file (Steam replaces it when the game runs) so can't use the script as it is now.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 20594
Joined: Mon, 15. Nov 04, 00:26
x4

Post by Cycrow » Thu, 25. Jan 07, 14:44

you cant put scripts as false patchs, they have to go in the scripts directory, and the only way is to replace the existing files.

cant u turn of the file check on steam ?

User avatar
moggy2
Posts: 4588
Joined: Wed, 6. Nov 02, 21:31
x3ap

Post by moggy2 » Thu, 25. Jan 07, 16:03

If this file was a pck instead would that solve the problem?


...pst Cycrow, point me in the direction of a program to make pck's. I haven't done this in a long time

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 20594
Joined: Mon, 15. Nov 04, 00:26
x4

Post by Cycrow » Thu, 25. Jan 07, 16:05

u could use x2tool from the offical modding kit.

or u could use doubleshadows mod manager, add the file to a temp mod and it will be compressed to pck, then extract it without uncompressing

User avatar
moggy2
Posts: 4588
Joined: Wed, 6. Nov 02, 21:31
x3ap

Post by moggy2 » Thu, 25. Jan 07, 16:07

thanks.

edit:
right. If you download the zip file from Xai Corporation it includes the script as pck in a sub directory. You can copy this file over to the scripts directory, replacing the stock version if you want to try it that way.

User avatar
KayEss
Posts: 96
Joined: Sun, 3. Sep 06, 16:52
x4

Post by KayEss » Thu, 25. Jan 07, 16:21

moggy2 wrote:If this file was a pck instead would that solve the problem?


...pst Cycrow, point me in the direction of a program to make pck's. I haven't done this in a long time
I don't know. I'll have to try. It depends on whether Steam looks at the file from the point of view of "anti-tamper" with the DRM or from the point of view of "using the latest version".

If it's a good DRM solution it should allow no change to any files and still let the game run. I've not tried to analyse how Steam looks at it.

I suspect that trying this sort of thing out is illegal in much of the world due to the new copyright laws that have been introduced though. As far as I know Thailand hasn't gone to these lengths yet so trying it here may still be legal...

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

Post by Greg_G » Mon, 19. Feb 07, 22:48

I was just making an adjustment to this script for my own personal needs, and noticed something I don't understand.

On line 7:

Code: Select all

007    if not $destination -> is of class Sector
$destination is referenced before it's ever been assigned a value. It doesn't receive a value until line 12:

Code: Select all

012      $destination = [THIS] -> get destination
I thought perhaps it was a typo and was supposed to be $targetsector, but $targetsector is declared as a sector:

Code: Select all

1: targetsector , Var/Sector , 'sector' 
so it has to be of class Sector, doesn't it? If it's not a typo, then should line 12 be moved up above line 7?

My apologies if I'm wrong about this. I'd appreciate if you could explain either way so that I can learn from this.

Thank you,
Greg

User avatar
SymTec ltd.
Posts: 4389
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. » Mon, 19. Feb 07, 22:55

I thought exactly the same when reading this...

User avatar
moggy2
Posts: 4588
Joined: Wed, 6. Nov 02, 21:31
x3ap

Post by moggy2 » Tue, 20. Feb 07, 01:23

Greg_G wrote:...should line 12 be moved up above line 7?
...
Yes, in fact that is what I have in mine. Did I not update the download?

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

Post by Greg_G » Tue, 20. Feb 07, 01:24

It looks that way. I just grabbed it today. I got the ZIP one and not the SPK one. The SPK one might be fine.

User avatar
moggy2
Posts: 4588
Joined: Wed, 6. Nov 02, 21:31
x3ap

Post by moggy2 » Tue, 20. Feb 07, 01:39

indeed. I've just uploaded the correct version. I've no idea how that happened :roll:

Post Reply

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