Data Realms Fan Forums
http://45.55.195.193/

Bullets Ignore Gun Weilder
http://45.55.195.193/viewtopic.php?f=1&t=25638
Page 1 of 1

Author:  MrC121989 [ Sat Sep 24, 2011 12:12 pm ]
Post subject:  Bullets Ignore Gun Weilder

How to make this gun to not shoot off actors legs and other limbs while jetpacking and other situations when muzzle is positioned on an actor.
Changing Muzzle offset is not an option.
So is there any script i can attach to a bullet?

Attachments:
MrCCorporation.rte.rar [114 KiB]
Downloaded 173 times

Author:  Azukki [ Sat Sep 24, 2011 9:56 pm ]
Post subject:  Re: Bullets Ignore Gun Weilder

Make the bullet (the MOPixel) HitsMOs = 0 and then add this script to it.
Code:
function Create(self)
   self.startvector = self.Pos - self.Vel
   self.endvector = self.Vel / 2
   self.x = MovableMan:GetMOFromID(SceneMan:CastMORay(self.startvector,self.Vel, self.ID, 0, true, 0))
   if self.x then
      self.z = MovableMan:GetMOFromID(self.x.RootID)
      self:SetWhichMOToNotHit(self.z, -1)
      self.Pos = self.Pos - self.Vel / 3
   else
      self.Pos = self.Pos + self.Vel / 3
   end
   self.HitsMOs = true
end


That smokey impact effect is looking nice, by the way.

Author:  MrC121989 [ Sat Sep 24, 2011 11:46 pm ]
Post subject:  Re: Bullets Ignore Gun Weilder

Thx will try this right now, if it'll work i'll make all bullet weapons in my mod with same effect.
Edit:
Tested, it did the trick with self damaging; but theres a small problem.
The MOPixel round is fired after AEmitter round, while they should be fired at the same time.
Must be something with script changing MOpixels velocity or something ?
Heres a screenshot:
Image

Author:  Azukki [ Sun Sep 25, 2011 3:12 am ]
Post subject:  Re: Bullets Ignore Gun Weilder

Oh shoot, I forgot you had that whole thing going on there with the smoke emitter being separate.

you can take out the first Pos modifying line to fix that, [I thought] but then your bullets would go right through enemies without colliding with them at short range

Author:  Asklar [ Sun Sep 25, 2011 4:19 am ]
Post subject:  Re: Bullets Ignore Gun Weilder

Did you use this code in the ini of the gun?
FireIgnoresThis = 1

Author:  MrC121989 [ Sun Sep 25, 2011 6:46 am ]
Post subject:  Re: Bullets Ignore Gun Weilder

@Azukki
Ok i'll try it and see how it goes.

@Asklar
The gun just doesent work that way, but yes i do have it.

Edit: the script appers to not work at all without that line :???:
Maybe a workaround to make a MOPixel somehow emmit smoke on impact ?

Author:  Asklar [ Sun Sep 25, 2011 6:15 pm ]
Post subject:  Re: Bullets Ignore Gun Weilder

A script that checks the speed of the MOPixel, and if it's slower than the firing velocity it deletes it and creates smoke on the function Destroy(self).

But to make it work properly, the MOPixel should have AirResistance = 0 and GlobalAccScalar = 0, so it won't change it's velocity and it will effectively work upon impact.

Author:  Naxete [ Mon Sep 26, 2011 3:25 am ]
Post subject:  Re: Bullets Ignore Gun Weilder

I used this until today, works on to MOPixels, Aemitters and Attachables...
it always worked easy and handy, like a charm.

Thanks to Areku for the script.

Attachments:
LimiterLight.rar [209 Bytes]
Downloaded 180 times

Author:  MrC121989 [ Mon Sep 26, 2011 11:05 am ]
Post subject:  Re: Bullets Ignore Gun Weilder

Tried this script and played with numbers.
The best i could get is bullets starting to hit targets only after 6 or so meters after leaving the barrel.

Meybe i just have to drop this idea.

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