Fire Fly

View previous topic View next topic Go down

Fire Fly

Post by DanielLC on Sat Nov 20, 2010 5:31 pm

So named because it's small, it flies, and it's capable of insane weapons fire. Or at least, it will be when I add weapons.

It seems to spin out of control for some reason. It's currently capped at 30 m/s, less than a third of that of my jet car. I'm not sure what the jet car's acceleration is, but I'm sure it's more than the 15 m/s^2 this thing has. Despite that, it tends to spin like crazy and brake apart.

I have a prototype gatling gun designed to cycle through dozens of guns. The main problem is it has a ton of recoil. The Fire Fly is built to be able to quickly rotate and accelerate, so it could deal with the recoil between shots.

This requires my jetcalc library.

Code:
Val
{
  JN(default=0,min=-100000000,max=100000000)
  JS(default=0,min=-100000000,max=100000000)
  JE(default=0,min=-100000000,max=100000000)
  JW(default=0,min=-100000000,max=100000000)
  JU(default=0,min=-100000000,max=100000000)
  JD(default=0,min=-100000000,max=100000000)
  COGX(default=0,min=-1000000,max=1000000)
  COGY(default=0,min=-1000000,max=1000000)
  COGZ(default=0,min=-1000000,max=1000000)
  QX(default=0,min=-1,max=1)
  QY(default=0,min=-1,max=1)
  QZ(default=0,min=-1,max=1)
  QW(default=0,min=-1,max=1)
  WY(default=0,min=-1000000,max=1000000)
  DWY(default=0,min=-1000000,max=1000000)
  DX(default-0,min=-20,max=20,step=0.5)
  DY(default-0,min=-20,max=20,step=0.5)
  DZ(default-0,min=-20,max=20,step=0.5)
}
Key
{
  0:DZ(step=-0.5)
  1:DZ(step=0.5)
  2:DX(step=0.5)
  3:DX(step=-0.5)
  4:DY(step=-0.5)
  5:DY(step=0.5)
}
Body {
  Core(){
    N:Jet(angle=180,name=JNI,power=JN){}
    S:Jet(name=JSI,power=JS){
    }
    S:TrimF(angle=90){
      N:Jet(angle=90,name=JEI,power=JE){
        S:TrimF(angle=90){
          N:Jet(angle=90,name=JUI,power=JU){}
          N:Jet(angle=-90,name=JDI,power=JD){}
        }
      }
      N:Jet(angle=-90,name=JWI,power=JW){}
    }
  }
}
Lua
{
require("DanielLC/jetcalc.lua")

function sqr(x)
  return x*x
end
function mod(theta)
  if theta >= 2*math.pi then
    theta = theta-2*math.pi
  end
  return theta
end
function main()
  cog=center()
  local dcog=vadd(cog,{-COGX,-COGY,-COGZ},3)
  COGX=cog[1]
  COGY=cog[2]
  COGZ=cog[3]
  local dq=qmult({_QX(),_QY(),_QZ(),_QW()},qinv({QX,QY,QZ,QW}))
  QX=_QX()
  QY=_QY()
  QZ=_QZ()
  QW=_QW()
  local dqinv = qinv(dq)
  local spin = q2vector(dqinv)
  Ji={JNI,JSI,JEI,JWI,JUI,JDI}
  Jo={-dcog[1]*900,9.81-dcog[2]*900,-dcog[3]*900,-dqinv[1]*210000,-dqinv[2]*210000,-dqinv[3]*210000}
  Jo=vadd(Jo,{DX*900,DY*900,DZ*900,0,0,0},6)
  Jo=jetcalc2(Ji,Jo)
  if _TICKS()>=2 then
  JN=Jo[1]
  JS=Jo[2]
  JE=Jo[3]
  JW=Jo[4]
  JU=Jo[5]
  JD=Jo[6]
  end
end
}

DanielLC
Tank
Tank

Posts : 78
Join date : 2010-10-23

View user profile

Back to top Go down

Re: Fire Fly

Post by JHaskly on Sat Nov 20, 2010 7:06 pm

How about adding a recoil jet?

I seem to be missing the "q2vector" function, is it in an updated version of your library that isn't on the forum?

_________________
Previously (and currently) known as Juz.

Please do not write "LUA", beause it's "Lua". It's Moon in Portuguese, not a Limited User Account, Last Universal Ancestor, or the Lukla Airport in Nepal.

JHaskly
Admin

Posts : 235
Join date : 2010-07-16
Age : 21
Location : Brisbane

View user profile

Back to top Go down

Re: Fire Fly

Post by DanielLC on Fri Nov 26, 2010 8:19 pm

Yeah. I totally forgot about that. I'll go update it, along with Hand.

I did tests involving recoil jets. I think a portion of the recoil is random, so my model went flying even with it. Admittedly, that was just a gun and jet with the highest power the gun could have without exploding, so it would would normally be somewhat less.

DanielLC
Tank
Tank

Posts : 78
Join date : 2010-10-23

View user profile

Back to top Go down

Re: Fire Fly

Post by JHaskly on Sat Nov 27, 2010 4:46 am

Recoil jets work best at lower powers, because of vibration. Generally, powers over 1m become too unreliable for a basic turret.

_________________
Previously (and currently) known as Juz.

Please do not write "LUA", beause it's "Lua". It's Moon in Portuguese, not a Limited User Account, Last Universal Ancestor, or the Lukla Airport in Nepal.

JHaskly
Admin

Posts : 235
Join date : 2010-07-16
Age : 21
Location : Brisbane

View user profile

Back to top Go down

Re: Fire Fly

Post by DanielLC on Sat Nov 27, 2010 10:18 am

I know some people would look at that and read "Lower your power", but I read "Your turret is too basic".

And that's why I'm building this advanced turret.

DanielLC
Tank
Tank

Posts : 78
Join date : 2010-10-23

View user profile

Back to top Go down

Re: Fire Fly

Post by JHaskly on Sat Nov 27, 2010 4:58 pm

Haha. If you had multiple jets acting as one, that might average out the vibration a bit.

_________________
Previously (and currently) known as Juz.

Please do not write "LUA", beause it's "Lua". It's Moon in Portuguese, not a Limited User Account, Last Universal Ancestor, or the Lukla Airport in Nepal.

JHaskly
Admin

Posts : 235
Join date : 2010-07-16
Age : 21
Location : Brisbane

View user profile

Back to top Go down

Re: Fire Fly

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum