Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // [RCD]
- Val
- {
- PITCHFORCE(default=0, min=-1000000, max=1000000)
- ROLLFORCE(default=0, min=-1000000, max=1000000)
- ROLLJETL(default=0, min=-1000000, max=1000000)
- ROLLJETR(default=0, min=-1000000, max=1000000)
- SIDEFORCE(default=0, min=-1000000, max=1000000)
- SPEED(default=0, min=-50, max=135)
- THRUSTERJETF(default=0, min=-1000000, max=1000000)
- THRUSTERJETR(default=0, min=-1000000, max=1000000)
- UPFORCE(default=0, min=-1000000, max=1000000)
- YAWFORCE(default=0, min=-1000000, max=1000000)
- YAWJETF(default=0, min=-1000000, max=1000000)
- YAWJETR(default=0, min=-1000000, max=1000000)
- }
- Key
- {
- }
- Body
- {
- Core(name=CORE) {
- S:Chip() {
- S:Frame(angle=150) {
- S:Weight(angle=-150) {
- S:Jet(angle=-90, power=THRUSTJETF) { }
- S:Weight() {
- S:Weight() {
- E:Cowl(angle=-30, option=4) { }
- W:Cowl(angle=-30, option=3) { }
- }
- }
- S:Weight(angle=-90) {
- S:Weight(angle=90) {
- S:Weight() {
- E:Cowl(angle=30, option=4) { }
- W:Cowl(angle=30, option=3) { }
- S:Jet(angle=90, power=0, option=2) { }
- S:Jet(angle=90, power=-THRUSTJETR) { }
- }
- }
- S:Weight(angle=-90) { }
- }
- }
- }
- S:TrimF(angle=90) {
- S:Jet(power=YAWJET2) { }
- S:Jet(angle=180, power=-YAWJETF) { }
- }
- S:Jet(power=PITCHJETF) {
- S:Jet(power=PITCHJETR) { }
- W:Jet(power=ROLLJETL) {
- S:Cowl(option=4) { }
- S:Weight(angle=-30) {
- W:Cowl(angle=89, option=3) { }
- }
- S:Weight(angle=30) {
- W:Cowl(angle=-89, option=3) { }
- }
- }
- E:Jet(power=ROLLJETR) {
- S:Cowl(option=3) { }
- S:Weight(angle=-30) {
- E:Cowl(angle=89, option=4) { }
- }
- S:Weight(angle=30) {
- E:Cowl(angle=-89, option=4) { }
- }
- }
- S:Arm(power=999999999, option=-999999999) { }
- }
- }
- }
- }
- Lua
- {inertial = false
- --pardon my function laziness mayhem
- function increasespeed(step)
- SPEED=SPEED+step
- end
- function decreasespeed(step)
- SPEED=SPEED-step
- end
- function increaseyaw(step)
- YAWFORCE=YAWFORCE+step
- end
- function decreaseyaw(step)
- YAWFORCE=YAWFORCE-step
- end
- function increasepitch(step)
- PITCHFORCE=PITCHFORCE+step
- end
- function decreasepitch(step)
- PITCHFORCE=PITCHFORCE-step
- end
- function increaseroll(step)
- ROLLFORCE=ROLLFORCE+step
- end
- function decreaseroll(step)
- ROLLFORCE=ROLLFORCE-step
- end
- function increaseupforce(step)
- UPFORCE=UPFORCE+step
- end
- function decreaseupforce(step)
- UPFORCE=UPFORCE-step
- end
- function increasesideforce(step)
- SIDEFORCE=SIDEFORCE+step
- end
- function decreasesideforce(step)
- SIDEFORCE=SIDEFORCE-step
- end
- local imuchip=CORE--chip used for acceleration measurement
- local accs={0,0,0,0,0,0} --accx,y,z; aaccx,y,z
- local oldv={0,0,0,0,0,0} --last frame's velocities
- function calculateaccelerationframe()
- local c=imuchip
- accs={_VX(c)-oldv[1],_VY(c)-oldv[2],_VZ(c)-oldv[3],_WX(c)-oldv[4],_WY(c)-oldv[5],_WZ(c)-oldv[6]}
- oldv={_VX(c),_VY(c),_VZ(c),_WX(c),_WY(c),_WZ(c)}
- end
- function calculatejets()
- THRUSTJETF=(SPEED-_VZ()*speedp)-(accs[3]*speedd)
- THRUSTJETR=THRUSTJETF
- PITCHJETF=UPFORCE+PITCHFORCE
- PITCHJETR=UPFORCE-PITCHFORCE
- YAWJETF=SIDEFORCE+YAWFORCE
- YAWJETR=SIDEFORCE-YAWFORCE
- ROLLJETL=ROLLFORCE
- ROLLJETR=ROLLFORCE
- end
- --controls
- speedp=10000
- speedd=10000
- key={}
- key[15]={increaseupforce, 30000}
- key[8]={decreaseupforce, 30000}
- key[7]={increasesideforce,30000}
- key[9]={decreasesideforce,30000}
- key[10]={decreasespeed,3}
- key[12]={increasespeed,1}
- function main()
- calculateaccelerationframe()
- calculatejets()
- for k,v in ipairs(key) do
- if _KEY(key[k])>0 then v[1](v[2]) end
- end
- _ZOOM(90)
- end}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement