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?
Scripting question
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 170
- Joined: Thu, 3. Jun 04, 14:08
Scripting question
Hello there!! (Jumping up and down)
-
- Posts: 960
- Joined: Wed, 20. Sep 06, 09:57
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...
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...
-
- Posts: 170
- Joined: Thu, 3. Jun 04, 14:08