Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: killface on April 05, 2009, 01:03:22 pm
-
Hey all,
I'm looking for a SEXP that returns a result when an enemy targets me during a battle. I'm familiar with the "targeted" SEXP, but that only returns true if the PLAYER targets X, not the other way around. Any advice?
Thanks
killface
-
I'm afraid there's no such SEXP. I suggest to circumvent the problem and use either "set-object facing" combined with "distance" "<" "<value>" (and eventually "add-goal" "ai-chase" "<player>""<priority value>")when you want a given spacecraft to target the player. But that's more a "do" rather than a "when", meaning that you choose when this scripted targeting will occur.
You may also experiment this:
when-argument
(add all enemy spacecraft in the argument list)
<
get-object-z
<player>
<none>
<argument>
<argument>
<argument>
<minimal targeting distance>
I hope that the relative z coordinates of the player taken from each enemy spacecraft would be useful in determining wheter or not it's targeting it.