Author |
Message |
MrC121989
Joined: Wed Feb 10, 2010 12:41 pm Posts: 182 Location: OMG where am i ?
|
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?
|
Sat Sep 24, 2011 12:12 pm |
|
|
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
|
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.
|
Sat Sep 24, 2011 9:56 pm |
|
|
MrC121989
Joined: Wed Feb 10, 2010 12:41 pm Posts: 182 Location: OMG where am i ?
|
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:
|
Sat Sep 24, 2011 11:46 pm |
|
|
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
|
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
Last edited by Azukki on Mon Sep 26, 2011 5:04 am, edited 1 time in total.
|
Sun Sep 25, 2011 3:12 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Bullets Ignore Gun Weilder
Did you use this code in the ini of the gun? FireIgnoresThis = 1
|
Sun Sep 25, 2011 4:19 am |
|
|
MrC121989
Joined: Wed Feb 10, 2010 12:41 pm Posts: 182 Location: OMG where am i ?
|
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 ?
|
Sun Sep 25, 2011 6:46 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
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.
|
Sun Sep 25, 2011 6:15 pm |
|
|
Naxete
Joined: Fri Apr 30, 2010 2:12 pm Posts: 560
|
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.
|
Mon Sep 26, 2011 3:25 am |
|
|
MrC121989
Joined: Wed Feb 10, 2010 12:41 pm Posts: 182 Location: OMG where am i ?
|
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.
|
Mon Sep 26, 2011 11:05 am |
|
|
|