Does anyone understand any of these commands?

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

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

User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Does anyone understand any of these commands?

Post by Kailric »

-get tactical: what is the tactical they are getting?
-get followmode: what is a followmode?
-get command target and get command target2: what is this all about?
-on the defence move command, what is the "type" argument?
-and does anyone know what/when/and why about the Flight Retcodes?
I understand someof these, but not all
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
blackspell
Posts: 128
Joined: Sat, 6. Mar 04, 20:18
x2

Post by blackspell »

a whole bunch of questions for one post ;)

- get tactical: return current movement of ship as tactical, i.e. attacking, defensive move, avoiding object and so on
- command target(2) return the traget of current action. For the buy ware script this would be target=Station and target2=ware. With an attack script, target would be the current victim beeing attacked.

they both can be used to get information about what another ship is currently doing.

- fltretcode
Flight returncodes seem to be a special class of script returncodes. At least, if you look at the available constants they look this way.
Only time I can remember one of those beeing used was in one of the turret scripts, it used FLRET_FIREFREE to check if the enemy is in firing range/position

- defensive move: i'm not sure about this, but since the type argument is of datatype 'var/number' it think it uses the SSTYPE_ constants to determine how to make a defensive move (i.e. avoiding a sstype_bullet is totally different from avoiding a sstype_asteroid)
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

in the set tactical command the argument is a var/number...so I am assumeing if you "get tactical" it will return a number?

And does this number represent an action?
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle
blackspell
Posts: 128
Joined: Sat, 6. Mar 04, 20:18
x2

Post by blackspell »

yes, it returns a number. but since messing around with number directly would be really hard, egosoft provides some predefinded constants (directly under [THIS], [HOMESECTOR] and so on there is a 'Select Constant' option)

ACTION_AVOID, ACTION_ATTACK and so on represent the current tactical
User avatar
Kailric
Posts: 985
Joined: Sun, 7. Dec 03, 05:15
x3

Post by Kailric »

so would this be correct ?

Code: Select all

tac=get tactical
if tac = [action-idle]
   write to log  "I am silly as a silly bug"
end

I ran a log on all the Flret codes

Timeout: is called everytime the "timeout" varable has...timed out or reach its end in ms.
Firefree: is called if the target is in fireing range and position
Interrupt: is called when ever a script interrupts the command
Break: is called I am assumening when the action can not be completed anymore..not sure though. I accidently ran this on every object in the game and Break was returned to log also
Targetreached: is called when the follow with percision is reached

And the rest I don't know or are self expanitory maybe?
"Try not. Do or do not, there is no try."-Yoda

"[Its] time for the human race to enter the solar system"-Dan Quayle

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