View unanswered posts | View active topics It is currently Thu Mar 28, 2024 2:13 pm



Reply to topic  [ 1 post ] 
 GetMOFromID for a device in a craft 
Author Message
User avatar

Joined: Mon Oct 01, 2012 1:48 pm
Posts: 14
Reply with quote
Post GetMOFromID for a device in a craft
So, I made this mod. I modified the code to not check if it's held by an actor and tried to load it into a craft and the invisible brain lost track of the TDExplosive.
I'm not exactly sure how everything works, but GetMOFromID returns MO of the Actor if the device is held by him, but why does it return nil if it's inside a craft? How can I get MO of the craft in such case?
Code:
function Create(self)
   self.tracker = CreateTDExplosive("Brain","PocketBrain.rte");
   self.tracker.Pos = self.Pos;
   MovableMan:AddMO(self.tracker);
end

function Update(self)
   local newHolder = MovableMan:GetMOFromID(self.tracker.RootID);
   --if MovableMan:IsActor(newHolder) then
        self.Pos = newHolder.Pos;
   --else self.Pos = self.tracker.Pos;
   --end
   if self.tracker.ToDelete == true then
      self.GibThis(self);
   end
end


Wed Oct 03, 2012 8:33 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.407s | 15 Queries | GZIP : Off ]