How to start a custom game in a custom galaxy?

The place to discuss scripting and game modifications for X³: Farnham's Legacy

Moderators: Moderators for English X Forum, Scripting / Modding Moderators, Moderators for the X3:FL Forums

Post Reply
dirkf
Posts: 30
Joined: Wed, 7. Jan 04, 00:34
x3tc

How to start a custom game in a custom galaxy?

Post by dirkf » Wed, 29. Nov 23, 23:22

If I go to start a game in a custom galaxy, it's always starting with the base discoverer and no other options.

How can I change things so that the start in a custom galaxy launches the custom game setup as well?

There is the additional problem that I never got any of the external script editors to work for me, so I would prefer a solution that can be done without needing them, even if it means editing xml files with notepad or so.

Can anyone help? Thanks

Tharrg
Posts: 257
Joined: Thu, 17. Feb 05, 16:09
x4

Re: How to start a custom game in a custom galaxy?

Post by Tharrg » Thu, 30. Nov 23, 10:31

When you start a custom game you get a dialog box with game settings. There is an 'extras' section at the bottom where you set up the HUB, HQ and Terran spy mission.

dirkf
Posts: 30
Joined: Wed, 7. Jan 04, 00:34
x3tc

Re: How to start a custom game in a custom galaxy?

Post by dirkf » Thu, 30. Nov 23, 13:07

Tharrg wrote:
Thu, 30. Nov 23, 10:31
When you start a custom game you get a dialog box with game settings. There is an 'extras' section at the bottom where you set up the HUB, HQ and Terran spy mission.
And what does that have to do with my question?
I know that you can setup that there, but you CANNOT choose a different galaxy map, the custom game always launches the default map.

Tharrg
Posts: 257
Joined: Thu, 17. Feb 05, 16:09
x4

Re: How to start a custom game in a custom galaxy?

Post by Tharrg » Thu, 30. Nov 23, 16:24

I have used Map Generator viewtopic.php?f=201&t=456167 to generate a random map and started a game using that.

dirkf
Posts: 30
Joined: Wed, 7. Jan 04, 00:34
x3tc

Re: How to start a custom game in a custom galaxy?

Post by dirkf » Thu, 30. Nov 23, 20:01

And how did you do that?
That was my question - the custom game has no option to select a custom galaxy, and if I select the custom galaxy I can't select the custom start - those are two different start options

Tharrg
Posts: 257
Joined: Thu, 17. Feb 05, 16:09
x4

Re: How to start a custom game in a custom galaxy?

Post by Tharrg » Thu, 30. Nov 23, 23:10

Install the map generator as explained here https://www.nexusmods.com/x3terranconflict/mods/121.

Launch MapGen.exe, create a random map and save.

Now when you go to start a game in a custom galaxy you can choose the map you just created.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22230
Joined: Sun, 14. Nov 04, 23:26
x4

Re: How to start a custom game in a custom galaxy?

Post by Cycrow » Thu, 30. Nov 23, 23:40

if you plan to write a script, there are too ways you can do it.

first, is create the init script, it should be called galaxy.GALAXYNAME.initplayership
with GALAXYNAME the name of your custom galaxy.

this is run when the game is created, and the ship you return from the script will be used as main player ship.


The other is to create a setup script that runs once when the game first loads, and opens the custom start dialog
the script name needs to start with setup.*

Code: Select all

if not get global variable 'run.once.init'
  set global variable 'run.once.init' value=[TRUE]
  $gamestart.id = get game start id
  if $gamestart.id == -1
    START call script 'plugin.customstart.run'
  end
end
if you cant use the external editors (make sure you have the FL version)
then you can just use the internal one

editing the xml file directly is not advised

dirkf
Posts: 30
Joined: Wed, 7. Jan 04, 00:34
x3tc

Re: How to start a custom game in a custom galaxy?

Post by dirkf » Fri, 1. Dec 23, 08:16

Tharrg wrote:
Thu, 30. Nov 23, 23:10
Now when you go to start a game in a custom galaxy you can choose the map you just created.
Something must have gone wrong with my first installation, because the custom setup never came up for me in a custom galaxy, I was always left with 1000cr and a discoverer.

That is why I asked this topic

I reinstalled the package and now the custom game setup launches with a custom galaxy.

So problem solved
Cycrow wrote:
Thu, 30. Nov 23, 23:40
first, is create the init script, it should be called galaxy.GALAXYNAME.initplayership
with GALAXYNAME the name of your custom galaxy.

this is run when the game is created, and the ship you return from the script will be used as main player ship.
Thanks for the info

I tried to use the init script before, but it never worked - likely because I didn't know that the player ship would have to be given as a return value.
With your added info I should be able to use both methods correctly.

Post Reply

Return to “X³: Farnham's Legacy - Scripts and Modding”