|
Page 1 of 1
|
[ 8 posts ] |
|
Author |
Message |
Tearagion
Joined: Mon Jan 11, 2010 12:41 am Posts: 78
|
Various Questions
NOTE BEFORE YOU READ: I plan to ask many more weapon questions in this thread, so don't harass me about have one right now.
Is there a way to have the power of this gun without the terrain destruction? (please note I want to keep the velocity the way it is, and I know, it is basically a vanilla M-16 resprite)
Solved!
Can you have a sort of trench coat on and actor (i.e. a skirt)? Could this be solved with a simple attachable?
Thanks in advance!
Last edited by Tearagion on Thu Jun 17, 2010 2:07 am, edited 2 times in total.
|
Tue May 04, 2010 10:46 pm |
|
|
lafe
Joined: Sat Mar 28, 2009 2:33 pm Posts: 718
|
Re: Weapon issues...
Tearagion wrote: NOTE BEFORE YOU READ: I plan to ask many more weapon questions in this thread, so don't harass me about have one right now.
Is there a way to have the power of this gun without the terrain destruction? (please note I want to keep the velocity the way it is, and I know, it is basically a vanilla M-16 resprite)
Thanks in advance! simple lua. Code: function Create(self) if self:GetAltitude(0,2) < 1 then self.LifeTime = 2 end end put that in a lua file and atach it to your bullet. highly untested
|
Tue May 04, 2010 10:52 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Weapon issues...
lafe, your script won't completely work, because if the bullets are above terrain without touching it, they'll be deleted. And they won't be deleted if they're shot straight up. And the altutude check is the Create() function, meaning it'll only work on the frame after the bullet is spawned. My take: Code: function Create(self) self.raylength = 10; -- Change this number to the length of the terrain detecting ray. self.terrcheck = Vector(0,0); end
function Update(self) if SceneMan:CastStrengthRay(self.Pos,Vector(self.Vel.X,self.Vel.Y):SetMagnitude(self.raylength),0,self.terrcheck,0,0,true) then self.ToDelete = true; end end
|
Tue May 04, 2010 11:04 pm |
|
|
Freeflow
Joined: Sun Oct 25, 2009 10:16 pm Posts: 110 Location: Western U.S.
|
Re: Weapon issues...
I am not versed in the arts of lua but I know that the mass of the bullet and the sharpness correlate to the amount of terrain destroyed. Tweaking those values will render different properties of your round if you don't wish to grapple with lua.
|
Wed May 05, 2010 1:18 am |
|
|
Tearagion
Joined: Mon Jan 11, 2010 12:41 am Posts: 78
|
Re: Weapon issues...
CaveCricket48 wrote: lafe, your script won't completely work, because if the bullets are above terrain without touching it, they'll be deleted. And they won't be deleted if they're shot straight up. And the altutude check is the Create() function, meaning it'll only work on the frame after the bullet is spawned. My take: Code: function Create(self) self.raylength = 10; -- Change this number to the length of the terrain detecting ray. self.terrcheck = Vector(0,0); end
function Update(self) if SceneMan:CastStrengthRay(self.Pos,Vector(self.Vel.X,self.Vel.Y):SetMagnitude(self.raylength),0,self.terrcheck,0,0,true) then self.ToDelete = true; end end I would be very happy to use this, with your permission, but how would you hook it up to the weapon's code?
|
Wed May 05, 2010 2:02 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Weapon issues...
First, copy the script and paste it into a text file, and save it as (.lua). Next, in the object's coding, add Code: [tab]ScriptPath = MyMod.rte/thescript.lua
|
Thu May 06, 2010 9:34 pm |
|
|
Tearagion
Joined: Mon Jan 11, 2010 12:41 am Posts: 78
|
Re: Various Questions
Brought back due to new question.
Also, where would you put the ScriptPath in the ini so that it does it's job (still on first)? I have tried to figure it out and have found no refuge in the wiki.
EDIT: New question in OP.
Last edited by Tearagion on Fri Jun 25, 2010 1:15 pm, edited 1 time in total.
|
Fri Jun 25, 2010 3:16 am |
|
|
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
|
Re: Various Questions
Find the line where you named your object you want to apply the script to. (PresetName = Whatever) Put the ScriptPath line just below that line, with the same amount of tabbing as that line. It's not the prettiest place for it, but it works and it's simple for me to instruct you to do.
Note: applying scripts to rounds doesn't work, they have to be applied to the round's "Particle". Which is often defined within the round, especially for MOPixel particles. (including standard bullets) Still though, below the PresetName line, same tabbing as it.
|
Fri Jun 25, 2010 7:01 am |
|
|
|
|
Page 1 of 1
|
[ 8 posts ] |
|
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
|
|