One way to improve the code in the label is to use a stacked tertiary selector. For example:
Time < 2 "Funny text" : (Time < 3 ? "..." : (Time < 4 ? "Punchline" : ("...")))
This improves the performance, as the code only runs the required sections. I also use Time instead of sum(1) to further reduce calculations.
@jamesPLANESii On the SWL-120, the primary wings, the slat rotators, and some exposed aileron rotators are 0,0,0 scale. If I need to change something I can either make my way to them via connections (my part connections are very organized) or looking directly in the xml.
@GoodPattRail It is misleading, as the thumbnail does not show the build itself. As stated in the rules, "posts with misleading thumbnails will be removed."
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.
You need to copy the direct image link, such as
https://e3.365dm.com/21/07/2048x1152/skynews-boeing-737-plane_5435020.jpg
@Graingy It's in the guide in the "Number Input Variables" section close to the top.
+1One way to improve the code in the label is to use a stacked tertiary selector. For example:
+4Time < 2 "Funny text" : (Time < 3 ? "..." : (Time < 4 ? "Punchline" : ("...")))
This improves the performance, as the code only runs the required sections. I also use Time instead of sum(1) to further reduce calculations.
game was not responding for 5 minutes and I gave up lol
+1@HungrySu34 20 thousand
I get a few frames per second in the designer, currently waiting for 1 minute to load the level
+1alright time to see how the NASA PC capable of running the SWL-120 handles this
+2@jamesPLANESii On the SWL-120, the primary wings, the slat rotators, and some exposed aileron rotators are 0,0,0 scale. If I need to change something I can either make my way to them via connections (my part connections are very organized) or looking directly in the xml.
+1
+1[PaintBrushSP](https://www.simpleplanes.com/u/PaintBrushSP)
PaintBrushSP
@SARACONIKaviationIndustry I have uploaded a demo version here.
@GoodPattRail It is misleading, as the thumbnail does not show the build itself. As stated in the rules, "posts with misleading thumbnails will be removed."
+1You used a screenshot of the characteristics instead of a picture of the actual build in the thumbnail.
+1My SSD decided to start working again and I got all my stuff back (which now has automatic backups in place); hopefully your laptop does the same.
+1Spooky 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.