Lua error?
4 posters
Page 1 of 1
Lua error?
I can't load models with Lua half the time. Can anyone help?
smasher497- Plane
- Posts : 26
Join date : 2010-10-16
Location : You'll never know.
Re: Lua error?
Only if you're a little more descriptive
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Lua error?
It will pop up at the top with something like"Lua compile line __ error"
smasher497- Plane
- Posts : 26
Join date : 2010-10-16
Location : You'll never know.
Re: Lua error?
change the windows language settings. your unit for the decimal indicator should be "." instead of ",".
RA2lover- Walker
- Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil
Re: Lua error?
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.
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.
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Lua error?
I feel like an idiot asking this but how do I do that?
smasher497- Plane
- Posts : 26
Join date : 2010-10-16
Location : You'll never know.
Re: Lua error?
- 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.
- 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.
Re: Lua error?
is there a way to do that to all of the numbers in a file
smasher497- Plane
- Posts : 26
Join date : 2010-10-16
Location : You'll never know.
Re: Lua error?
windows language settings do it already.
RA2lover- Walker
- Posts : 382
Join date : 2010-10-11
Age : 29
Location : Brazil
Re: Lua error?
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)
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}
.
smasher497- Plane
- Posts : 26
Join date : 2010-10-16
Location : You'll never know.
Re: Lua error?
That's because you don't have Bwansy's library installed correctly.
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Lua error?
How do I install it correctely then if you would please tell me?
smasher497- Plane
- Posts : 26
Join date : 2010-10-16
Location : You'll never know.
Re: Lua error?
Place the .zip file where all of your models are.
Extract the files.
Done.
Extract the files.
Done.
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: Lua error?
Oh ok thanks
smasher497- Plane
- Posts : 26
Join date : 2010-10-16
Location : You'll never know.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum