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
You could also set up a sensor array to detect a block positined at the piston head, but that consumes a lot of space. ( i made my first multi-floor elevator that way)
I've figured out a workaround for this, but now my pistons are doing weird things.
Every now and then the pistons will just SPAZZ right out. They just shake all over like nuts. This is definitely going to cause problems when I include this set up in my ship yard. Right now I have all four pistons velocity at 0, and they're even off. Do I need to do something else to stop them from randomly spazzing out?
{
var args = CheckArgument(argument);
var offset = Convert.ToSingle(args[0]);
var pistonName = args[1].Trim();
var piston = GridTerminalSystem.GetBlockWithName(pistonName) as IMyPistonBase;
if (piston == null)
{
throw new Exception(pistonName + " was either not found or is not a Piston.");
}
var currentPos = GetPistonPosition(piston.DetailedInfo);
var currentVelocity = piston.Velocity;
var newPos = currentPos + offset;
newPos = (newPos > 10.0f) ? 10.0f : newPos;
newPos = (newPos < 0.0f) ? 0.0f : newPos;
if ((offset > 0 && currentVelocity < 0) || (offset < 0 && currentVelocity > 0))
{
piston.ApplyAction("Reverse");
}
piston.SetValue("UpperLimit", newPos);
piston.SetValue("LowerLimit", newPos);
}
private String[] CheckArgument(string argument)
{
if (String.IsNullOrEmpty(argument))
{
throw new Exception("No argument provided");
}
var args = argument.Split(' ');
if (args.Length != 2)
{
throw new Exception("Incorrect number of arguments");
}
return args;
}
private Single GetPistonPosition(string pistonInfo)
{
string[] pistInfArr = (pistonInfo.Split(':'));
string[] pistonDist = (pistInfArr[1].Split('m'));
return Convert.ToSingle(pistonDist[0]);
}
For example, to move a piston named Bob 2 meters your argument would be:
2 Bob
or for reverse
-2 Bob
Thanks so much for the help!
I've tried giving it the command to the group of pistons, but it doesn't seem to accept that run command.
So for the argument, do I just say something like "6 piston1 piston2 piston3"? To move those three pistons by 6?
The Pastebin is gone.....
You are in a obsolete discussion (2017) so I recommend that you create a new 2019 to ask the Froum Veterans cause the game is not the same at all now and still this year = Some Mods and Scripts have to be updated to run properly and be compatible with the "Economy game version".
Have you used the Workshop search tool to find one that is up to date?