Data Realms Fan Forums http://45.55.195.193/ |
|
A script That make all actors'n crafts dies but no brains? http://45.55.195.193/viewtopic.php?f=73&t=30932 |
Page 1 of 1 |
Author: | lucariokiller [ Mon Apr 30, 2012 12:58 pm ] |
Post subject: | A script That make all actors'n crafts dies but no brains? |
It's for a TSAR BOMBA mod. |
Author: | trotskygrad [ Fri May 11, 2012 2:27 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
lucariokiller wrote: It's for a TSAR BOMBA mod. no offense but that seems stupid as hell... might as well call it the "actor wipe" bomb, since it has no resemblance to a real tsar bomba. though I know GetPlayerBrain works for human players, I'm not sure whether it works for AI brains you could try MovableMan:GetUnassignedBrain |
Author: | weegee [ Fri May 11, 2012 2:45 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
You can use actor:IsInGroup("Brains") to check. |
Author: | lucariokiller [ Tue May 15, 2012 3:29 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
No worries trotskygrad,This is really stupid. |
Author: | trotskygrad [ Tue May 15, 2012 3:32 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
actually I would be up for an "actor wipe" device, just don't call it a "tsar bomba" would be quite useful for the laggy times |
Author: | Bad Boy [ Tue May 15, 2012 4:19 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
This'll gibs all non-brain actors on the map (assuming there're no typos or anything). If you want to specify team or range you have to add a bit more but it's really pretty simple. Code: for actor in MovableMan.Actors do if not actor:IsInGroup("Brains") then --can also be if not actor:HasObjectInGroup("Brains") then since I'm pretty sure hasobjectingroup counts the actor too. actor:GibThis(); --can also be actor.ToDelete = true; if you want the actor to disappear or -- actor.Health = 0; if you want the actor to die without gibbing. end end |
Author: | lucariokiller [ Tue May 15, 2012 7:23 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
Bad boy,you are now in the credits of my mod! |
Author: | DAME777 [ Tue May 22, 2012 6:24 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
I'd call it the overload bomb because anything that doesn't have the brain power of a brain gibs all over the place. |
Author: | lucariokiller [ Thu May 24, 2012 12:55 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
Bad boy,your script don't work. |
Author: | Bad Boy [ Thu May 24, 2012 5:43 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
Yes it does, I just checked by testing it and it works fine. If you don't know how to attack a script to something don't blame me. More specifically for a bomb you'll want: Code: function Create(self) end function Update(self) end function Destroy(self) for actor in MovableMan.Actors do if not actor:IsInGroup("Brains") then --can also be if not actor:HasObjectInGroup("Brains") then since I'm pretty sure hasobjectingroup counts the actor too. actor:GibThis(); --can also be actor.ToDelete = true; if you want the actor to disappear or -- actor.Health = 0; if you want the actor to die without gibbing. end end end |
Author: | Roast Veg [ Thu May 24, 2012 5:47 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
If lucariokiller is unable to use simple Lua then he wouldn't know you had to enclose it in the destroy function. |
Author: | Bad Boy [ Thu May 24, 2012 6:14 pm ] |
Post subject: | Re: A script That make all actors'n crafts dies but no brains? |
Yeah, fair enough, I suppose I should have thought about that. Create or update would have done something too so I can only assume he just placed it straight in there. Anyway, problem solved either way I hope. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |