Data Realms Fan Forums
http://forums.datarealms.com/

Two very simple questions
http://forums.datarealms.com/viewtopic.php?f=73&t=19040
Page 1 of 1

Author:  Awesomeness [ Sun Jun 20, 2010 6:59 pm ]
Post subject:  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...

Author:  findude [ Sun Jun 20, 2010 10:51 pm ]
Post subject:  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()

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/