View unanswered posts | View active topics It is currently Thu Jan 02, 2025 10:36 pm



Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
 Shaped charges / directional gibbing 
Author Message

Joined: Sun Dec 06, 2009 11:54 pm
Posts: 85
Reply with quote
Post Re: Shaped charges / directional gibbing
You're asking what sam did for his Bright Rose mod; he used an obstacle ray that kicked in after 50 frames (As it said in his code). Shook's right about this one, but I THINK that this would be an easier way to do it (If this is infringing on Sam's rights as a modder, someone tell me)

Code:
function Create(self)
   self.burst = CreateAEmitter("*INSERT NAME OF YOU PARTICLE HERE, REPLACE BOTH THIS TEXT AND ASTERIKS*")
   self.hasburst = false
   self.Timer = Timer()
   self.rayhit = Vector(0,0)
   self.raymiss = Vector(0,0)
   self.angle = 0
   self.alpha = 0.25
   self.beta = 5
   vector:Normalize(True)
end

function Destroy(self)
end

function Update(self)
   if self.Timer:IsPastSimMS(50) then
      SceneMan:CastObstacleRay(self.Pos,(self.Vel/self.Vel.Magnitude)*750,self.rayhit,self.raymiss,-1,0,2);
      if ((self.rayhit - self.Pos).Magnitude) < 50 and self.hasburst == false and not self.rayhit:IsZero() then
         self.hasburst = true
         self:GibThis();
      end
   end
   if self.hasburst then
      self.burst.RotAngle = self.Vel.AbsRadAngle
      self.burst.Vel = self.Vel*20;
      self.burst.Pos = self.Pos;
      MovableMan:AddParticle(self.burst);
      self.ToDelete = true
      self:GibThis();
   end
end


I grafted out the part where the emitted MOSRotating (The shells that gibbed before it made contact) would move in a sine wave-like fashion.


Wed Sep 22, 2010 1:39 am
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post Re: Shaped charges / directional gibbing
I made shaped charges in tis mod: viewtopic.php?f=61&t=19433&p=366115#p366115
It is used for the panzershreck HEAT, Bazooka HEAT and Panzerfaust, it uses only ini code.(and 1 line of lua that doesn't serve any purpose and that I forgot to remove)
You are free to use it if you want to, but please credit me.
PM me if you want more information.


Sat Sep 25, 2010 11:58 am
Profile
User avatar

Joined: Thu Jul 08, 2010 10:24 pm
Posts: 185
Location: Big Applesauce
Reply with quote
Post Re: Shaped charges / directional gibbing
The only thing is, I'd like to know how those work. Also, is it possible to adapt those to bullets?


Mon Sep 27, 2010 2:00 am
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post Re: Shaped charges / directional gibbing
Mingebag7 wrote:
The only thing is, I'd like to know how those work. Also, is it possible to adapt those to bullets?


In that case you would need:

_Either a bullet that is an mosrotating with gibs with InheritsVel = 1, the GibImpulseLimit should be very low, but that may not work very well.

_Or a bullet that is an MOSRotating that gibs into an AEmitter with InheritsVel = 1 and has a directional emission and OrientToVel = 0.0, the MOSRotating however should have
OrientToVel = 1.0, also the MOS would need to gib before its center ( spriteoffset) actually hits the target, so that the emitter would have time to act, that can be done either by lua(complicated) or by making the spriteoffset a dozen pixels left from the right end of your sprite, depending on the velocity more or less pixels would be needed,
I did that for my HEAT rocket launchers in this mod: viewtopic.php?f=61&t=19433&p=366115#p366115
It involves absolutely no lua.
You are free to use it if you want to, but please credit me.
PM me if you want more information.

Edit:You could also do it with lua I think.


Mon Sep 27, 2010 12:46 pm
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post Re: Shaped charges / directional gibbing
I've made a tutorial on how to make directional gibbing here:
:arrow: viewtopic.php?f=1&t=19826

I hope it helps you.


Tue Sep 28, 2010 7:02 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page Previous  1, 2

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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.092s | 13 Queries | GZIP : Off ]