Script request, "Move Target Anywhere", Please

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

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

User avatar
Storm_Front
Posts: 1021
Joined: Mon, 15. Dec 03, 05:27
x2

Script request, "Move Target Anywhere", Please

Post by Storm_Front »

There is a "Move Target" script at xscripting but it only moves things within the sector. The "Move Station" script there claims to move stations to anywhere in the universe, but it to only moves them within the sector.

I want to be able to move items to other sectors; stations, asteroids, capital ships, etc. Can this be done. If so would someone PLEASE get started on it. Let me know when it's done. :D
helmann
Posts: 79
Joined: Tue, 23. Dec 03, 10:26
x4

Post by helmann »

I would like the same thing. I have had a look at that script but have no idea how to change it.
Firedancer
Posts: 632
Joined: Wed, 13. Aug 03, 15:45
x3

hmm

Post by Firedancer »

helmann wrote:I would like the same thing. I have had a look at that script but have no idea how to change it.
guess it's easy enough, just gotta put targetsector as an input parameter, and then use it as a destination for the move command?
User avatar
Storm_Front
Posts: 1021
Joined: Mon, 15. Dec 03, 05:27
x2

Re: hmm

Post by Storm_Front »

Firedancer wrote:
helmann wrote:I would like the same thing. I have had a look at that script but have no idea how to change it.
guess it's easy enough, just gotta put targetsector as an input parameter, and then use it as a destination for the move command?
Easy enough if you know anything about scripting, :o I'm a modder and a lover, not a scripter. :D Could you show me an example of such a script. :) Please.
TeladiPhoenix
Posts: 260
Joined: Wed, 6. Nov 02, 20:31
x2

Post by TeladiPhoenix »

The script asks you for the position to put the station. When you select the position, it stores the axis data and sector in an array, so sector information is there. It's just a matter of having a command in the script engine that utilises it. And unfortunately I don't think there is one, though I can't check at the moment as I'm at work.
TeladiPhoenix
Posts: 260
Joined: Wed, 6. Nov 02, 20:31
x2

Post by TeladiPhoenix »

OK, just installed in on my office PC and tried it out and it's perfectly possible.

Here is the move.station as it currently exists.


=====================================

Arguments
1: source , Var/Ship/Station , 'Select Source Target'
2: loc , Var/Sector Position , 'Select New Position'
Source Text

001 * Created by Shock Troop AKA stmdk
002 * Do not move this into another object or boom!
003 $x = $loc[0]
004 $y = $loc[1]
005 $z = $loc[2]
006 $sec = $loc[3]
007 $source -> set position: x=$x y=$y z=$z
008 return null

=====================================


Insert a new line between lines 6 and 7 and add the following to it.

$source -> put into environment $sec ->

That will move the source to the location and should then set it's position there. I just moved a Split Python to the middle of The Vault with it.



EDIT

I've messed a bit more and it looks like that only works for ships, not asteroids or stations, not even your own. Think this needs playing with a bit more.

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