Setting starting sector and starting ship.

The place to discuss scripting and game modifications for X²: The Threat.

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

shamas_the_wise_shaman
Posts: 39
Joined: Fri, 11. Aug 06, 08:13
xr

Setting starting sector and starting ship.

Post by shamas_the_wise_shaman »

How do you change the starting sector of a new game (with a new map) and how do you change the ship in which the player starts? It seems to default to the coordinates of Argon Prime, with an Argon Discoverer.

-Shamas the wise Shaman
User avatar
khaakbaiter
Posts: 1091
Joined: Mon, 14. Aug 06, 22:29

Post by khaakbaiter »

Sorry dude but i think its a fixed setting :(
shamas_the_wise_shaman
Posts: 39
Joined: Fri, 11. Aug 06, 08:13
xr

What about a script?

Post by shamas_the_wise_shaman »

Is there a script that will position the Player into a new spot once a new game has been started?

-Shamas the wise Shaman
Pogi
Posts: 522
Joined: Thu, 13. Apr 06, 12:35
x2

Post by Pogi »

If Argon Prime does not exist...You will start in the upper-most left part of the map..Whichever sector that is.
X3..The most fun a man can have...With his clothes on.
User avatar
khaakbaiter
Posts: 1091
Joined: Mon, 14. Aug 06, 22:29

Post by khaakbaiter »

Kingdom End pogi, and also Ringo moon in X2 cannot remember where...
User avatar
Chris Gi
Posts: 960
Joined: Wed, 20. Sep 06, 09:57
x3tc

How to set start sector and ship (and money!)

Post by Chris Gi »

This is done by means of a special script. This script has to be named galaxy.{YourMapName}.initplayership, with YourMapName being the name of your map. If you name your map Universe.xml for example, the script name would be galaxy.Universe.initplayership.

This script take no arguments and must return the ship of the player. You can call any script you want from this script, as long as none of the called scripts uses PLAYERSHIP (which doesn't exist at that moment). Ah, and don't forget to add a little money to the player...

So, here's a useful script (in pseudocode):

Code: Select all

$sec = get sector from universe index: x=$x, y=$y
$startship =  create ship: type={ShipType} owner=Player addto=$sec x=0 y=0 z=0
= $startship -> install {as much as you want} units of {whatever you wand}
add money to player: {as much as you want}
return $startship
Happy positioning,
Chris Gi
shamas_the_wise_shaman
Posts: 39
Joined: Fri, 11. Aug 06, 08:13
xr

Thanks

Post by shamas_the_wise_shaman »

Thanks, this is what I was after.

-Shamas the wise Shaman
User avatar
khaakbaiter
Posts: 1091
Joined: Mon, 14. Aug 06, 22:29

Post by khaakbaiter »

it's amazing how many people joined in 2006 and especially august :o

although i'm now more of an X3 player now

Return to “X²: The Threat - Scripts and Modding”