[AL-PLUGIN] [TC] - Change Sector Size v2.1.5 - [Update 08.06.2014]

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

Nicoman35
Posts: 661
Joined: Thu, 17. Nov 05, 14:12
x3tc

[AL-PLUGIN] [TC] - Change Sector Size v2.1.5 - [Update 08.06.2014]

Post by Nicoman35 » Fri, 17. Aug 12, 20:09

--------------------------------
Change sector size v2.1.5
--------------------------------

Do you want to have the feeling of real HUGE sectors, where you can get lost?
Are you bothered by some sector feeling too big?
Here is the solution for you!


Hi there people, I'm presenting you my plugin Change Sector Size.

The idea is not from me, but from Striker304. Here is his script.

Here, I am taking the opportunity and thank Striker304 for his idea and inspiration. Thank you.

Unlike mines, Striker's mod is available only in german.
I have rewritten and enhanced this to a point, where I want to share it with you guys.

:idea: Needed resources: Currently available languages: English, german.

Features
  • :arrow: Basicly, you are able to change the size of single, several or all sectors of the universe.
    :arrow: This is achieved by moving stations, gates, asteroids, debris, flying wares, orbital weapon platforms, lasertowers and planets.
    :arrow: All changes reversible, you are able to reset the sectors to their original size at any time.
    :arrow: New gamestart not needed
    :arrow: v2.1.0 introduces a new feature: Placement of pirate station further away
    :arrow: v2.1.3 introduces a new feature: Change the sector canvas!
To activate the plugin, just open the Community Plugin Configuration Menu and hit 'Sector Size Changer'.
A self explanatory menu will open and guide you through.
You are welcome to make proposals and report any bugs you encouter.

Image

After downloading, unpack and copy content of the folder 'Change sector size' into the main game directory.
Beside the nedded script files, a tool named 'Syncronize Canvas' will be placed in the main game folder. With this tool it is possible to syncronize the 'canvas' you see in the sector map with your actual ingame presets. Start the tool and click on the upper right question mark for further info.

Note: for the Canvas to be changed, it is necessarry, the file x3_universe.xml to be in the ..X3 Terran Conflict\maps folder. This file is to be usually found inside of a cat/dat file. You will have to extract the file to the maps folder with Doubbleshadow's X3 Editor2

Known incompatibilities: None known yet. Jour job to tell me. :wink:

Issues:
  • - Sector New Income, at sector sizes above 280%: Instant kill when entering or jumping to New Income, regardless of the gate used. No idea why this happens. Solution: Reduce the size of that sector beneath 280%, if you want to jump to it.
Notes:
1. As I did not test the german version yet, I would like to know if everything is ok.
2. Some things, such as complex hub and station complexes might cause problems, please report, if you encounter bugs.
3. When changing the size of the entire universe, take into account that it will take a few minutes, as thousands of objects are to be moved. When the plugin ends its work, it will reopen the main menu.
4. Source code of the tool 'Syncronize Canvas v1.0.1.exe'. You need Microsoft Visual c# 2010 express to have a look at it.

Version history:

v2.1.5:
  • - minor bugfixing
v2.1.4:
  • - bugfixing regarding movement of objects (mainly stations) built in sectors deviating from vanilla size.
v2.1.3:
  • - itroducing the possibility to change the canvas of sectors with the help of an external tool. Many thanks to Ketraar for his patience and help on MD coding.
v2.1.1:
  • - fixed some code that could have led to errors regarding lasertower movement
v2.1.0:
  • - fixed some spelling errors
    - Pirate stations are imho to near to sector center to be well hidden from police patrols. I would rather like to search for them, making it more belivable those stations to not be found by law enforcement ships. There is now an option where you are able to change the distance of pirate stations to the sector center.
    - fixed some code that could have caused Problems
Have fun!
Last edited by Nicoman35 on Sun, 8. Jun 14, 20:18, edited 28 times in total.

User avatar
joelR
Posts: 1995
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Fri, 17. Aug 12, 20:16

Thanks Nicoman35. This is great. Does it require a restart once changing the sector size?

Nicoman35
Posts: 661
Joined: Thu, 17. Nov 05, 14:12
x3tc

Post by Nicoman35 » Fri, 17. Aug 12, 20:21

joelR wrote:Does it require a restart once changing the sector size?
No, a restart is not needed. :)

Nicoman35
Posts: 661
Joined: Thu, 17. Nov 05, 14:12
x3tc

Post by Nicoman35 » Mon, 20. Aug 12, 20:04

Fixed minor issues, v2.02 available.

Have fun

User avatar
joelR
Posts: 1995
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Mon, 20. Aug 12, 21:32

Do you have a changelog or is it just boring technical stuff?

Nicoman35
Posts: 661
Joined: Thu, 17. Nov 05, 14:12
x3tc

Post by Nicoman35 » Mon, 20. Aug 12, 22:03

Changed some spelling and the installed message not to popup at every reload.

ptb_ptb
Posts: 142
Joined: Wed, 5. Sep 12, 18:56

