Space Engineers

Space Engineers

MArmOS V3.0 Example: Large Mobile Welder
3 Comments
mrudat 6 Jul, 2023 @ 12:54am 
The script is out of date, but copying the arm definition into the latest script appears to work.
aerinyes 15 Sep, 2020 @ 10:20pm 
<<Rotors>>
//whitespace removed
// <<OVERRIDES>>
public override void SetDeltaAngle( double dAngle =0 ){
double Vel;
if( !Override && Motor != null ) {
Vel = dAngle/Math.PI*30/dt;
double SoftMax = (Motor.UpperLimitRad < 360 ?
Math.Min( 1, Math.Abs( Motor.UpperLimitRad-Motor.Angle )/SoftMaxLimit ) : 1 );
double SoftMin = (Motor.LowerLimitRad > -360 ?
Math.Min( 1, Math.Abs( Motor.LowerLimitRad-Motor.Angle )/SoftMinLimit ) : 1 );
Vel = Math.Min( MaxSpeed*SoftMax, Vel );
Vel = Math.Max( -MaxSpeed*SoftMin, Vel );
if ( Math.Abs(Vel) < MaxSpeed+5) {
Motor.TargetVelocityRad = (Single)(Vel*Math.PI/30);
}
}
}
public override double GetAngle(){
if ( Motor != null ){
return -Motor.Angle+Offset;
} else {
return 0;
}
}
public override double GetDeltaAngle( ){
if ( Motor != null
&& Motor.Enabled && Motor.Angle < Motor.UpperLimitRad
&& Motor.Angle > Motor.LowerLimitRad) {
return -Motor.TargetVelocityRad*dt;
} else {
return 0;
}
}
sagepourpre 3 Mar, 2020 @ 12:15pm 
This example is not working. Error: IMyMotorStator does not contain a definition for UpperLimit and no accessible extension method UpperLimit.