View unanswered posts | View active topics It is currently Thu Jan 09, 2025 11:34 pm



Reply to topic  [ 4 posts ] 
 Grenades exploding and help with spawning actors with weapon 
Author Message

Joined: Sun May 31, 2009 6:49 pm
Posts: 69
Reply with quote
Post Grenades exploding and help with spawning actors with weapon
I have an npc that carries several grenades with gibimpulselimit 0.001 and i need this for the grenade to work. However when the actor dies all the grenades explode causing massive lag. Is there any way to auto remove the weapons when they die?

I also need the actor to spawn with 52 copies of the weapon.


Wed Jun 10, 2009 8:35 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Grenades exploding and help with spawning actors with weapon
Why?

Anyway, lua might help.

Have the grenades on destroy clean up the particles if there is no nearby actor.


Wed Jun 10, 2009 8:38 pm
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: Grenades exploding and help with spawning actors with weapon
If self.parent:IsDead() == true then
self.(disappear? I think GibThis would just make them explode anyway.)


Wed Jun 10, 2009 8:42 pm
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Grenades exploding and help with spawning actors with weapon
self.Lifetime = 1

Though, since destroy happend it already detonated.

Due to the low gib impulse there is no time to update.

So, just
Code:
function Destroy(self)
if self.parent:IsDead() then
for p in MovableMan.Particles do
if p:IsInGroup("Invisible Nade Particles Group") then
p.Lifetime = 1
end
end
end
end

And have all the nade particles in invisible nade particle group.


Wed Jun 10, 2009 8:50 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: Google [Bot]


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.032s | 14 Queries | GZIP : Off ]