Spooky coincidence, but my boot SSD went poof this morning as well. Luckily 99% of my data is backed up, but I lost 1 month worth of work on the SWL-120's mod. It's nothing critical, although it's a setback. I also am down to one laptop while I wait to get a new SSD as well.
@SARACONIKaviationIndustry Hello, I am happy to share it with you, although it relies on several aircraft variables which in turn use other variables. What I can do is give you the raw label code and some of the essential variables; hopefully you can understand how it works with that. It will likely be a while before I can send it to you; I have some irl stuff to do.
Update, just looked at my code and in the earlier example I sent, I define variables and then set different ones. This new comment fixes that. I also made all the characters show up correctly (for example this:
"<"
doesn't turn into this: "<"
)
Right after the behavior class start:
Jundroo.SimplePlanes.ModTools.Parts.IInputController[] inputs = new Jundroo.SimplePlanes.ModTools.Parts.IInputController[3]; private float _scaleX = 0; private float _scaleY = 0; private float _scaleZ = 0;
In the start void:
inputs = this.GetComponentsInChildren<Jundroo.SimplePlanes.ModTools.Parts.IInputController>();
In the update void, wherever you please: this._scaleX = inputs[0].Value; this._scaleY = inputs[1].Value; this._scaleZ = inputs[2].Value;
And obviously you can take the basic syntax structure and change it as you need. This code is for three input controllers.
Also, if you're wondering what stuff like private is, they are keywords in C# but they don't seem to be required for the purpose of scripting part behavior. Some of my variables have them, some don't. My code is also a mix of random stuff I got from other mods and the internet, but it works.
I actually had the exact same issue as you!
Example code:
Right after the behavior class start: // Array of input controllers.
Jundroo.SimplePlanes.ModTools.Parts.IInputController[] inputs = new Jundroo.SimplePlanes.ModTools.Parts.IInputController[3];
float input_scaleX;
float input_scaleY;
float input_scaleZ;
In the start void: inputs = this.GetComponentsInChildren<Jundroo.SimplePlanes.ModTools.Parts.IInputController>();
And then just do this._scaleX = inputs[0].Value;
Hopefully you can understand how it works and can apply it to your own code.
It is a change made by the developers to promote newer aircraft, although you can still manually search for older crafts by adding ?d=0 to the address in the URL.
@hpgbproductions I guess I don't really mind for when I'm just placing stuff somewhere; I use the increments of 0.0001, 0.0002... 0.0064, 0.0128, etc). idk it's just what I do, I guess. Obviously for fuselages I'll let them align themselves, but everything else is pretty much nudge it until it's seamless (down to 0.0001, although sometimes I type in more precise numbers)
@hpgbproductions What do you mean by coordinates in this context? I would think when building the numbers don't matter; it's the position of the part relative to other parts that matters.
@Graingy A phone is far worse because everything is so tiny, even just doing normal phone things (I really prefer my computer setup lol).
On an iPad I just have more space to interact with and see stuff.
Forum got removed but I saw your question.
All posts (forums, airplanes, blogs, videos, mods, bios) have a unique ID. They can all be edited (and the edit page can be viewed by everyone) with https://www.simpleplanes.com/Forums/Edit/PostID. Example 1 Example 2
It also seems you have already changed the title to your bio post, and have used this trick in the past.
Wright, although mostly I'm either spawning in and checking something on the plane itself (for example checking the dimensions of something in VR for the interior), or just taking off and doing something in the air. When I eventually get this monstrosity finished, I will fly between various vanilla and mod airports.
@Graingy I plan to remake this in SP2 with ultra details similar to the SWL-10.
Should be a quick and fun project, only a few thousand parts and just under a year.
@Graingy This was my actual building skill 3 years ago lol
How far I've come...
Also if you check the changelog in the description I've made lots of improvements to this plane over time.
@Graingy
{TargetSelected ? "TargetDistance" : "N/A"}
will display TargetDistance (as a string) or N/A.
To display the actual value, you will want two separate expressions that show and hide themselves.
<size={TargetSelected ? "100" : "0"}%>{TargetDistance}<size={TargetSelected ? "0" : "100"}%>N/A</size>
Try that
@Graingy Label stuff is hard to explain. I use a text editor (notepad++) for that reason, which does things like show me bracket pairs.
What specifically do you mean by "issue" with displaying a value?
@Graingy You can only display two strings or two values in a label, not one of each. To display values or strings, put it in curly brackets. {Activate1 ? "True" : "False"} {Activate1 ? 50 : 20}
@Graingy The label code in your comment will just display two pieces of text. About the other thing you tried, a tertiary selector in a label must have either two strings, or two numbers.
@Graingy Yeah the pingpong by itself is instantaneous. It's the other time-based function inside it (sum) which makes it alternate at an observable rate. About speed, I believe sum(1) will have a value of 1 after 1 second, so the value in sum is simply the amount of change in one second. The clamp01 in my earlier code is actually after the boolean, and is to give us a "clean" value (not required but I have OCD lol) of 0 or 1 for the beacon light input.
@Graingy Alright, so with pingpong it doesn't have a speed; it simply pingpongs whatever you put into it. So let's say you just have pingpong(Throttle * 3, 1). There is no speed or anything. If you jam throttle to full, the function will output 1 because you went to 1, then back to 0, and back to 1 again, instantly.
I'll explain other stuff as we go on, but for now, put {pingpong(Throttle * 3, 1)} into a label and try it out in-game (you can also use the debug console if you wish, just take off the curly brackets).
@Boeing727200F I just understand how everything is connected. For example, if I wanted to move the turret of a tank, I would find the rotator it is connected to and nudge that, which moves everything else. In fact I don't even drag and drop stuff (aside from fuselages for alignment). I nudge everything into place and manually add connections.
@Graingy Funky trees is a programming language based around mathematics. Functions such as clamp(x, y, z) do things to and with numbers, and they can be stacked. Knowledge of algebra is essential for properly understanding the structure of code written in this language.
The code I wrote should alternate between 0 and 1 rapidly. The core of this is the pingpong(x, y) function. This alternates a value so it is never larger than y and never less than 0. For example, say I had pingpong(Throttle * 3, 1). From 0% to 33% throttle, it would be the same, however from 33% to 66% throttle it would go back down to 0. from 66% to 100% it would go back up.
The sum(x) function is the sum of all inputs over time (idk how to properly explain this). With a static number in there it will constantly go up. I put 5 so it goes faster than 1. This gets placed inside the pingpong function so it now alternates between 0 and 1 rapidly. The only problem is this is pretty much always greater than 0, activating the light.
The clamp function allows us to clamp values. For example, clamp(3, 1, 2) will output 2 because 2 is the maximum value. clamp(0.5, 1, 2) will output 1 because 1 is the minimum value. clamp01(x) is the same as clamp(x, 0, 1), and exists because it is used pretty often. Before we clamp anything, I then put our pingpong code in a boolean comparison, checking if it is greater than 0.5. This could actually work without clamping it since booleans get converted to -1 and 1 for math purposes, however I like to have clean 0 and 1 values, so I clamp01 it.
So there you go, all of clamp01(pingpong(sum(5), 1) > 0.5) broken down. Hope it helps!
For your information, anything above 0 in the input field of a beacon light will activate the light. As you want to control the blink pattern in more than one way, you will need additional FT instead of a simple blink pattern. TargetLocked ? 1 : (TargetLocking ? clamp01(pingpong(sum(5), 1) > 0.5) : 0)
Not sure if that will work or not, give it a try.
@FlyOnTheWall I think the mod itself has to be specifically exported for android, as when I attempted it many years ago I got a lot of warnings about missing build support for Android, etc.
@griges Sorry, didn't see your reply (please remember to press the reply button).
I write almost all my variable and label code in notepad++ (label code is then copied to in-game while I write variables directly into the xml), and even then I frequently have multiple windows up for reference or transfer.
I am actually still in high school, and almost all of my coding, Unity, and blender knowledge has come from this game, which I play as a hobby.
@Noname918181818181818181 And I also do that as well. @Graingy I guess I use a lot of build techniques, but I forget they aren't common knowledge and so don't think of them as build techniques.
@V I guess I also participate in control base abuse. My iPad in my cockpit has full 6dof capability, where it can both snap to four positions and also function as a normal pickup object for VR users (buttons to change modes). The main landing gear also uses control bases for the main strut, tilt/tilt suspension, and the lock link.
@blt My main desktop has an i9 and 4070ti, with matching high-end components, although you will not need that to run the final plane (without the cockpit). This is due to my method of modding parts, which you can read about here.
Spooky coincidence, but my boot SSD went poof this morning as well. Luckily 99% of my data is backed up, but I lost 1 month worth of work on the SWL-120's mod. It's nothing critical, although it's a setback. I also am down to one laptop while I wait to get a new SSD as well.
+2@SARACONIKaviationIndustry Hello, I am happy to share it with you, although it relies on several aircraft variables which in turn use other variables. What I can do is give you the raw label code and some of the essential variables; hopefully you can understand how it works with that. It will likely be a while before I can send it to you; I have some irl stuff to do.
@ArmouredTrashCan good to hear
Update, just looked at my code and in the earlier example I sent, I define variables and then set different ones. This new comment fixes that. I also made all the characters show up correctly (for example this:
"<"
doesn't turn into this:
"<"
)
Right after the behavior class start:
Jundroo.SimplePlanes.ModTools.Parts.IInputController[] inputs = new Jundroo.SimplePlanes.ModTools.Parts.IInputController[3];
private float _scaleX = 0;
private float _scaleY = 0;
private float _scaleZ = 0;
In the start void:
inputs = this.GetComponentsInChildren<Jundroo.SimplePlanes.ModTools.Parts.IInputController>();
In the update void, wherever you please:
this._scaleX = inputs[0].Value;
this._scaleY = inputs[1].Value;
this._scaleZ = inputs[2].Value;
And obviously you can take the basic syntax structure and change it as you need. This code is for three input controllers.
Also, if you're wondering what stuff like
private
is, they are keywords in C# but they don't seem to be required for the purpose of scripting part behavior. Some of my variables have them, some don't. My code is also a mix of random stuff I got from other mods and the internet, but it works.@ArmouredTrashCan oh, < is <, same with > and >
It's just how code blocks format it.
I actually had the exact same issue as you!
Example code:
Right after the behavior class start:
// Array of input controllers.
Jundroo.SimplePlanes.ModTools.Parts.IInputController[] inputs = new Jundroo.SimplePlanes.ModTools.Parts.IInputController[3];
float input_scaleX;
float input_scaleY;
float input_scaleZ;
In the start void:
inputs = this.GetComponentsInChildren<Jundroo.SimplePlanes.ModTools.Parts.IInputController>();
And then just do
this._scaleX = inputs[0].Value;
Hopefully you can understand how it works and can apply it to your own code.
In the very early days of SP, Wright Airport used to be a single runway airstrip (just a rectangle with a texture) called Tarpley Airport
+8@MIGFOXHOUND31BSM26 They actually removed it entirely at one point, and I asked them to add back d=0
It is a change made by the developers to promote newer aircraft, although you can still manually search for older crafts by adding ?d=0 to the address in the URL.
@hpgbproductions I guess I don't really mind for when I'm just placing stuff somewhere; I use the increments of 0.0001, 0.0002... 0.0064, 0.0128, etc). idk it's just what I do, I guess. Obviously for fuselages I'll let them align themselves, but everything else is pretty much nudge it until it's seamless (down to 0.0001, although sometimes I type in more precise numbers)
SimpleCheats
Speed is meters per second, although I don't seem to have the unit for forward thrust.
@hpgbproductions What do you mean by coordinates in this context? I would think when building the numbers don't matter; it's the position of the part relative to other parts that matters.
@Graingy A phone is far worse because everything is so tiny, even just doing normal phone things (I really prefer my computer setup lol).
+1On an iPad I just have more space to interact with and see stuff.
I used to be an iPad player (6 years ago) and I will never go back
@Graingy This one
+1@Graingy What document are you referring to?
Forum got removed but I saw your question.
+1All posts (forums, airplanes, blogs, videos, mods, bios) have a unique ID. They can all be edited (and the edit page can be viewed by everyone) with
https://www.simpleplanes.com/Forums/Edit/PostID
.Example 1
Example 2
It also seems you have already changed the title to your bio post, and have used this trick in the past.
@Graingy @keiyronelleavgeek566 Edit post
If you mean in-game, press space to see all three measurements (CoG, CoL, CoT). If it's something else, then I have no idea, sorry.
Wright, although mostly I'm either spawning in and checking something on the plane itself (for example checking the dimensions of something in VR for the interior), or just taking off and doing something in the air. When I eventually get this monstrosity finished, I will fly between various vanilla and mod airports.
+1Are you going to add every dial and switch? That would be pretty cool.
+1@DDVC I had a look at the image with inspect element, and there is no image. It's just an empty img tag.
+3My anti-stealing strategy is make builds no-one can run lol (see: SWL-120)
+1@Graingy I plan to remake this in SP2 with ultra details similar to the SWL-10.
+1Should be a quick and fun project, only a few thousand parts and just under a year.
@Graingy This was my actual building skill 3 years ago lol
How far I've come...
Also if you check the changelog in the description I've made lots of improvements to this plane over time.
@Graingy @Monarchii fun fact: This is one label. And I know how to modify it.
+1@Graingy Yes
+1@Graingy
+1{TargetSelected ? "TargetDistance" : "N/A"}
will display TargetDistance (as a string) or N/A.
To display the actual value, you will want two separate expressions that show and hide themselves.
<size={TargetSelected ? "100" : "0"}%>{TargetDistance}<size={TargetSelected ? "0" : "100"}%>N/A</size>
Try that
@Graingy Label stuff is hard to explain. I use a text editor (notepad++) for that reason, which does things like show me bracket pairs.
What specifically do you mean by "issue" with displaying a value?
@Graingy About your response to Monarchii, did you know you can tap the edit icon to open a large window to type stuff into labels?
@Graingy You can only display two strings or two values in a label, not one of each. To display values or strings, put it in curly brackets.
{Activate1 ? "True" : "False"}
{Activate1 ? 50 : 20}
@Graingy
Boolean ? stuff if true : stuff if false
It's as simple as that.
And like all other stuff in FT, they can be stacked.
@Graingy The label code in your comment will just display two pieces of text. About the other thing you tried, a tertiary selector in a label must have either two strings, or two numbers.
+1@Graingy Yeah the pingpong by itself is instantaneous. It's the other time-based function inside it (sum) which makes it alternate at an observable rate. About speed, I believe sum(1) will have a value of 1 after 1 second, so the value in sum is simply the amount of change in one second. The clamp01 in my earlier code is actually after the boolean, and is to give us a "clean" value (not required but I have OCD lol) of 0 or 1 for the beacon light input.
+1@jamesPLANESii They took away d=0 entirely a few weeks ago, and I got them to add it back (that's the TLDR, read my linked comments for more info).
+5@Jsoeidm2 Possibly, although I don't know.
Comment 1
+2Comment 2
This should provide some more information.
TLDR website performance reasons, although if you know what to do you can still do it.
@Graingy Alright, so with pingpong it doesn't have a speed; it simply pingpongs whatever you put into it. So let's say you just have
+1pingpong(Throttle * 3, 1)
. There is no speed or anything. If you jam throttle to full, the function will output 1 because you went to 1, then back to 0, and back to 1 again, instantly.I'll explain other stuff as we go on, but for now, put
{pingpong(Throttle * 3, 1)}
into a label and try it out in-game (you can also use the debug console if you wish, just take off the curly brackets).@Boeing727200F I just understand how everything is connected. For example, if I wanted to move the turret of a tank, I would find the rotator it is connected to and nudge that, which moves everything else. In fact I don't even drag and drop stuff (aside from fuselages for alignment). I nudge everything into place and manually add connections.
+2I just do everything through connections and the "move connected parts" option in the nudge tool.
+2@Graingy Funky trees is a programming language based around mathematics. Functions such as clamp(x, y, z) do things to and with numbers, and they can be stacked. Knowledge of algebra is essential for properly understanding the structure of code written in this language.
+2The code I wrote should alternate between 0 and 1 rapidly. The core of this is the
pingpong(x, y)
function. This alternates a value so it is never larger than y and never less than 0. For example, say I hadpingpong(Throttle * 3, 1)
. From 0% to 33% throttle, it would be the same, however from 33% to 66% throttle it would go back down to 0. from 66% to 100% it would go back up.The
sum(x)
function is the sum of all inputs over time (idk how to properly explain this). With a static number in there it will constantly go up. I put 5 so it goes faster than 1. This gets placed inside the pingpong function so it now alternates between 0 and 1 rapidly. The only problem is this is pretty much always greater than 0, activating the light.The clamp function allows us to clamp values. For example,
clamp(3, 1, 2)
will output 2 because 2 is the maximum value.clamp(0.5, 1, 2)
will output 1 because 1 is the minimum value.clamp01(x)
is the same asclamp(x, 0, 1)
, and exists because it is used pretty often. Before we clamp anything, I then put our pingpong code in a boolean comparison, checking if it is greater than 0.5. This could actually work without clamping it since booleans get converted to -1 and 1 for math purposes, however I like to have clean 0 and 1 values, so I clamp01 it.So there you go, all of
clamp01(pingpong(sum(5), 1) > 0.5)
broken down. Hope it helps!For your information, anything above 0 in the input field of a beacon light will activate the light. As you want to control the blink pattern in more than one way, you will need additional FT instead of a simple blink pattern.
+2TargetLocked ? 1 : (TargetLocking ? clamp01(pingpong(sum(5), 1) > 0.5) : 0)
Not sure if that will work or not, give it a try.
@ThomasRoderick fixed
+1@SkyJayTheFirst Hi, I'd appreciate it if you didn't tag me just because I upvoted a teaser. Thanks!
+2@griges Ah, notepad++ is just a text editor. It's like the normal notepad built in to Windows but with a few more helpful features.
@FlyOnTheWall I think the mod itself has to be specifically exported for android, as when I attempted it many years ago I got a lot of warnings about missing build support for Android, etc.
@griges Sorry, didn't see your reply (please remember to press the reply button).
+1I write almost all my variable and label code in notepad++ (label code is then copied to in-game while I write variables directly into the xml), and even then I frequently have multiple windows up for reference or transfer.
I am actually still in high school, and almost all of my coding, Unity, and blender knowledge has come from this game, which I play as a hobby.
@Noname918181818181818181 And I also do that as well. @Graingy I guess I use a lot of build techniques, but I forget they aren't common knowledge and so don't think of them as build techniques.
+1@V I guess I also participate in control base abuse. My iPad in my cockpit has full 6dof capability, where it can both snap to four positions and also function as a normal pickup object for VR users (buttons to change modes). The main landing gear also uses control bases for the main strut, tilt/tilt suspension, and the lock link.
@blt My main desktop has an i9 and 4070ti, with matching high-end components, although you will not need that to run the final plane (without the cockpit). This is due to my method of modding parts, which you can read about here.
+1