View unanswered posts | View active topics It is currently Fri Dec 27, 2024 10:10 am



Reply to topic  [ 3 posts ] 
 Just a Couple Questions 
Author Message
User avatar

Joined: Fri Mar 13, 2009 2:31 am
Posts: 217
Location: Earth... I think
Reply with quote
Post Just a Couple Questions
I'm making a homing missile based off of TLB's homing missile code but I don't know how to get it to go after an AEmitter called "targetx" can someone help me out?

Also I'm trying to make an actor have a dash function instead of a jet pack so when you sharp-aim and dash then you go in that direction. I don't want him to teleport I just want him to fly in the direction he is aiming for like 2 sec. I made a ini version but he got smashed into walls and it sucked. I know trig but can someone tell me how(or make code) to make him dash?


Sun Jan 10, 2010 4:39 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Just a Couple Questions
This is for the missile:

Code:
function Update(self)

   if not(MovableMan:IsParticle(self.target)) then
    for emitter in MovableMan.Particles do
     if particle.ClassName == "AEmitter" and particle.PresetName == "targetx" then
        self.target = emitter;
     end
    end
   elseif MovableMan:IsParticle(self.target) then
        self.RotAngle = SceneMan:ShortestDistance(self.Pos,emitter.Pos,SceneMan.SceneWrapsX).AbsRadAngle;
        self:EnableEmission(true);
   end

end


Includes finding the emitter, setting it to "self.target", orientating itself to point towards self.target, and enabling its emission (assuming the missile is an emitter).


Sun Jan 10, 2010 5:33 pm
Profile
User avatar

Joined: Fri Mar 13, 2009 2:31 am
Posts: 217
Location: Earth... I think
Reply with quote
Post Re: Just a Couple Questions
ahhhh ok I wasn't doing the class name right so that's why it wasn't working Thanks bunches!!!


Mon Jan 11, 2010 1:35 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.037s | 13 Queries | GZIP : Off ]