Data Realms Fan Forums http://45.55.195.193/ |
|
Various Questions http://45.55.195.193/viewtopic.php?f=1&t=18671 |
Page 1 of 1 |
Author: | Tearagion [ Tue May 04, 2010 10:46 pm ] |
Post subject: | Various Questions |
NOTE BEFORE YOU READ: I plan to ask many more 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! |
Author: | lafe [ Tue May 04, 2010 10:52 pm ] |
Post subject: | 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 |
Author: | CaveCricket48 [ Tue May 04, 2010 11:04 pm ] |
Post subject: | 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 |
Author: | Freeflow [ Wed May 05, 2010 1:18 am ] |
Post subject: | 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. |
Author: | Tearagion [ Wed May 05, 2010 2:02 am ] |
Post subject: | 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? |
Author: | CaveCricket48 [ Thu May 06, 2010 9:34 pm ] |
Post subject: | 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 |
Author: | Tearagion [ Fri Jun 25, 2010 3:16 am ] |
Post subject: | 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. |
Author: | Azukki [ Fri Jun 25, 2010 7:01 am ] |
Post subject: | 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. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |