Scripting question

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

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

Jonson27
Posts: 170
Joined: Thu, 3. Jun 04, 14:08
x2

Scripting question

Post by Jonson27 »

I have a question about targetting. I want to be able to get the target that an attacking ship has. This should work for any ship of any race. I need to be able to know whether the ship is attacking a player-owned ship. The main issue is being able to get the target.

I looked through the scripting manual and found these commands:
get attack target
get command target

My question is, which one might work? Anyone else ever needed to get the target that an attacking ship has?
Hello there!! (Jumping up and down)
User avatar
Chris Gi
Posts: 960
Joined: Wed, 20. Sep 06, 09:57
x3tc

Post by Chris Gi »

I guess "get attack target" is the one you're after. But it may depend on the exact circumstances.

A good fighting script uses "set attack target" to store the information which ship a ship is actually attacking. "get command target" may give you the same information. But consider this: a ship has the command to return home. The script may use the "set command target" to store the information where the ship is heading to. Now the ship gets attacked and starts defending itself and attacking the attacker. The defend script may use the "set attack target" to the attacker.

But a ship may get the command to attack a ship and thus use the "set command target" to store the information which ship it is attacking. And the actual script dealing with the fight sets the attack target to the same ship....

The best way is to check the underlying script which set-command they use...
--------------------------------

[ external image ]
Jonson27
Posts: 170
Joined: Thu, 3. Jun 04, 14:08
x2

Post by Jonson27 »

Hmm looks confusing. I'm not looking forward to this.
Hello there!! (Jumping up and down)
User avatar
Chris Gi
Posts: 960
Joined: Wed, 20. Sep 06, 09:57
x3tc

Post by Chris Gi »

Sorry, I didn't want to confuse you.

Stick to the "get attack target" command - should work in most circumstances.
--------------------------------

[ external image ]

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