Hi,
Is there a way to know if a ship is related to a mission? They don't seem to have a job, so it's kinda difficult (and flight time is too hazardous). A local variable maybe?
I'm interested in the Defend Object mission.
Thanks!
Ship related to mission?
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Re: Ship related to mission?
The following on a [SIGNAL_CHANGESECTOR] seems to do the trick:
EDIT: modified the code, previous one was not affecting all ships.
Code: Select all
$target = [THIS]-> get attack target
$flightTime = [THIS]-> get flight time
$plSector = [PLAYERSHIP]-> get sector
dim $defendObjectRaces = [Xenon], [Pirates], [Yaki]
if find [OWNER] in array: $defendObjectRaces
if $target -> is of type [Station]
if $sector == $plSector AND $flightTime <= 60
$target = [THIS]-> get attack target
if $target-> is of class [Station]
* Cha-ching!
end
end
end
end
return null