On Friday 06 October 2006 09:16, Daniel Pekelharing wrote:
> Thanks, but it doesn't seem to work for me?
>
> The console outputs:
>
> Nasal runtime error: nil used in numeric context
>    at /usr/share/FlightGear/Nasal/refuel.nas, line 86
> Failed to execute command nasal
>
> Any idea whats wrong?
> I looked at the script line 86 but nothing seems wrong to my untrained
> eye..
>
> On a side note where can I find some docs on nasal script? It seems an
> interesting way to customize FG..
>
> Thanks!
>
> Daniel Pekelharing

The problem probably stems from the following lines:

capacityTank0 = getprop("/consumables/fuel/tank[0]/capacity-gal_us");
capacityTank1 = getprop("/consumables/fuel/tank[1]/capacity-gal_us");
capacityTank2 = getprop("/consumables/fuel/tank[2]/capacity-gal_us");

I think, if your aircraft only has two tanks, for example, then capacityTank2 
would be set to null (because the 
property "/consumables/fuel/tank[2]/capacity-gal_us" wouldn't exist).  Then 
in the comparesion in the later lines, in particular:

if (newLevelTank2 > capacityTank2)...

would give you that "nil used in numeric context" message.

I could be wrong though.  It has been a while since I last scripted in 
Nasal. :)

Ampere

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-users

Reply via email to