View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:21 am



Reply to topic  [ 2 posts ] 
 Two very simple questions 
Author Message
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Two very simple questions
Okay, so before I start, let me say this. Yes, I searched. Nothing.

I have two questions. The first is more important to me. How do I find where a bullet hit something when it collides in Lua?

And lastly, how do I create an explosion (preferably customizable in size and such) wherever I want with Lua?

You can see where I am going with this...


Sun Jun 20, 2010 6:59 pm
Profile
User avatar

Joined: Tue Dec 12, 2006 3:10 pm
Posts: 495
Location: Uncertain quantum state
Reply with quote
Post Re: Two very simple questions
Code:
if self.ToDelete then
...
end


Stick that to your Update(self) function
It will trigger if the bullet lodges into a wound, runs out of lifetime or settles into terrain, that is, is set to delete.
The bullets position will be at self.Pos

You could also use Destroy(self), but I have experiences suggesting that it's very crashy.

For the explosion,
make a MOSRotating with oldschool ini and then spawn and gib it with Lua.
You can spawn mulitple ones for more intense explosion.
Code:
particle = CreateMOSRotating("name")
particle.Pos = self.Pos
particle:GibThis()


Sun Jun 20, 2010 10:51 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.084s | 13 Queries | GZIP : Off ]