Why does this always happen to me …
The source of the problem was much simpler - after adding the texture to the COMFreqDisplay in Blender, I forgot to re-export to the AC file !
198.48 [ALRT]:nasal Nasal runtime error: undefined symbol: me
198.48 [ALRT]:nasal at /home/user/fgfs-addons/Aircraft/c210-family/Nasal/radios.nas, line 110
198.48 [ALRT]:nasal called from: /home/user/fgdata/Nasal/globals.nas, line 131
var ComNavFreqDisplay = {
new: func(deviceNode) {
var obj = {
parents: [ComNavFreqDisplay],
_canvas: canvas.new({"size": [256, 96], "view": [256, 96]}),
poweredNode: deviceNode.getNode("power-btn"),
selectedMhzNode: deviceNode.getNode("frequencies/selected-mhz"),
};
return obj;
},
init: func() {
me.display = me._canvas.createGroup();
me.display.text = me.display.createChild("text")
.setTranslation(128, 48)
.setAlignment("right-center")
.setFont("DSEG/DSEG7/Classic-MINI/DSEG7ClassicMini-Regular.ttf")
.setFontSize(80)
.setColor(1, 0.7, 0.7);
setlistener(me.poweredNode, me.update);
setlistener(me.selectedMhzNode, me.update);
me._canvas.addPlacement({"node": "COMFreqDisplay"});
me.update();
},
update: func() {
######################################
# Line causing the error #
######################################
if (me.poweredNode.getBoolValue()) {
me.display.text.show();
} else {
me.display.text.hide();
}
me.display.text.setText(me.selectedMhzNode.getDoubleValue());
},
};
deviceNode.getNode("power-btn")
Maerchenprinz wrote in Wed Jan 19, 2022 12:23 pm:EDIT: This post was written while the solution was found by TheEagle...
TheEagle wrote in Wed Jan 19, 2022 12:05 pm:Found out by reading Object Oriented Programming in Nasal on the wiki … all working now.
setlistener("/prop", func me.update());
setlistener("/prop", me.update);
Users browsing this forum: No registered users and 4 guests