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



Reply to topic  [ 9 posts ] 
 Bullets Ignore Gun Weilder 
Author Message
User avatar

Joined: Wed Feb 10, 2010 12:41 pm
Posts: 182
Location: OMG where am i ?
Reply with quote
Post 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
Sat Sep 24, 2011 12:12 pm
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post 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
Profile
User avatar

Joined: Wed Feb 10, 2010 12:41 pm
Posts: 182
Location: OMG where am i ?
Reply with quote
Post 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


Sat Sep 24, 2011 11:46 pm
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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
Profile
User avatar

Joined: Wed Feb 10, 2010 12:41 pm
Posts: 182
Location: OMG where am i ?
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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
Profile
User avatar

Joined: Fri Apr 30, 2010 2:12 pm
Posts: 560
Reply with quote
Post 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
Mon Sep 26, 2011 3:25 am
Profile
User avatar

Joined: Wed Feb 10, 2010 12:41 pm
Posts: 182
Location: OMG where am i ?
Reply with quote
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: Google [Bot]


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.282s | 15 Queries | GZIP : Off ]