I ask this because a want to make like reactor like thing on my plane where the pistons turn on and off one by one but I don't quite know the xml for it
Help is appreciated and I'll probably mention yall in the description of any plane I make ..it won't help much if your already big but I really wanna do the reactor thingies so yeah
How do I add a delay to a certain function if there is any? Piston to be specific
6,839 Gx
4.0 years ago
@SimonGlaser ok I'll make a prototype and test this out. Thanks for the challenge!
@UltraLight Hey, you seem to be a pro in math and FT! Do you know if there is a way to make the piston delay each time it cycles? For example AG1 activated, Piston moves up, piston moves down, piston doesnt do anything for a few seconds, up, down, wait, ... until AG1 gets deactivated?
Would be very thankful. Im want to make realistic moving pushrod valves for a old plane engine
@UltraLight
Having some issues. The T variable changed to something isn't effecting the speed
And adding "clamp" doesn't move it....but there is certainly a difference between normal and having that
https://www.simpleplanes.com/a/B847OJ/MJ-3000
also thnx for upvote
and clamp is just to make sure the value never exceeds whatever int is given in the "clamp"
@Greggory005 "t" can be any real number, not just integers. A common value for this equation would be 0.5, actually. Other than that, your pretty good! Let me know if you need help putting it into practice.
@UltraLight so to sum it up the variable "x" here is The ag groups and it checks whether they are true or false and "t" is an integer @ of which the function slowly comes to its max correct?
@Greggory005 yeah, change the "t" in
smooth(x, t)
. The t is the slowness you could say@UltraLight although this is still very helpful! I have another idea too now.. since its funky trees I can use it for rotors too
Ok, SO
Hang on tight, you might need some math knowledge for this. Also, you should need a good understanding of FT. For this example, we will assume that you want the pistons to move when you activate group one.
.
Here is the code: 'clamp01(smooth(Activate1, 0.2)>1)'
But I dont want you to just copy-paste it, I want you to understand it. Thay way, you can customize it for your needs.
.
When you actuate group one, the value immediately changes from -1 to 1. The
smooth(x, t)
function makes the input change slowly. So, if you putsmooth(Activate1, 0.2)
and activate group 1, it will change from -1 to -0.9999 to -0.5 to 0, etc. It will take it a bit of time to reach 1, depending on the second value in the function..
So by using the > symbol, we get a -1 when we are less than one, and a 1 when we are over 1. Then the
clamp01()
function to clean it up..
Please give me credit, and tag me on the post