Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I see the check for stop conditions but 'desiredVelocity' won't become 0 since it's set to 1.0 a few lines above.
Or am I missing something?
I know I'm being dumb but please help. Ideally I want to use the hinge then hit a button and it will reset back to '0' ready for use next time.
Replace this:
float curAngle = RadiansToDegrees(listHinges .Angle);
if (curAngle != setAngle)
setVelocity = (float)((curAngle < setAngle) ? desiredVelocity: -desiredVelocity);
//Set the appropriate limit
if (setVelocity > 0)
listHinges .UpperLimitRad = DegreesToRadians(setAngle);
else
listHinges .LowerLimitRad = DegreesToRadians(setAngle);
With this:
float curAngle = RadiansToDegrees(listHinges .Angle);
float newAngle = Clamp(curAngle + setAngle, -90, 90);
if (setAngle != 0)
setVelocity = (float)((curAngle < newAngle ) ? desiredVelocity: -desiredVelocity);
//Set the appropriate limit
if (setVelocity > 0)
listHinges .UpperLimitRad = DegreesToRadians(newAngle);
else
listHinges .LowerLimitRad = DegreesToRadians(newAngle);
Just started playing SpaceEngineers not to long ago and this script has already been super helpful but i was wondering if you could help me make a small modification for a specific instance.
Id like to use the argument to increment the current angle as opposed to setting the angle directly.
I set it up to run every 100 ticks in the Program() part, apparently there isn't a way to make it even slower without using a Timer Block? A.t.m. I just turn the Programmable Block off, when the drills are not in use.
If anyone else tries this: The angle is in radian, even though it's displayed in degree, so you need to convert them.
The programmable block gives me this error:
Caught exception during execution
of
script:Object reference not set to
an
instance of an object.
at Program.Main(String angle)
at
Sandbox.Game.Entities.Blocks.My
ProgrammableBlock.<>c__Display
Class26.<ExecutionCode>b__25(My
GridProgram
program)
at
Sandbox.Game.Entities.Blocks.My
ProgrammableBlock.RunSandboxe
dProgramAction(Action`1
action,
String&
response)
Note: The same thing happened with the rotor script and it had the same error. The piston script didn't affect the piston at all from what I could tell and had the same error except (String angle) was (String arg)
//Never trust users
lol
Can't beleive more people don't cry out for this amazing script. It's the only 1 that can control the hinges. The builds people make with these hinges is insane. Like that giant scarab from halo. Absolutly incredible. And your script only makes things that much better,
Hell, I can even make simple hinge doors instead of using rotors. Just a normal massive hinge door with a button panel using your script.
It's the simple things I like.
Thanks a bunch!
Thanks!
Do let me know when you do update this. I don't want this to take to muhc of your time, if it's just for me. Others might be lurking. But I'm the only 1 speaking.
Thanks, man. This is a cool script to go with an all ready cool block mod.
I made this little welder grinder ship combo. USed 3 welders and grinders on each side. EAch set of tools has a single tool in the middle with 1 tool on each side conected on hinges. This lets me localise welders into a single point.
decided to try this script. Love it so far. But With my ship I have another hotkey set to lock the kinges so they don't move when the ship moves.
If I hit run an arguemnt while the hinge is lokced. script will lock up and I have to reset it
Also I have the velocoity set at 1. But anything higher the hinges themselves say they wre locked until I lower the velocity. This also locks up your scipt if the hinge locks.
Not sure if you can conjoure up a simple fix. OR add built in controls to lock the hinge after the arguemnt is used.
Love this script so far. I have so many potenial ideas now. Cool stuff, man.