Data Realms Fan Forums http://45.55.195.193/ |
|
Explosive bullets http://45.55.195.193/viewtopic.php?f=1&t=29378 |
Page 1 of 2 |
Author: | Dex98 [ Thu Jan 12, 2012 7:55 pm ] |
Post subject: | Explosive bullets |
I`m planning on doing a sniper rifle with some explosive bullets. (Part of a weapons pack i have been making) Does anybody know how to make the bullets explode If someone would know a piece of LUA code that could help and would be so kind to post it here, that would help alot! Sincerely: a LUA noob |
Author: | LordVonKain [ Thu Jan 12, 2012 7:59 pm ] |
Post subject: | Re: Explosive bullets |
i suggest you check the Warhammer pack since the bolter's there have explosives rounds although personally i don't see how practical would a sniper with Bolt rounds could be. That said this is cortex command, where practicality isn't used much. |
Author: | Mehman [ Thu Jan 12, 2012 8:04 pm ] |
Post subject: | Re: Explosive bullets |
Attaching this script to an MOPixel will make it explosive: Code: function Create(self) self.Vel = self.Vel.Normalized*math.random(110,114); --adjust velocity here self.Sharpness = 50; end function Update(self) local ray = SceneMan:CastObstacleRay(self.Pos , self.Vel*1.05*TimerMan.DeltaTimeSecs*FrameMan.PPM , Vector() , Vector() , self.ID , 0 , 1); if ray > 0 or self.ToDelete == true then local lr = CreateAEmitter("Bullet Explosive"); lr.Pos = self.Pos+((self.Vel/125)*ray); lr.Vel = Vector(0,0); MovableMan:AddMO(lr); lr:GibThis(); self.ToDelete = true; end end In order to work you must define an AEmitter called "Bullet Explosive"(without quotes) that gibs into the explosion. |
Author: | Dex98 [ Thu Jan 12, 2012 8:16 pm ] |
Post subject: | Re: Explosive bullets |
LordVonKain wrote: i suggest you check the Warhammer pack since the bolter's there have explosives rounds although personally i don't see how practical would a sniper with Bolt rounds could be. That said this is cortex command, where practicality isn't used much. Just testing if making the bullet emit a tiny explosion, would increase the damage without raping terrain. Oh and thanks for the tip. |
Author: | Dex98 [ Thu Jan 12, 2012 9:22 pm ] |
Post subject: | Re: Explosive bullets |
Mehman wrote: In order to work you must define an AEmitter called "Bullet Explosive"(without quotes) that gibs into the explosion. And how do you do that isn`t it annoying when you know everything else about making a mod and then you find out you dont realize a thing that is probably the most simple thing in the world? |
Author: | Mehman [ Thu Jan 12, 2012 9:34 pm ] |
Post subject: | Re: Explosive bullets |
Dex98 wrote: And how do you do that Do you know how to creates things using .ini files?(yes that basic modding stuff) If so then just create the explosion effect(just an emitter that gibs into pixels, glows and other effects, like a small grenade) as you would any other object, if not then read a tutorial or two, it's very simple. |
Author: | Dex98 [ Fri Jan 13, 2012 7:01 am ] |
Post subject: | Re: Explosive bullets |
Mehman wrote: Dex98 wrote: And how do you do that Do you know how to creates things using .ini files?(yes that basic modding stuff) If so then just create the explosion effect(just an emitter that gibs into pixels, glows and other effects, like a small grenade) as you would any other object, if not then read a tutorial or two, it's very simple. Ok thanks. It`s working now Planning on releasing the mod soon... |
Author: | ryry1237 [ Fri Jan 13, 2012 7:35 am ] |
Post subject: | Re: Explosive bullets |
I thought you don't need Lua to make bullets explode and all you had to do was just set the GibImpulseLimit = (any number less than 20) and attach a few AddGib stuff to it. |
Author: | Xery [ Fri Jan 13, 2012 2:32 pm ] |
Post subject: | Re: Explosive bullets |
ryry1237 wrote: I thought you don't need Lua to make bullets explode and all you had to do was just set the GibImpulseLimit = (any number less than 20) and attach a few AddGib stuff to it. MOPixel has no gibs. You can use other kinds of MOs, but they don't have tails like that. Well, in the WWM mod, there's a sniper using one aemitter and one mopixel to acheve it without lua. |
Author: | Gotcha! [ Fri Jan 13, 2012 2:38 pm ] |
Post subject: | Re: Explosive bullets |
What's wrong with an old-fashioned TDExplosive? |
Author: | ryry1237 [ Fri Jan 13, 2012 3:37 pm ] |
Post subject: | Re: Explosive bullets |
Gotcha! wrote: What's wrong with an old-fashioned TDExplosive? You can't make explosives explode from exploding explosives via timer by just altering the .ini files. Although that shouldn't matter for this thread unless Dex98 wants to make a shotgun that shoots exploding bullets that explode based on time. Xery wrote: MOPixel has no gibs. You can use other kinds of MOs, but they don't have tails like that. Well, in the WWM mod, there's a sniper using one aemitter and one mopixel to acheve it without lua. Did he attach the aemitter to the MOPixel or the MOPixel to the aemitter? |
Author: | Gotcha! [ Fri Jan 13, 2012 4:54 pm ] |
Post subject: | Re: Explosive bullets |
@ryry1237: What are you talking about? We're talking about a gun bullet here. Make it a TDExplosive and he has what he wants. |
Author: | Mehman [ Fri Jan 13, 2012 6:41 pm ] |
Post subject: | Re: Explosive bullets |
Gotcha! wrote: We're talking about a gun bullet here. Make it a TDExplosive and he has what he wants. Yes but TDExplosives don't have trails, so I think MOPixels look better for tiny explosives such as bullets, but it's a matter of taste. |
Author: | CaveCricket48 [ Sat Jan 14, 2012 5:22 am ] |
Post subject: | Re: Explosive bullets |
Another way you could use Lua to make exploding bullets is to just check the magnitude of the bullet's velocity, instead of casting rays. It's a lot more efficient if you have a lot of bullets at the same time, and as long as your bullet has zero sharpness, zero bounce, and maximum friction, works pretty well in my experience. |
Author: | Amazigh [ Sat Jan 14, 2012 3:00 pm ] |
Post subject: | Re: Explosive bullets |
The sniper in this mod has exploding bullets with NO Lua at all. It's a slightly old mod, but it should still work in the current build. Might need a couple reference changes but nothing major. Just posting to prove that you don't need to use Lua for everything when simple ini coding will give the same result. |
Page 1 of 2 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |