View unanswered posts | View active topics It is currently Sat Jan 11, 2025 11:10 pm



Reply to topic  [ 5 posts ] 
 Proximity Mines 
Author Message
User avatar

Joined: Tue Apr 01, 2008 4:49 pm
Posts: 1972
Location: The Netherlands
Reply with quote
Post Proximity Mines
Hi people,

Could someone help me out by making a lua script which makes TDExplosives go off when someone is nearby?
I've been trying to modify the homing missile script, but... :???:


Tue Jun 16, 2009 9:28 pm
Profile

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post Re: Proximity Mines
If you have my BW mod, check out the proximity mine. Its exactly what you're looking for I think.

You can find all the needed stuff in BW.rte/Grenades


Tue Jun 16, 2009 9:32 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Proximity Mines
Wouldn't a radius area detection work better?


Tue Jun 16, 2009 9:35 pm
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Proximity Mines
Well just a quick script:

Code:
function Update(self)
    for actor in MovableMan.Actors do
        local avgx = actor.Pos.X - self.Pos.X;
       local avgy = actor.Pos.Y - self.Pos.Y;
      local dist = math.sqrt(avgx ^ 2 + avgy ^ 2);
      if dist < 250 then
          self:GibThis()
      end
   end
end

Distance is changed, obviously


Tue Jun 16, 2009 9:36 pm
Profile
User avatar

Joined: Tue Apr 01, 2008 4:49 pm
Posts: 1972
Location: The Netherlands
Reply with quote
Post Re: Proximity Mines
Thanks, all. :)


Tue Jun 16, 2009 9:45 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.026s | 14 Queries | GZIP : Off ]