Data Realms Fan Forums http://45.55.195.193/ |
|
Can someone make script for... http://45.55.195.193/viewtopic.php?f=73&t=16549 |
Page 1 of 1 |
Author: | ZevN47 [ Thu Sep 17, 2009 1:53 am ] |
Post subject: | Can someone make script for... |
gibbing an AEmitter right before it impacts with an actor... I've had issues trying to do this myself so I figured I would ask you people Yes I used the Search first but didn't find anything |
Author: | mail2345 [ Thu Sep 17, 2009 5:06 am ] |
Post subject: | Re: Can someone make script for... |
CastMO ray much? Just cast one, and see if it hits an actor. |
Author: | ZevN47 [ Thu Sep 17, 2009 3:08 pm ] |
Post subject: | Re: Can someone make script for... |
Ok any examples of this I can peek at... I suck at morays... wait does the UAV cluster bomb use this?... I'm gonna go check |
Author: | DrLuke [ Fri Sep 25, 2009 5:12 pm ] |
Post subject: | Re: Can someone make script for... |
Code: detdist = 500; if MovableMan:IsActor(self.target) == false then local curdist = 5000; 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 < curdist and actor.Team ~= self.Team then --THIS LINE curdist = dist; self.target = actor; if dist <= detdist then self:GibThis() end end end end Will make the object gib when it get's closer than 500px to any actor. If you want your script to only react to a special kind of actor, replace the line with "--THIS LINE" with the following: Code: if dist < curdist and actor.Team ~= self.Team and actor.ClassName == "ACRocket" or if dist < curdist and actor.Team ~= self.Team and not actor.ClassName == "ACrab" then The first line will make it blow up only when it's next to a ACRocket, the second line will make it not explode next to ACrabs. |
Author: | ZevN47 [ Wed Oct 07, 2009 9:01 am ] |
Post subject: | Re: Can someone make script for... |
DrLuke I thank you |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |