Space Engineers

Space Engineers

Thrust Vector VANILLA (if you want it to be)
233 Comments
Пиро Jul 5, 2022 @ 8:29pm 
Hi! I am the new mantainer of this script, I released a definitive version.
https://steamcommunity.com/sharedfiles/filedetails/?id=2831096030
Go check it out!
󠀡󠀡Altus Jun 28, 2018 @ 3:23am 
@1wsx10 What are the differences and improvements in the new version of this?

I'm just trying to decide if it's worth the hassle to update the avionics on a bunch of my old designs?
Vermillion  [author] Nov 24, 2017 @ 9:00pm 
the new version is now on the workshop! see the link at the top
Vermillion  [author] Nov 24, 2017 @ 8:02pm 
@Spartan unfortunately, the spinning thrusters is a bug in the game. i have been able to reproduce it without my script and have made this bug report: https://forum.keenswh.com/threads/phantom-force-rotation-with-thruster-on-rotor.7398469/#post-1287078582
hopefully they fix it soon. for now, the workaround is to just try and build it so the rotor axis point towards the centre of mass as much as possible.


as for the ship going up, could you publish the blueprint so i can see?
Spartan Nov 24, 2017 @ 3:34pm 
My rear thrusters are not working, just spining crazy :S any idea ? both on the front are working

Confirmed, ship going up with only 2 thrusters and rotors too.
Spartan Nov 24, 2017 @ 2:03pm 
My ship keeps going up when i activate the %jetpack when i got 4 diferent rotors, a bug or im doing something wrong ?
Vermillion  [author] Nov 23, 2017 @ 5:25pm 
@ArtistX as of yet, the program doesn't acknowledge the rotor limits. this means you can set the rotor limits, and it won't go past there. there is a problem with this though. if the area that is out of bounds is less than 180 degrees, it might get stuck on the limit. since it is programmed to turn to a desired angle, and always go the shortest way around.

also the algorithm that decides how much each naceele should fire in which direction won't account for this. so if you have one nacelle that can fire in a certain direction, and another that can't, any thrust in that direction will be less than the full amount.
ArtistX Nov 23, 2017 @ 4:03pm 
is it possible to limit the angles? like if I only want forward and downward thrust?
Orcbow Nov 22, 2017 @ 4:41pm 
That may explain why my ship flew apart like Sebulba's podracer. XD
Vermillion  [author] Nov 22, 2017 @ 4:37pm 
there are no video tutorials as of yet, but there might be... soonTM
Vermillion  [author] Nov 22, 2017 @ 4:36pm 
@Orcbow today, actually. but for now you can use the instructions that are on that github page i linked. the new version is tested and updated for the current version of the game. the one on this workshop page isn't.
Orcbow Nov 22, 2017 @ 4:06pm 
Also, is there some sort of video tutorial on how to set it up somewhere (Not an example of the mod)? I've been working with the instructions provided, but since Space Engineers changed how some things work, I can't make heads or tails of the instructions.
Orcbow Nov 22, 2017 @ 3:09pm 
When are you going to put version two on the workshop?
Vermillion  [author] Nov 19, 2017 @ 5:59pm 
you should try out the new version: https://github.com/1wsx10/VectorThrust2

it's got *much* simpler setup, better algorithms, and i know it works the the latest version, this one is kina out of date. i just haven't bothered to put it on the workshop yet XD
The Gang Nov 19, 2017 @ 11:25am 
i would download the shit out of it if there was
The Gang Nov 19, 2017 @ 11:24am 
ahh thanks it would be cool though to have even directional thrusters or multi directional like on real space ships
Vermillion  [author] Nov 18, 2017 @ 4:41pm 
1. it did last i checked
2. there is a way to make it do this, but its not intended. and its really unstable, which is why i haven't tried to expand on that further.
The Gang Nov 18, 2017 @ 11:13am 
does this work in space as well?
also can you put 2 rotors on a thruster to have gimbaled thrusters?
Vermillion  [author] Nov 1, 2017 @ 6:06pm 
@DoktorDoraro i have requested a change, please check github.

about the linear equation:

multiplying it directly would actually work quite well, as long as you have some constant in there

eg:
`thrust *= cos_of_angle * some_constant;
if(thrust > max_thrust) { thrust = max_thrust; }`

the constant should probably be somewhere between 1 and 1.5
constant < 1: the thrust never gets to max
constant > 1: the thrust passes max some time before its exactly in line with desired vector

you might want to put some sort of log function or something, but that would not make much of a perceptible difference, and the script has to run every tick. so keeping it fast is desirable. mind, that hasn't stopped me from putting complex stuff in it thus far!
DoktorKrove Nov 1, 2017 @ 4:33pm 
@Rothank, It is possible, however you will need to use this modified version of VectorThrust2. https://github.com/Doktor-Doraro/VectorThrust2
Its the same as 1wsx10's version but it will keep your thrusters from applying thrust in the wrong direction.
Rothank Nov 1, 2017 @ 4:18am 
Hello there! I plan on building a frigate sized vessel with VTOL nacelles - only on the sides though, so two nacelles responsible ONLY for forward-downward thrust. Is it possible with this mod? All other thrust directions would be coming from normal thrusters on the main body (and their dampeners). That would also mean I would like to limit rotor rotations to 90 degrees instead of full 360. Possible? :D
DoktorKrove Oct 30, 2017 @ 2:14pm 
@1wsx10
managed to figure out how to check the two angles. On large ships it works wonders! I mad another pull request if you want to take a look.
Vermillion  [author] Oct 30, 2017 @ 1:14am 
@GawkyOrpheus should work, just make sure the centre of mass is still in the centre and you should be good to go. although this setup will suffer a little lag from the rotation, since you are likely to be making the rotor do full 180s often.
Queue Oct 30, 2017 @ 12:50am 
what if i put one ontop so the thrust can go front back side and side?
Vermillion  [author] Oct 25, 2017 @ 3:37am 
@Quixotic Mix if you are familliar with git, github is really quite simple. if you aren't familliar with either, i strongly recommend you start to learn git. its very widely used and an extremely useful tool for keeping track of working versions and features and things.

it lets you have multiple different copies of your code swapped out behind the scenes and keeps backups of everything, if you use it right. (it actually keeps a history of every single edit you make)
its a tool made for programmers, so its extremely advanced when it comes to everything you *can* learn, but like programming languages, you can get by knowing a few basic things.

github is a website made for the feature of git that allows you to have an online 'repository' which multiple people can download, work on, and submit changes.
Vermillion  [author] Oct 25, 2017 @ 3:37am 
@akkid2000 like Quixotic Mix said, they do different things. its actually quite funny, i was working on this (on and off) for about a year before i put it on steam, then a month later whip came out with his thing and i got so worried it was the same thing.

ARAURA Oct 24, 2017 @ 6:27pm 
@akkid2000 As far as I know that mod and this mod, while they seem similar, are not the same and I believe it is not plagiarized in any way. Whip's mod allows control of thrusters on rotors, nothing else; it does not control rotors themselves. This script manages both rotors and thrusters, allowing for vtol like ships, creating managed nacelles capable of flight.

@1wsx10 I'm not quitte sure how to make a pul request for vector thrust 2 in order to have the program control some of the gyros. Github is confusing to me.
DoktorKrove Oct 24, 2017 @ 3:07pm 
@1wsx10
To honest I dont remember. I think it had somthing to do with not having any idea what was wrong and it was easyer to just use the setFromVecOld, however after that I figured out how it worked and went back to using setFromVec insted. So the use of the word old was a mistake on my part.
akdude2000 Oct 24, 2017 @ 3:01pm 
what is the difference between this mod and "Whip's Rotor Thruster Manager (Works with Pistons and Connectors!)"?

P.S. im not accusing you of plagiarizing or anything, its just they seem very similar and im looking for scripts that do these kinds of things.
Vermillion  [author] Oct 21, 2017 @ 7:48pm 
@DoktorDoraro looks good, but why use the old setFromVec? does the new version no longer work?

im thinking i should expose that as an option at the top of the file. last time i checked, both have their advantages and disadvantages. (namely, the old one uses a function with asymptotes which causes the rotors to jump when they cross it, and the new one tends to have a little drift when used with complex multigrid ships)
DoktorKrove Oct 21, 2017 @ 11:17am 
@1wsx10 I made the pull request. I don't use github very often so im still new to a few things
Vermillion  [author] Oct 19, 2017 @ 6:00pm 
@DoktorDoraro where is the fix? there are no pull requests.

pretty sure I can't just see new branches you make, unless you pushed them. which means you need your own repo for that. the GitHub feature 'fork' makes a copy of someone elses repo that you have write permissions to so that you can work on it. then, if you want them to get your changes, you make a 'pull request'
Vermillion  [author] Oct 19, 2017 @ 8:54am 
@DoktorDoraro
limiting the thrust: should be fairly easy to do. not sure why i didnt do that, i just kinda had the attitude that the time it took to get to that position wouldn't make much of a difference. plus i only tested it on small ships. i guess it makes more of a difference in space. try this:

nacelle_thrust *= angle_between_actual&desired < 90degrees ? vector.dot(thruster_actual_direction, thruster_desired_direction), 0;

i dont remember what the variable names actually are, and i dont think i exposed thruster_actual_direction, so you would have to get that yourself... but thats fairly simple to get, just make sure its from the objects worldmatrix rather than localmatrix. also make sure its normalized.

You should be able to do that in the 'go' method of the nacelle class


the fix:
thanks, ill take a look in the morning.

DoktorKrove Oct 19, 2017 @ 7:32am 
When you have a chance to work on this script again, would it be possible to make it so thrusters don’t produce thrust until they point in the right direction. Right now, the problem is with larger ships with heavy nacelles the thrusters will take some time get to the correct orientation, so the ship ends up moving all over the place as the thruster produce thrust in the wrong direction as they turn. I attempted to make a fix for this but unfortunately, I don’t know how the script handles the desired 3DVector and the current rotor 3DVector so my version never worked. Also the current version of the Vector Thrust 2 on GitHub doesn’t compile. I made a fixed branch if you want to take a look. Also Also, there is a little know bug/feature in Space engineers using gyros, if you set one or more to override on but leave the pitch, yaw and roll at 0 then it acts as a sort of anti spin gyro, allowing you ships to be a little off balance without any side effects!
Anyways love this script!
Vermillion  [author] Oct 17, 2017 @ 12:08am 
@Quixotic Mix

That sounds awesome, having the program control some of the gyros is something i was planning on doing actually. at the moment i have assignments and then exams, so i probably wont be able to do it now. but feel free to make a pull request for vector thrust 2 if you get it working.
ARAURA Oct 14, 2017 @ 5:46pm 
Hi 1wsx10, this is a great mod, I'm building the Raza from Dark Matter and I feel like your mod is best suited to control the nacelles. Unfortunately this ship is big, and the nacelles are very heavy. As it is now, gyros are need to complete the rotation (pitch rotation override). Is there perhaps a way for me to modify the script to utilize gyros of each nacell to control the rotation of each?
Vermillion  [author] Aug 31, 2017 @ 12:37am 
@DoktorDoraro not currently, I have a lot of work with uni. im definitely not dropping it though. the new version is in a workable state: https://github.com/1wsx10/VectorThrust2
DoktorKrove Aug 29, 2017 @ 4:02pm 
Are you still working on this mod?
geniusface1234 Aug 25, 2017 @ 2:18pm 
p l e a s e c o n s u l t t h e m a n u a l
Mistdevourer Jul 15, 2017 @ 6:42pm 
I have fex problems and I don't know why :
First : when I start the script, thrusters automatically have the override to the maximum and push me to the sky. How can I change it ? Should they not adpat to the speed and weight ?

Second : Rotor only turns to brake the vessel, but never to go forward
Unknown Playe72 Jul 8, 2017 @ 4:16pm 
Small bug, when i want to go forward, the rotors turn to push me back.
AprilsRealm Jul 8, 2017 @ 2:10pm 
XD I know how you feel, sandbox/building games seem to be the worst for that kind of thing happening to me :P
Vermillion  [author] Jul 5, 2017 @ 8:08pm 
@adamsrealm thanks, i have been pretty slack recently though. you know when you get into a game that just eats all your free time?
AprilsRealm Jul 5, 2017 @ 6:40am 
@1wsx10 , thanks for allowing me to try v2, I've been testing it and it works great! Really looking forward to seeig how it develops in the future! ^_^
Vermillion  [author] Jun 18, 2017 @ 6:37pm 
@adamsrealm no, but that seems like a good feature to put in v2.

if you like, you can try v2 here https://github.com/1wsx10/VectorThrust2
just know, its still WIP.

1. put %VectorTim in the name of the timer block and only put its actions as run the computer with default argument.
2. place the engines while the script is running.
2.5 use the %standby argument to turn the script off (there is no control module hotkey for it yet)
3. no need to do grouping or angles in the name, the script works that out automatically
4. i recommend using control module (see v1 instructions)
5. i recommend using the monitor functionality (see v1 instructions)
AprilsRealm Jun 18, 2017 @ 11:13am 
@1wsx10, thanks for the clarification! ^_^ also glad to hear you're developing a version 2, hope that's going ok (I know programming can be a nightmare at times :P)

I use it in space for my main engines for travel and have a small set for manoeuvring :)

Also is there an argument you can run the programming block with to return rotors to a defined angle? I haven't tested the script with rotors engines that have armour on the rotor grid yet so I'm just checking as my rotor engine pods will probably be rather large In a build i'm planning.
Vermillion  [author] Jun 15, 2017 @ 4:22pm 
@Aro ah, that is probably a bug with the system that decides which controller to respond to. im planning on revising that for version 2 anyway.

@The Man Tank yes, that is exactly the problem. ill look into it for version 2

@adamsrealm it does, but not very well. the system is kind of inherintly bad for using in space. because it takes time for the rotors to move, the thrust isn't instantly applied in the correct direction like it is with standard thrusters. this is fine in gravity, because most of the time the rotors don't need to move much since they are almost always trying to counter gravity. in space to stop going backwards and go forwards, the rotors have to go all the way around.

dispite this, people still wanted it in space. so i made it work in space. but i hope you actually try it in gravity. its so much better.
AprilsRealm Jun 15, 2017 @ 2:01pm 
Also does this script work in space?
AprilsRealm Jun 15, 2017 @ 2:01pm 
@The Man Tank, I've had a similar problem to this, the only fix is to move all thrusters onto rotors

Just to note, you can have multiple thrusters per rotor :)

Hope this helps
The Man Tank May 26, 2017 @ 3:15pm 
Great script! Works well for every ship I've tried it on except for my large grid carrier. The only problem is that the bulk of the craft hovers using fixed thrusters and my vtol thrusters, using your script, go to full power automatically causing the ship to rise with no control inputs. I assume the scripted thrusters think that they're trying to lift the full mass of the craft by themselves and attempt to compensate. Is there anything I can do to make them work in tandem with fixed thrusters?