Board index FlightGear Support

setWeight() - not supported for jsb  Topic is solved

All general support: help on flying, installation, hardware, getting online etc. There are lots of users and developers to help you out.
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- what graphics card do you have?
- does the problem occur with any aircraft, at any airport?
- where did you download your aircraft/scenery from?
- is there any output printed to the console (black window)?
- copy&paste your commandline (tick the "Show commandline box on the last page of FGRun or the "Others" section on the Mac launcher).

Please report any bugs not specific to an aircraft on the issue tracker.
To run FlightGear on old computers with bad OpenGL support, please take a look at this wiki article.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

setWeight() - not supported for jsb

Postby CrazyJeff » Sun Feb 17, 2019 3:36 pm

Does anyone know what causes this error? My system specs are irrelevant as I can reproduce this on any windows 10 computer. I get this with a fighter jet I'm making, and I have ruled out balance/cg position/fuel settings/ground reactions etc.
CrazyJeff
 
Posts: 3
Joined: Sun Feb 17, 2019 3:25 pm

Re: setWeight() - not supported for jsb

Postby Thorsten » Sun Feb 17, 2019 4:01 pm

Probably it's really not supported for JSBSim.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: setWeight() - not supported for jsb

Postby legoboyvdlp » Sun Feb 17, 2019 4:09 pm

What exactly is setWeight? I had a look and didn't see it anywhere.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: setWeight() - not supported for jsb

Postby CrazyJeff » Sun Feb 17, 2019 5:20 pm

Its not a property or value that I assigned. "setWeight() - not supported for jsb" is displayed in the console right under Volcanic activity off. I have never seen this before fg 2018.3.1 and it only happens on one of my jets. Maybe its just some random bug.
CrazyJeff
 
Posts: 3
Joined: Sun Feb 17, 2019 3:25 pm

Re: setWeight() - not supported for jsb

Postby legoboyvdlp » Sun Feb 17, 2019 7:19 pm

I have seen it as well, and am somewhat interested what on earth it is... I certainly don't see any setWeight() elements anywhere in nasal or XML.
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: setWeight() - not supported for jsb

Postby wkitty42 » Sun Feb 17, 2019 9:30 pm

"use the source, luke. use the source." ;)

Code: Select all
myuser@mymachine:~/flightgear-dev/next/fgdata$ egrep -HinR -e "setweight\(\)" *
Nasal/gui.nas:761:        print("setWeight() - not supported for ",fdm);


Code: Select all
# Checks the /sim/weight[n]/{selected|opt} values and sets the
# appropriate weights therefrom.
var setWeightOpts = func {
    var tankchange = 0;
    var root_node = nil;
    if(fdm == "yasim")
      root_node = props.globals.getNode("sim");
    elsif (fdm == "jsb")
      root_node = props.globals.getNode("payload");
    if (root_node == nil) {
        print("setWeight() - not supported for ",fdm);
        tankchange = nil;
    }
    else {
        foreach (var w; root_node.getChildren("weight")) {
            var selected = w.getNode("selected");
            if (selected != nil) {
                foreach (var opt; w.getChildren("opt")) {
                    if (opt.getNode("name", 1).getValue() == selected.getValue()) {
                        if (setWeight(w, opt)) {
                            tankchange = 1;
                        }
                        break;
                    }
                }
            }
        }
    }
    return tankchange;
}
# Run it at startup and on reset to make sure the tank settings are correct
_setlistener("/sim/signals/fdm-initialized", func { settimer(setWeightOpts, 0) });
_setlistener("/sim/signals/reinit", func(n) { props._getValue(n, []) or setWeightOpts() });


so basically, some craft are apparently not setting the properties for the various weights used in the calculations for the craft...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: setWeight() - not supported for jsb

Postby CrazyJeff » Sun Feb 17, 2019 10:52 pm

Yes, use the source. Love that :) Anyway, thanks for your help. It looks like we're required to have pointmass's now. So I added one, and tied it to a payload section in my set file. I used the c172p as an example. No more errors :)
CrazyJeff
 
Posts: 3
Joined: Sun Feb 17, 2019 3:25 pm

Re: setWeight() - not supported for jsb  

Postby wkitty42 » Mon Feb 18, 2019 12:55 am

you're welcome!

there should be a button on the top right of my message that you can click to select it as the solution to your problem... if you will click it, it will remove this post from the "unsolved" list ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04


Return to Support

Who is online

Users browsing this forum: No registered users and 4 guests