Newbtastic

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

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

User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Newbtastic

Post by Sandalpocalypse »

How would one get the seperate X, Y, Z coordinates out as variables from a Var/Sector Position?

I've tried Get X Position etc., but either I'm not doing it right (it worked with an object) or its something else.

And how does one eject cargo via script?

How does one change the name of a ship via script?

I newbishly can't seem to find this, even though its embarassing: How does one create a ship inside a station?

What's the procedure to make a script execute off a comms call?
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

combed through the forums, found:
markezekiel wrote: you can just use an argument to start the script that provides var/position as pos$

then you use:
x$=pos[0]
y$=pos[1]
z$=pos[2]
sec=pos[3]

you dont need to enter xyz manually

to find your current position its something like get player position as an array and use the xyz stuff from above
but I don't understand it. :/
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

that's right, the var/sector position returns an array of the three coordinates and the sector.

to find the x,y, and z coordinates you want the first three elements of the array 0,1 and 2.
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

ah okay makes sense. Thanks. I've worked around ejecting cargo by cheating, as well, but the answers to the last 3 questions would be dandy.
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

Eject cargo by creating a flying ware outside the ship and installing -1 into the ship.

scripts cannot rename objects
User avatar
Sandalpocalypse
Posts: 4447
Joined: Tue, 2. Dec 03, 22:28
x4

Post by Sandalpocalypse »

Nuts, that was the workaround I was using. Hoping there was a better one. Oh well!

They can't? Bleh.

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