where to learn

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
GHILL
Posts: 19
Joined: Wed Apr 13, 2022 9:46 pm

where to learn

#1 Post by GHILL »

hi

where is the best place to learn the script of AM. ive tried the videos, the wiki pages been through the forums. Would be nice to be able to see some scripts complete so i can understand the layout etc.

as a complete beginner im completely lost and just want to learn so i can use this software to its max one day. im at the bottom of an extremely steep learning curve but willing to read and try. just need a leg up on where to start. Ive managed to get lights and encoders connected but when it comes to the finding reference IE bus look up index i have no clue.


A bit of advice or a link to a place i can read and see script will be fine. at `the moment im at a closed door and cant see a way past

thanks

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: where to learn

#2 Post by Ralph »

You can download and see scripts of hardware functions in the Create Edit tab. But there's also a very good tutorial from Tony on our YouTube channel.

GHILL
Posts: 19
Joined: Wed Apr 13, 2022 9:46 pm

Re: where to learn

#3 Post by GHILL »

im at a loss, ive watched videos, read the scripts in create/edit section. unless you know what it all means its just gibberish. ive been trying to learn this for nearly 2 weeks and cant find anything that i find useful enough to gain any speed. in the sense that i know how to add hardware and assign them to the arduino, but the code is just another language to me i just cant seem to grasp. feeling like i just wasted money and time on something ill never use.

im aware that people start from nothing and work up but i cant seem to understand or find any info that i can grasp to gain any momentum.

cheers for your reply

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: where to learn

#4 Post by JackZ »

Relax, the forum is here to help.

First things first, do you really NEED to program your own gauges?
The store is ripe with +1000 gauges already, so...

What are trying to do with Air Manager?
Could you be more specific?

if you want to create a very complex gauge without any programming knowledge whatsoever, granted the learning curve will be steep. But is this really your goal?
The "gibberish" code is a programming language: Lua.

Maybe you should try and find a Lua tutorial for beginners in that case
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

GHILL
Posts: 19
Joined: Wed Apr 13, 2022 9:46 pm

Re: where to learn

#5 Post by GHILL »

That's the thing I'm not trying to create a gauge from scratch.
All I'm trying to do at this stage is to create a warning panel with leds.

I followed the online example and got the oil pressure lights to work but now I'm trying to program a light to come on for the alternators off but by using the amps not the switch state.

If Electrical_bus_main_amps[2] <24 then
Hw_set_led(led_alt, 1)
Else
Hw_set_led(led_alt, 0)
End

The issue I'm having is getting the rest of the information after this.( I've not added the add led part).


When I go to the variables it says I need to reference to a bus look up index and reference the alternator on which to get the data.

This is where I become unstuck.

I want to use the amps rather than switch position Incas of generator fault the light will come on when the amp drop.


Thanks Alex


Ps it's midnight where I am so might not reply until tomorro.

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: where to learn

#6 Post by Sling »

Hi,

This is often the way it goes unfortunately. From what you have said so far and your story is evolving with every post BTW, you are probably trying to run before you can walk so to speak. All of the advice you have been given to date is perfectly valid and indeed the places to start. Giving more specific information about what you are looking to achieve and with what hardware and sim is a good start when seeking help. The more information you give the easier it is for someone to help. Even though you didn’t say it seems you are trying to interface to MSFS. This in itself takes some understanding of the messy MS SDK and at a minimum the MS simvar system. Your query is really about understanding how to extract the necessary information from MSFS which in its simplest form can be really easy but trust me when I say that for some things it takes some experience to achieve. If you can provide more information and ask specific questions then someone will be sure to have the answer you seek.

Tony

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: where to learn

#7 Post by JackZ »

Well…
So much for a “gibberish code”, it appears that you have started your own… :evil:

Next time you are seeking help, instead of ranting aimlessly, please be more specific in your questions and give more details, including the sim platform and add on/plane you are using, and publish the complete code you are working on, instead of an excerpt (using the </> button in the rotor for formatting), since it appears you passed at least the first stage…

Welcome to the club.
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

GHILL
Posts: 19
Joined: Wed Apr 13, 2022 9:46 pm

Re: where to learn

#8 Post by GHILL »

When I said gibberish it wasn't a dig at anything? I was just meaning if you don't understand what it means you don't understand it. Like Chinese if you don't speak it....

I do feel this forum is a very un approachable place to ask for advise, that why I leave it till the very last thing before approaching folk on here. I've read a few post where people are getting slammed for 'not knowing'.

If you don't know something you just don't know.

It wasn't an aimless rant also. I've spent weeks trying to find the answer. I can't add the script I'm working on because I can't write. All I can do is ask for help on what I'm doing.

I did that on a previous post and got ignored,

Sorry for being a little bitter but I don't find this software user friendly unless you just want to use the generic gauges and no coding for anything else.

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: where to learn

#9 Post by Ralph »

You can just add things like an oil pressure warning light as a hardware function, you don't have to do any coding, just assign the pins. Unless you really want to learn how it works?

GHILL
Posts: 19
Joined: Wed Apr 13, 2022 9:46 pm

Re: where to learn

#10 Post by GHILL »

Thanks Tony for the reply.


I thought adding an led was the best place to start regarding being a beginner lol.

I'm using msfs2020 and yes I'm trying to extract the data from the SIM to activate the led using limits IE voltage/amps rather than switch states.

I followed the online example and managed to get the oil pressure lights to work. Even added and extra code so I have leds for both engines. (Thought I'd pass the first hurdle)

Then using some of that code, but changing the name of the LEDs, but using the same arguments. if oil pressure below set amount put light on. I tried to write it for if the amps below then a light comes on. But I'm not able to grab the data for the amps from the SIM withought nil index warnings or Syntex errors.


I even copied and pasted from a gauge to try and use the path that uses to draw the gauge needle.

Hope this explains my situation a little better.

Alex

Post Reply