Finding lasertowers

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
User avatar
Quinch
Posts: 362
Joined: Thu, 10. Jun 04, 01:09
xr

Finding lasertowers

Post by Quinch » Sat, 18. May 13, 14:51

Quick question - I'm trying to write a script that will reset all lasertowers to neutral to me. However, I can't seem to find a command that searches a sector for them - they don't seem to qualify as ships and from what I can tell, there's no "all objects into array" command that I could filter by class either.
I wasn't banished to the moon yesterday.

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Mon, 20. May 13, 10:01

This here is from one of my scripts (I use the Mr. Bears wonderful tool X-Studio):

Code: Select all

$sector.ships = $sector-> get ship array from sector/ship/station
for each $ship in array $sector.ships using counter $cnt
if $ship-> is of class [Lasertower]
do something
end

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”