View unanswered posts | View active topics It is currently Sat Dec 28, 2024 4:18 pm



Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
 Explosive bullets 
Author Message
User avatar

Joined: Thu Jan 05, 2012 8:18 am
Posts: 76
Location: In a Sauna, roasting to death
Reply with quote
Post 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


Thu Jan 12, 2012 7:55 pm
Profile
User avatar

Joined: Sat Oct 22, 2011 4:49 am
Posts: 826
Location: England
Reply with quote
Post 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.


Thu Jan 12, 2012 7:59 pm
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post 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.


Thu Jan 12, 2012 8:04 pm
Profile
User avatar

Joined: Thu Jan 05, 2012 8:18 am
Posts: 76
Location: In a Sauna, roasting to death
Reply with quote
Post 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.


Thu Jan 12, 2012 8:16 pm
Profile
User avatar

Joined: Thu Jan 05, 2012 8:18 am
Posts: 76
Location: In a Sauna, roasting to death
Reply with quote
Post 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?


Thu Jan 12, 2012 9:22 pm
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post 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.


Thu Jan 12, 2012 9:34 pm
Profile
User avatar

Joined: Thu Jan 05, 2012 8:18 am
Posts: 76
Location: In a Sauna, roasting to death
Reply with quote
Post 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...


Fri Jan 13, 2012 7:01 am
Profile
User avatar

Joined: Sun Dec 25, 2011 7:23 am
Posts: 269
Reply with quote
Post 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.


Fri Jan 13, 2012 7:35 am
Profile
User avatar

Joined: Sat Feb 26, 2011 10:29 am
Posts: 163
Reply with quote
Post 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.


Fri Jan 13, 2012 2:32 pm
Profile
User avatar

Joined: Tue Apr 01, 2008 4:49 pm
Posts: 1972
Location: The Netherlands
Reply with quote
Post Re: Explosive bullets
What's wrong with an old-fashioned TDExplosive? :???:


Fri Jan 13, 2012 2:38 pm
Profile
User avatar

Joined: Sun Dec 25, 2011 7:23 am
Posts: 269
Reply with quote
Post 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?


Fri Jan 13, 2012 3:37 pm
Profile
User avatar

Joined: Tue Apr 01, 2008 4:49 pm
Posts: 1972
Location: The Netherlands
Reply with quote
Post 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.


Fri Jan 13, 2012 4:54 pm
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post 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.


Fri Jan 13, 2012 6:41 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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.


Sat Jan 14, 2012 5:22 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Sun Feb 24, 2008 2:10 am
Posts: 1531
Location: Ye Olde England
Reply with quote
Post 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.


Sat Jan 14, 2012 3:00 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page 1, 2  Next

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