Lua error?

View previous topic View next topic Go down

Lua error?

Post by smasher497 on Sat Nov 13, 2010 7:56 pm

I can't load models with Lua half the time. Can anyone help?
avatar
smasher497
Plane
Plane

Posts : 26
Join date : 2010-10-16
Location : You'll never know.

View user profile

Back to top Go down

Re: Lua error?

Post by JHaskly on Sun Nov 14, 2010 12:32 am

Only if you're a little more descriptive Razz

_________________
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: Lua error?

Post by smasher497 on Sun Nov 14, 2010 9:56 am

It will pop up at the top with something like"Lua compile line __ error"
avatar
smasher497
Plane
Plane

Posts : 26
Join date : 2010-10-16
Location : You'll never know.

View user profile

Back to top Go down

Re: Lua error?

Post by RA2lover on Sun Nov 14, 2010 4:06 pm

change the windows language settings. your unit for the decimal indicator should be "." instead of ",".
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: Lua error?

Post by JHaskly on Sun Nov 14, 2010 5:15 pm

If this is indeed the case, there is already a topic on this here.

If this isn't the case, can you give us the exact error for one of the models? Many things could cause a basic compile line error.

_________________
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: Lua error?

Post by smasher497 on Mon Nov 15, 2010 5:02 pm

I feel like an idiot asking this but how do I do that?
avatar
smasher497
Plane
Plane

Posts : 26
Join date : 2010-10-16
Location : You'll never know.

View user profile

Back to top Go down

Re: Lua error?

Post by bwansy on Mon Nov 15, 2010 11:41 pm

- To change your language settings, please click the link JHaskly posted.

- To copy the error message, you have to type the exact message manually, or post a screenshot of the message. You might need to resize the window to see the whole message.

_________________
A.K.A. Bernard

bwansy
Admin

Posts : 170
Join date : 2010-07-15

View user profile http://rigidchips.forum-motion.com

Back to top Go down

Re: Lua error?

Post by smasher497 on Wed Nov 17, 2010 6:50 pm

is there a way to do that to all of the numbers in a file
avatar
smasher497
Plane
Plane

Posts : 26
Join date : 2010-10-16
Location : You'll never know.

View user profile

Back to top Go down

Re: Lua error?

Post by RA2lover on Thu Nov 18, 2010 4:11 am

windows language settings do it already.
avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: Lua error?

Post by smasher497 on Wed Jan 19, 2011 7:02 pm

Normaly I wouldn't bring up an old thread but I still can't load models with Lua here's the error