Post by ptb_ptb » Wed, 7. Nov 12, 12:09

I think this is a neat script, but what it doesn't do is change the size of the 'canvas' of the sector map*. Would it be possible to have it alter that either separately or at the same time?

* If you have a station at -40, 10, 4 and resize the sector to 50% it moves to -20, 5, 2 but if the left edge of the sector map was at -300 it doesn't move it to -150.

Nicoman35
Posts: 661
Joined: Thu, 17. Nov 05, 14:12
x3tc

Post by Nicoman35 » Wed, 7. Nov 12, 15:46

ptb_ptb wrote:I think this is a neat script, but what it doesn't do is change the size of the 'canvas' of the sector map*. Would it be possible to have it alter that either separately or at the same time?

* If you have a station at -40, 10, 4 and resize the sector to 50% it moves to -20, 5, 2 but if the left edge of the sector map was at -300 it doesn't move it to -150.
I do not know what you mean exactly. You mean the size of the sector itself and its display on the sector map?
I mean: Lets say you are in a ship with the advanced scanner. In Kingdom End, when calling the sector map, you see your ship with the grey scanner sphere around you. On your monitor it has the size of - say - 4 cm in diameter.
The same sphere in a big sector, such as Two Grand for example, is much smaller. Let's say about 2 cm in diameter.

If I understand right, you want to have that effect when changing the sector size, right? Along with the correct size display in the galaxy map?

Well, if you mean that, I think it is not possible to do it. At least not by some script commands.

Though, if some crack around here could tell me how to do it, I'll put myself to work for an update.

ptb_ptb
Posts: 142
Joined: Wed, 5. Sep 12, 18:56

Post by ptb_ptb » Wed, 7. Nov 12, 17:29

Nicoman35 wrote:I do not know what you mean exactly. You mean the size of the sector itself and its display on the sector map?
If I understand you correctly, then yes. See http://forum.egosoft.com/viewtopic.php?p=1796216.

You may well be right that it can only be altered in a mod - not in scripts.

So what I'd need would be some sort of X3 editor, maybe one custom made to make changing sector sizes easy. Probably a bit much to hope for. :P

Nicoman35
Posts: 661
Joined: Thu, 17. Nov 05, 14:12
x3tc

Post by Nicoman35 » Wed, 7. Nov 12, 21:39

Yes, we're talking the same thing.
Well, as said, I do not know any way of changing the sector canvas ingame. IMHO, is not possible with the given script commands.
Because I remember that I wanted to do exactely this , when I made the mod, and I failed. Sorry.

Nicoman35
Posts: 661
Joined: Thu, 17. Nov 05, 14:12
x3tc

Post by Nicoman35 » Tue, 23. Apr 13, 11:58

New version out, I was anoyed by not being able to change the canvas of the sectors, see my discussion with ptb_ptb.
So, I learned the basics of c# and made a tool by myself. I used Microsoft Visual c# 2010 express to code it. If anyone is interrested in the sourcecode: See first post. Don't expect too much from it though. It's my first program I coded in C#.

User avatar
joelR
Posts: 1995
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Wed, 24. Apr 13, 00:57

Nicoman35,

Im getting this error when trying to change the canvas size:

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Games\1NoSteam\X3 terran conflict\X3TC.exedirector\Change_sector_canvas.xml'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
   at System.Xml.XmlWriterSettings.CreateWriter(String outputFileName)
   at System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings)
   at System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options)
   at System.Xml.Linq.XDocument.Save(String fileName)
   at CanvasChanger.Window.ChangeSize_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18034 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Canvas Changer
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Games/1NoSteam/X3%20terran%20conflict/addon/Syncronize%20Canvas%20v1.0.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18036 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18021 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18034 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18034 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Nicoman35
Posts: 661
Joined: Thu, 17. Nov 05, 14:12
x3tc

Post by Nicoman35 » Wed, 24. Apr 13, 08:07

Hi joelR,

1. Check, if you have .Net Framework 4.5 installed.
2. Which win version do you have?
3. When does this exactly occur? Are you able to start Syncronize Canvas v1.0.exe?
4. If so, could you post a screenshot of the Syncronize Canvas v1.0.exe? I only need the window itself.
5. Are you in admin mode or user mode on your rig?

User avatar
joelR
Posts: 1995
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Wed, 24. Apr 13, 09:09

4.5
Windows 7 64bit
Admin mode
Its only when trying to change the canvas. Program opens fine and im able to fill out all 3 fields.

I unpacked the x3-universe.xml and put it in a map folder.

EDIT: The error says im using 4.0 for some reason. Ill try uninstalling that and reinstalling 4.5. Not sure why its using 4.0.

EDIT 2: No luck.

Nicoman35
Posts: 661
Joined: Thu, 17. Nov 05, 14:12
x3tc

Post by Nicoman35 » Wed, 24. Apr 13, 10:29

I'm at work ATM, I will have a look at it in the evening tooday.
Seems there is a problem with the Change_sector_canvas.xml. It is a mission director file, which is created and saved to the \director folder of the game. Do you have this folder?

Post Reply

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