Thread: Random Contacts
View Single Post
  #52  
Old 04-20-2010, 06:55 PM
Nanaki Nanaki is offline
Approved Member
 
Join Date: Mar 2010
Posts: 338
Default

Well, now I have to figure out how to do the despawn script. Unfortunately, I have not the foggiest idea on where to start. I have been trying different ideas but all of them have failed so far.

Basically, I need the escort ships to despawn whenever the primary capital ship passes through a gate. The hardest part is making sure im despawning the correct escorts. My current attempt is focusing upon naming escort ships the exact same names as their parent ships, and adding an _escort1, _escort2, etc. etc. etc. at the end. Then, when the script is called to delete that random contact, it would also call deletion scripts for its escorts:

function trigger_inside2portal_Action()
--SLOG("Action done....");
local myTriggerContext = GetTriggerContext();
local flight = myTriggerContext:GetFlight();
flightelete();

local escort1 = flight.."_escort1"
escort1elete();
end;

Only problem was, it spat out an error:
[ScriptSystem] error: attempt to concat local `flight' (a table value)

So the triggers use tables? Getting data out of it is going to be harder than I thought, it seems.
Reply With Quote