Lua colmpile errror [sstring 'Demoplane.txt"]:1: could not load package 'Bernard/Bernard.lua' from path '?;?.lua'

here's the model(I named it Demopllane just in case that matters)

Code:
// [RCD]
Val
{
  AILEL(default=0, min=-400, max=400, disp=0)
  AILER(default=0, min=-400, max=400, disp=0)
  ELEVL(default=0, min=-400, max=400, disp=0)
  ELEVR(default=0, min=-400, max=400, disp=0)
  GEARANG1(default=90, min=-400, max=400, disp=0)
  JETPWR(default=0, min=-999999999, max=999999999, disp=0)
  KEYPITCH(default=0, min=-10, max=10, step=2, disp=0)
  KEYROLL(default=0, min=-10, max=10, step=2, disp=0)
  KEYTHR(default=0, max=10, disp=0)
  KEYYAW(default=0, min=-10, max=10, step=2, disp=0)
  RUDDL(default=0, min=-400, max=400, disp=0)
  RUDDR(default=0, min=-400, max=400, disp=0)
  WINGSWEEP(default=10, min=-400, max=400, disp=0)
}
Key
{
  0:KEYPITCH(step=2)
  1:KEYPITCH(step=-2)
  2:KEYROLL(step=2)
  3:KEYROLL(step=-2)
  4:KEYYAW(step=2)
  5:KEYTHR(step=-0.2)
  6:KEYYAW(step=-2)
  8:KEYTHR(step=0.2)
}
Body
{
  Core(name=NOSE) {
      S:Trim(angle=90) { }
      S:Frame() {
        S:Frame() {
            S:Frame(name=TAIL) {
              W:TrimF(angle=ELEVL, option=1) {
                  E:Rudder(angle=140) {
                    E:Chip() { }
                    E:Rudder(angle=-135) { }
                  }
              }
              E:TrimF(angle=ELEVR, option=1) {
                  W:Rudder(angle=-140) {
                    W:Chip() { }
                    W:Rudder(angle=135) { }
                  }
              }
            }
            S:Trim(angle=90) {
              S:Chip(angle=RUDDL) { }
              S:Chip(angle=RUDDR) { }
            }
        }
        W:Rudder(angle=-WINGSWEEP) {
            S:Rudder(angle=100) {
              S:Trim(angle=AILEL) {
                  S:Chip() { }
              }
            }
            W:Chip() {
              W:Chip(name=WINGL) { }
            }
        }
        E:Rudder(angle=WINGSWEEP) {
            S:Rudder(angle=-100) {
              S:Trim(angle=AILER) {
                  S:Chip() { }
              }
            }
            E:Chip() {
              E:Chip(name=WINGR) { }
            }
        }
        S:Frame(angle=30) {
            S:Jet(angle=-120, power=JETPWR) { }
        }
      }
      S:Frame(angle=GEARANG1) { }
  }
}
Lua
{require("Bernard/Bernard.lua")


function init()
  autoflag = 0
  sweepflag = 0
  sweepfactor = 0
  sweep1= 10
  sweep2 = 45
  gearflag = 1
  flapflag = 0
  flap = 0
  spoiler = 0
  mouseflag = 1
  mouseroll,mousepitch = 0,0

  pitchstiff = 11
  pitchdamp = 1.2
  rollstiff = 1
  rolldamp = 1
  yawstiff = 10
  yawdamp = 3
end
function OnInit()
  init()
end
function OnReset()
  init()
end

function inputctrl()
  if mouseflag > 0 then mouseroll,mousepitch = inputmouse(0) end
  mouseroll = mouseroll*10
  mousepitch = mousepitch*10
  inppitch = KEYPITCH+mousepitch*mouseflag
  inproll = KEYROLL+mouseroll*mouseflag
  inpyaw = KEYYAW
end

function getstate()
  v = -_VZ(NOSE)
  alpha = (-(_VY(NOSE)+_VY(TAIL))/2)/v
  beta = ((_VX(NOSE)+_VX(TAIL))/2)/v
  pitchw = (-_VY(NOSE)+_VY(TAIL))/1.8
  rollw = (-_VY(WINGL)+_VY(WINGR))/3.6
  yaww = (_VX(NOSE)-_VX(TAIL))/1.8
end

function driveplane()
  if autoflag > 0 then
      ctrlcorr = limit(v/10,0,1)
      pitchcorr = 1/sqrt((v/100)^2+1)
      rollcorr = 1/sqrt((v/100)^2+1)
      yawcorr = 1/sqrt((v/100)^2+1)
      pitcht = (inppitch*0.4*pitchcorr+(alpha*pitchstiff-pitchw*pitchdamp)*(1-sweepfactor)*ctrlcorr*(1+(v/200)^2))
      rollt = (inproll*1.5-rollw*rolldamp*ctrlcorr)*rollcorr
      yawt = (inpyaw*2+(beta*yawstiff-yaww*yawdamp)*ctrlcorr)*yawcorr
  else
      pitchcorr = 0.05+1/sqrt((v/100)^2+1)
      rollcorr = 0.05+1/sqrt((v/100)^2+1)
      yawcorr = 0.05+1/sqrt((v/100)^2+1)
      pitcht = inppitch*0.4*pitchcorr
      rollt = inproll*1.5*rollcorr
      yawt = inpyaw*2
  end
end

function actuateplane()
  flap = animate(flap,flapflag*10,0.5)
  spoiler = animate(spoiler,30*_KEY(11),2)
  sweepfactor = animate(sweepfactor,sweepflag,0.05)
  WINGSWEEP = sweep1+(sweep2-sweep1)*sweepfactor
  AILEL = animate(AILEL,rollt-flap,5)
  AILER = animate(AILER,rollt+flap,5)
  ELEVL = animate(ELEVL,-pitcht,5)
  ELEVR = animate(ELEVR,pitcht,5)
  RUDDL = animate(RUDDL,-yawt-spoiler,5)
  RUDDR = animate(RUDDR,-yawt+spoiler,5)

  JETPWR = KEYTHR*7000
end

function OnFrame()
  autoflag = switch(autoflag,7)
  flapflag = switch(flapflag,12)
  sweepflag = switch(sweepflag,14)
  mouseflag = switch(mouseflag,15)

  getstate()
  inputctrl()
  driveplane()
  actuateplane()

  gearflag = switch(gearflag,13)
  GEARANG1 = animate(GEARANG1,90*gearflag,3)
  out(0,"Advanced Aircraft Stability Demo by Bernard (bwansy)")
  out(1,"[S/X] Throttle: ",KEYTHR*10," %")
  out(2,"[F]: Flaps [G]: Landing Gears")
  out(3,"[Q]: WIng Sweep [W] Toggle Mouse Control")
  if autoflag > 0 then out(4,"[A] Augmented Stability System: ACTIVE")
  else out(4,"[A] Augmented Stability System: INACTIVE") end
end}
.
avatar
smasher497
Plane
Plane

Posts : 26
Join date : 2010-10-16
Location : You'll never know.

View user profile

Back to top Go down

Re: Lua error?

Post by JHaskly on Wed Jan 19, 2011 7:41 pm

That's because you don't have Bwansy's library installed correctly.

_________________
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: Lua error?

Post by RA2lover on Thu Jan 20, 2011 8:31 am

or don't have Bwansy's Library installed at all.

avatar
RA2lover
Walker
Walker

Posts : 382
Join date : 2010-10-11
Age : 22
Location : Brazil

View user profile

Back to top Go down

Re: Lua error?

Post by smasher497 on Thu Jan 20, 2011 11:23 am

How do I install it correctely then if you would please tell me?
avatar
smasher497
Plane
Plane

Posts : 26
Join date : 2010-10-16
Location : You'll never know.

View user profile

Back to top Go down

Re: Lua error?

Post by JHaskly on Thu Jan 20, 2011 3:00 pm

Place the .zip file where all of your models are.

Extract the files.

Done.

_________________
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: Lua error?

Post by smasher497 on Thu Jan 20, 2011 5:48 pm

Oh ok thanks Surprised
avatar
smasher497
Plane
Plane

Posts : 26
Join date : 2010-10-16
Location : You'll never know.

View user profile

Back to top Go down

Re: Lua error?

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