Can someone help me to write this code to start and stop the engine:
I am using multiple engines, and I need the XML to control certain engine as follow. I will credit for this. Thanks so much.
The Engine will start at IAS>150 mph AND will shut down IF the throttle is less than 25%
Funky Tree Notes for me
and future reference for everyone
Funkey Tree (functions)
https://www.simpleplanes.com/Forums/View/1042680/Funky-Trees
Funky Trees Quick Tutorial Linear Interpolation
https://www.simpleplanes.com/Videos/View/1818461/Funky-Trees-Quick-Tutorial-Linear-Interpolation
@MrCOPTY @QuesoAirlines @GuyFolk
I was looking for some Boolean Operators, and the Selection Operator, used in Funky Tree. Now I found them. Since I am clear with my concept, but getting stuck due to syntax error. Anyway, thank you all for helping me out. And I will definitely need your help in the future too. You guys are amazing.
@MrCOPTY yes, I noticed in your builds that you separate out by declearing the variable names.
@MrCOPTY Thanks so much, I will let you know,
@WinsWings Issues? Tell Me, May I Can Help
@MrCOPTY Nice!!!! I was using the FT cheatsheet the same link you posted. But still, there are some issues, thanks anyway
@WinsWings Feel Free To Ask Any Code, I'll Try My Best To Do, Or Join My Discord Server, We Have FT Class Room (And Fuselage Filling Class Room Too)
@WinsWings Those Are The Function Used In FT, Now Try To Use To Create Simple Codes
Funky Trees
@WinsWings In Fact This Is FT Not XML, XML Are Language That Used By Game To Generate Parts, FT In Language That Used By Parts As Input
@WinsWings You Can Add Or Don't Add Spaces, Personally I Prefer Add, This Help To Organise FT, And Suggest Using Variables, So You Can Modify Codes Easily (If You Have Code For Lot Of Parts, Replace The Code Whit A Specific Name, Open Variable Setter Then Use That Name As Name For Variable, And Put Your Code In Variable Body, Now You Can Modify The Code For All Part Easily)
@MrCOPTY @GuyFolk @QuesoAirlines
Can you recommend me any reference for writing such XML lines? since I knew the concept but had difficulty with XML's syntax /writing style. I have some math and programming knowledge from a few years back - Thanks a lot!
.
For example, adding or not adding spaces:
(IAS > 67.05) ? ((Throttle > 0.25) ? Throttle : 0) : 0
--- OR ---
(IAS>67.05) ? ((Throttle>0.25) ? Throttle : 0) : 0
Thanks so much to @QuesoAirlines for making this explanation video https://www.simpleplanes.com/Videos/View/1818461/Funky-Trees-Quick-Tutorial-Linear-Interpolation
@GuyFolk Thank you. really appreciate that
@WinsWings
I mean the number in the code have to be in meter per second.
So it'll be 67.05.
Because 67.05 m/s = 150 mph.
@QuesoAirlines that will be great. Please tag me when you post.
I just realized that there's a big difference between my code and GuyFolk's. I'm just gonna make a short video explaining the difference and how each can be used.
@QuesoAirlines thanks
(IAS > 67.05) ? ((Throttle > 0.25) ? Throttle : 0) : 0
@WinsWing
Correct me if I’m wrong, but woun’t that be only full or no power, atleast if you put the in “input”? Also, isn’t IAS in M/S in funky trees?
@GuyFolk So did you mean, it has to be in Kilometer per hour? 150mph = approx 240 kph?
so did you mean
- clamp01(IAS>240&Throttle>=0.25)
OR
- clamp01(IAS>240&Throttle>=0.25)*inverselerp(0.25,1,Throttle)
@WinsWings
Sorry I didn't noticed that the IAS is in mph.
Completely forgot to convert the number lol.
I was sleepy while making the code for you.
@WinsWings Yeah, Thx, Everything Is Fine, I'm Just Annoyed Cuz My 100th Taking A Lot Time (Still WIP), And I Don't Publish For Month Or Smth, I Just Post That Waffle To Keep Posting.
@MrCOPTY Thanks buddy, hope everything fine with you
IAS>67 & Throttle>=0.25 ? 1 : 0
I Convert Value Of Speed
@GuyFolk Thank you so much, I will tag you one I did
@WinsWings
Super easy.
clamp01(IAS>150&Throttle>=0.25)
Or you can try alternative version.
clamp01(IAS>150&Throttle>=0.25)*inverselerp(0.25,1,Throttle)
Try both and see if any of them fit.