You can set the min and max on RT to 180 and -180 respectively, keep them -180 and 180 on LT. Then you can control both of them with a single variable.
an advanced turret cradle can both to the right and to the left, I need it to move both to the right and to the left. That is, the mench has a rangefinder in the center and on the right and left there are cradles and it is possible to aim at the asteroid. Sorry for my bad english
heya i know a really easy way to code this with using only one variable with the turrets, if you leave LT as 180 and -180 for max and min and then inverse these numbers on the other turret then you can control them both inversely mirrored with the same input, put max as -180 and min at 180 on RT and change the name to LT and remove all references to RT in the code and it will work with much less code, now they limitations is this will perfectly mirror them so for this type of rangefinder code it's perfect, for anything else it becomes less perfect, for example i'm working on code that can use your mouse to control the turret but then each turret will require it's own angle since each turret will be pointing left or right values separate from each other and will require individual fields.
Using your suggestion above, how can I add a limitation as to how far my turn tables will go? My mining lasers are set back slightly and below my cockpit and therefor if I were to get too close to an object the lasers will start to shoot my cockpit. The turn table limits don't seem to work and get overridden by the yolol. I modified the code already to account for pitch as well since my mining lasers are not at the same level as my range finder and I wanted the option to use the range finder without the lasers on so I have it so that those can be turned off too. Only thing i cant figure out is the math behind adding limitations. if :Lasers==1 then :ML=15*:RF-:R else :ML=0 end If :RF==1 then :LT=-87/:R :LP=-87/:R end goto1
@@armedbobery4879 so limitations on turret rotation is actually why i stopped playing the game, no matter what i did or tried to do, eventually the lasers would randomly spin around once and a while and shoot something they shouldn't.... the code could be perfect and it would still happen, it saddens me that this is still an issue 4-5 months after i stopped playing, as i consider it a game breaking bug. the closest thing i found to a "fix" was a mining laser check that takes place to ensure the lasers are pointing within the range they should be, so in your original code you need a if x and y = 1 or something like that, then x being the ML=1 and the y=1 being a check for the angle of the turret, turrets have input range and output range, the output range is the current rotation of the turret, the calculations you put into your movement of turrets should have a min and max value so you want this to be your range, so for Y you want "if turret current angle is less than it's min value or higher than it's max value then y = 0" Y will be the check to make sure the lasers are pointing forwards to the correct angle, it's best to run this code on it's own yolol in a single line if possible so the check is happening as often as possible, because if the turrets flip 180 degrees instantly which can happen they will still get a single pulse of laser beam off which will damage something, so it's good to have a shield wall of some stronger material or double layers behind the laser turret to protect internals. hope this all makes sense, it's 1pm of day 2 me not sleeping :)
For many ships, the basic setup is slightly different. The rangefinder is usually not at the same level as the lasers. I bought the Momento and upgraded it. The rangefinder is at cockpit level and the lasers are about 2 meters lower. This made the challenge for my script a bit more complex. For me, not only the rotation, but also the pitch is relevant. For my setup I wrote the appropriate script. Unfortunately this is not universally applicable for other ships. If there are then the rare ores, I can write a script with the professional chip, which optimizes the calculations with a specification of an angle.
This is not working for me. I do not see how this code will turn on my lasers when the range finder detects an object. :ML=22*:MINE-R? ML is binary, 0, 1. On or off. I don't get it.
Yeah I don't understand it either. If the target range is 5, then 22*1-5 == 18. 22*0-5 == -5. Both of these turn the mining laser on. There's no way this code does what it shows.
Any chance you can do a run down to a rotating / pivoting turrets yolol version of this, or does this code work without having to code in the rotation and pivots?
I spent two days coding a yolol-script that aims 2-axis turrets regardless of their position and rotation from the rangefinder right at the rangefinders hit position. If you want the script I can give it to you.
I'm having issues as well and I can't figure out why. Like 1 the lasers turn on even though nothing is in front of the range finder. And 2 they aren't turning to aim at the laser. Don't know if I'm using the wrong turret base or not for that bit. Also the * in the code is a lot bigger then it is in his for some reason. Idk how to make it as small as it is on his chip
In theory yes, but in practice no. The reason why is because the max range is 1 km, Isan only updates every 0.2 seconds, and on a moving target it will be inaccurate, but other than that it can be usefull
complete waste of time, with this setup you only have 1 point in the entire range of the rangefinder that will work, mite as well jest set the lasers to a fixed cross position and forget the rangefinder and yolol chip. you NEED Professional yolol chips to do trig. the chip needs Xhalium is not in game at this moment.
Your code doesn't make any sense. :ML is the on/off toggle for the mining laser, where 0 is OFF and anything not 0 is ON. You could multiply it by a billion and not affect how it turns on or off. The only thing that does anything in this at all is the ratio divider for :RT being 90 / range.
You can set the min and max on RT to 180 and -180 respectively, keep them -180 and 180 on LT. Then you can control both of them with a single variable.
an advanced turret cradle can both to the right and to the left, I need it to move both to the right and to the left. That is, the mench has a rangefinder in the center and on the right and left there are cradles and it is possible to aim at the asteroid. Sorry for my bad english
Update: This the best code. I use it on all my builds lol. I also pair it with a zig-Zag pattern (on different yolo chip).
Hello, and tell me how to set it up so that my cradle rises to the bottom and to the top along the rangefinder, here you have only left and right
heya i know a really easy way to code this with using only one variable with the turrets, if you leave LT as 180 and -180 for max and min and then inverse these numbers on the other turret then you can control them both inversely mirrored with the same input, put max as -180 and min at 180 on RT and change the name to LT and remove all references to RT in the code and it will work with much less code, now they limitations is this will perfectly mirror them so for this type of rangefinder code it's perfect, for anything else it becomes less perfect, for example i'm working on code that can use your mouse to control the turret but then each turret will require it's own angle since each turret will be pointing left or right values separate from each other and will require individual fields.
Oh wow, that's a really useful tip. I had no idea inverting the minimum and maximum angle had that affect! Time to rewrite my mining laser code! :D
how are you accessing any mouse input, is there a way to access that mouse steering mode from yolol or something?
@@N1ghtR1der666 you can check the video i uploaded earlier today for an explanation on setting up mouse aiming ua-cam.com/video/szokSSDdctE/v-deo.html
Using your suggestion above, how can I add a limitation as to how far my turn tables will go?
My mining lasers are set back slightly and below my cockpit and therefor if I were to get too close to an object the lasers will start to shoot my cockpit.
The turn table limits don't seem to work and get overridden by the yolol.
I modified the code already to account for pitch as well since my mining lasers are not at the same level as my range finder and I wanted the option to use the range finder without the lasers on so I have it so that those can be turned off too. Only thing i cant figure out is the math behind adding limitations.
if :Lasers==1 then :ML=15*:RF-:R else :ML=0 end
If :RF==1 then :LT=-87/:R :LP=-87/:R end
goto1
@@armedbobery4879 so limitations on turret rotation is actually why i stopped playing the game, no matter what i did or tried to do, eventually the lasers would randomly spin around once and a while and shoot something they shouldn't.... the code could be perfect and it would still happen, it saddens me that this is still an issue 4-5 months after i stopped playing, as i consider it a game breaking bug.
the closest thing i found to a "fix" was a mining laser check that takes place to ensure the lasers are pointing within the range they should be, so in your original code you need a if x and y = 1 or something like that, then x being the ML=1 and the y=1 being a check for the angle of the turret, turrets have input range and output range, the output range is the current rotation of the turret, the calculations you put into your movement of turrets should have a min and max value so you want this to be your range, so for Y you want "if turret current angle is less than it's min value or higher than it's max value then y = 0" Y will be the check to make sure the lasers are pointing forwards to the correct angle, it's best to run this code on it's own yolol in a single line if possible so the check is happening as often as possible, because if the turrets flip 180 degrees instantly which can happen they will still get a single pulse of laser beam off which will damage something, so it's good to have a shield wall of some stronger material or double layers behind the laser turret to protect internals.
hope this all makes sense, it's 1pm of day 2 me not sleeping :)
For many ships, the basic setup is slightly different. The rangefinder is usually not at the same level as the lasers.
I bought the Momento and upgraded it. The rangefinder is at cockpit level and the lasers are about 2 meters lower.
This made the challenge for my script a bit more complex.
For me, not only the rotation, but also the pitch is relevant.
For my setup I wrote the appropriate script. Unfortunately this is not universally applicable for other ships.
If there are then the rare ores, I can write a script with the professional chip, which optimizes the calculations with a specification of an angle.
Pro chips are not available yet... atan() would save my world
Lasers auto turn on with nothin in the beam... How can I fix that?
Simple Trig can do a lot of cool things :) if you switch to a trig formula, pretty sure it would not only update faster, but be even simpler,
Thank you very much for sharing your code it's working great for my setup. Man your the best. There's no way I can thank you for this code.. 👍👍👍👍👍👐👍👍💯
This is not working for me. I do not see how this code will turn on my lasers when the range finder detects an object. :ML=22*:MINE-R? ML is binary, 0, 1. On or off. I don't get it.
Yeah I don't understand it either. If the target range is 5, then 22*1-5 == 18. 22*0-5 == -5. Both of these turn the mining laser on. There's no way this code does what it shows.
Any chance you can do a run down to a rotating / pivoting turrets yolol version of this, or does this code work without having to code in the rotation and pivots?
Love that little ship too you should do a ship showcase.
For sure, I am planning to sell it eventually, just making sure it has everything it needs
I found the code, the script works and the data is transmitted, but the turrets are not turning. What could that be?
thx for cool Tutorial, will add to my ship, but change the rotation in pitch direction :)
hi how can i add pulsed laser to your code? I've been trying for a long time but I can't get anything. Thank you.
This is brilliant, Thank you very much for sharing this amazing info. Damn, thanks
Is there a way to make the lasers in this YOLO to pulse because my ship cant do 2 mining lasers more then a few seconds.
Yes you can
@@Ravaen I Think he was asking what that code would be. We all know you CAN do it, the question is HOW
Thanks for this video.
My question is, how would one get this to work with Pitch on Turret Cradles too? - I'm bad with yolol
I spent two days coding a yolol-script that aims 2-axis turrets regardless of their position and rotation from the rangefinder right at the rangefinders hit position. If you want the script I can give it to you.
@@sayex2023 Oh, I'd massively appreciate that! It'd help me learn how to make my own yolols around turret manipulation.
@@sayex2023 Did you succeed to do it without yolo pro chip (cost xhalium) and cos sin function ? can't figure how to do it
@@sayex2023 I will be very appreciated, if you will share this one for all of us ))
@@legroscompte1929 Yes, I did it on an advance chip. To avoid the trigonometric functions look up their polynomial approximation.
I'm having some difficulty setting this up.. but that might well be due to inexperience on my end..
I'm having issues as well and I can't figure out why. Like 1 the lasers turn on even though nothing is in front of the range finder. And 2 they aren't turning to aim at the laser. Don't know if I'm using the wrong turret base or not for that bit. Also the * in the code is a lot bigger then it is in his for some reason. Idk how to make it as small as it is on his chip
Thx, but can anybody write down the script here? Can't read it properly because its 720P :/
Can we get the yolol code here in the comments, it's a little hard to see...
p.s. it's in the video description
In SSC, my turret continues to rotate until they shoot themselves. What do I change to limit this? Max rotation??
Troubleshoot and see what value RT and LT are
You've earned my sub with this.. well done, well explained.. Thank you
would this work for an auto target autocannon setup for 2 front guns?
In theory yes, but in practice no. The reason why is because the max range is 1 km, Isan only updates every 0.2 seconds, and on a moving target it will be inaccurate, but other than that it can be usefull
Nice work, gonna add this to my ship!
Nice clean and simple.
would be nice if you could show us button configs too :D
Thank you! I will try this
Where is code?
Thx
Thank u
Bad ass!!
complete waste of time, with this setup you only have 1 point in the entire range of the rangefinder that will work, mite as well jest set the lasers to a fixed cross position and forget the rangefinder and yolol chip. you NEED Professional yolol chips to do trig. the chip needs Xhalium is not in game at this moment.
but mining laser range is very short
Your code doesn't make any sense. :ML is the on/off toggle for the mining laser, where 0 is OFF and anything not 0 is ON. You could multiply it by a billion and not affect how it turns on or off. The only thing that does anything in this at all is the ratio divider for :RT being 90 / range.