Author |
Message |
lucariokiller
Banned
Joined: Fri Dec 09, 2011 10:32 am Posts: 226 Location: In the datarealms cemetery
|
A script That make all actors'n crafts dies but no brains?
It's for a TSAR BOMBA mod.
|
Mon Apr 30, 2012 12:58 pm |
|
|
trotskygrad
Joined: Mon Nov 14, 2011 8:58 pm Posts: 92
|
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
|
Fri May 11, 2012 2:27 pm |
|
|
weegee
DRL Developer
Joined: Thu Jun 11, 2009 2:34 pm Posts: 966 Location: Moscow, Russia
|
Re: A script That make all actors'n crafts dies but no brains?
You can use actor:IsInGroup("Brains") to check.
|
Fri May 11, 2012 2:45 pm |
|
|
lucariokiller
Banned
Joined: Fri Dec 09, 2011 10:32 am Posts: 226 Location: In the datarealms cemetery
|
Re: A script That make all actors'n crafts dies but no brains?
No worries trotskygrad,This is really stupid.
|
Tue May 15, 2012 3:29 pm |
|
|
trotskygrad
Joined: Mon Nov 14, 2011 8:58 pm Posts: 92
|
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
|
Tue May 15, 2012 3:32 pm |
|
|
Bad Boy
Joined: Fri Sep 10, 2010 1:48 am Posts: 666 Location: Halifax, Canada
|
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
|
Tue May 15, 2012 4:19 pm |
|
|
lucariokiller
Banned
Joined: Fri Dec 09, 2011 10:32 am Posts: 226 Location: In the datarealms cemetery
|
Re: A script That make all actors'n crafts dies but no brains?
Bad boy,you are now in the credits of my mod!
|
Tue May 15, 2012 7:23 pm |
|
|
DAME777
Joined: Wed May 18, 2011 2:44 am Posts: 491 Location: Dank dreams.
|
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.
|
Tue May 22, 2012 6:24 pm |
|
|
lucariokiller
Banned
Joined: Fri Dec 09, 2011 10:32 am Posts: 226 Location: In the datarealms cemetery
|
Re: A script That make all actors'n crafts dies but no brains?
Bad boy,your script don't work.
|
Thu May 24, 2012 12:55 pm |
|
|
Bad Boy
Joined: Fri Sep 10, 2010 1:48 am Posts: 666 Location: Halifax, Canada
|
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
|
Thu May 24, 2012 5:43 pm |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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.
|
Thu May 24, 2012 5:47 pm |
|
|
Bad Boy
Joined: Fri Sep 10, 2010 1:48 am Posts: 666 Location: Halifax, Canada
|
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.
|
Thu May 24, 2012 6:14 pm |
|
|
|