Space Engineers

Space Engineers

XPAR Mimir (OBSOLETE)
Animal 6 Jan, 2016 @ 5:55am
Additional Methods
I've been learning to code, with Mimir, noticed that you didn't have a way to check a door's Openness. Wrote my own, figured I'd offer it to you to give back to the community. Also present is a simple two door airlock tool

List<string> pairedDoors = new List<string> () { "Sliding Door - Forward Airlock 1", "Sliding Door - Forward Airlock 2", "Sliding Door - Engineering Airlock 1", "Sliding Door - Engineering Airlock 2", "Sliding Door - Access Hatch 1", "Sliding Door - Access Hatch 2", bool IsOpen(string doorName) { IMyDoor block = (IMyDoor)GridTerminalSystem.GetBlockWithName(doorName); if (block == null) { Log("No block named " + doorName); return false; } if (!(block is IMyDoor)) { Log(doorName + " is not a door"); return false; } return (block.Open); } void Airlocks() { for(int i = 0; i < pairedDoors.Count; i+=2) { if(IsOpen(pairedDoors))
{
if(IsEnabled(pairedDoors[i+1]))
Apply(pairedDoors[i+1]+".Off");
}
else
{
if(!IsEnabled(pairedDoors[i+1]))
Apply(pairedDoors[i+1]+".On");
}
if(IsOpen(pairedDoors[i+1]))
{
if(IsEnabled(pairedDoors))
Apply(pairedDoors+".Off");
}
else
{
if(!IsEnabled(pairedDoors))
Apply(pairedDoors+".On");
}
} }[/code]

and slip this into Status()
if (block is IMyDoor) return ( (block as IMyDoor).Open ? 1 : 0);
Last edited by Animal; 6 Jan, 2016 @ 12:08pm
< >
Showing 1-15 of 28 comments
Animal 12 Jan, 2016 @ 5:02am 
And here we go, IsCharging() now can be used to test whether a jumpdrive is charging

EDIT: found a better way to do it in the Jumpington and Rolled it into the IsCharging() Method

bool IsCharging(string batteryName) { IMyTerminalBlock block = Fetch(batteryName); if (block == null) { Log("No block named " + batteryName); return false; } if (block is IMyBatteryBlock) { string recharging = FetchLine("Fully recharged", block.DetailedInfo); return (recharging != null); } if (block is IMyJumpDrive) { return (block.GetValueBool("Recharge")); } return false; }
Last edited by Animal; 13 Jan, 2016 @ 5:18am
Craig P  [developer] 25 Feb, 2016 @ 1:01pm 
Oh, nice, I wrote Mimir so long ago that those didn't exist! I'll roll them into the next update!

Keep in mind that I don't get notified if someone creates a new topic. :(
Animal 28 Feb, 2016 @ 8:31am 
I've made some more changes since, but i kinda dropped out of SE for a bit, pending further updates. I'll be glad to offer up any further extensions i've written.
Animal 28 Feb, 2016 @ 8:56am 
Made this to turn on and off some grinders based on a turret set up to detect characters, so bugs couldnt eat my base. Got to thinking maybe it could be dismantled and serialized to make a PseudoTimer() method?

/*List < IMyTerminalBlock > SensorTurrets = new List < IMyTerminalBlock > (); // create list GridTerminalSystem.GetBlocksOfType < IMyLargeTurretBase > (SensorTurrets); // populate it int SensorCount = SensorTurrets.Count; // count it for(int i = 0; i < SensorCount; i++) // check all the turrets { if ((SensorTurrets as IMyLargeTurretBase).Azimuth != 0 || (SensorTurrets as IMyLargeTurretBase).Elevation != 0)
{

if (SensorTurrets.CustomName.Contains("Interior Turret - Bio Sensor")) // if turret is a bio sensor ...
{
Apply("*BK.On");
ResetSensorTurret (SensorTurrets as IMyLargeTurretBase);
TimerCountBio = 3; // trying to make my own timer
}
}
}

//Built In Timers
if((TimerCountBio > 0))
{
TimerCountBio = (TimerCountBio - 1);
}
if((TimerCountBio == 0))
{
Apply("*BK.Off");
} */
Craig P  [developer] 28 Feb, 2016 @ 9:43am 
I haven't ever needed to use that kind of pseudotimer, but it might be fun to do a turret detection response!
Animal 28 Feb, 2016 @ 9:49am 
https://www.youtube.com/watch?v=FQ050ZlC1O4 Meet Oscar the Grouch, a SAM system I built. plans were to include laser turret networking, but Oscar got everything working using MIMIR and a single timer. Pseudo timers would be awesome for large vehicle doors and auto closing doors, good stuff for base management
Craig P  [developer] 28 Feb, 2016 @ 10:17am 
I'll take a look! Keep in mind that Ratatosk is a quick laser antenna network system based on Mimir.
Craig P  [developer] 28 Feb, 2016 @ 10:18am 
Heheh, that's shorter than I thought it'd be!
Animal 28 Feb, 2016 @ 10:26am 
In truth it's a pain in the ass to build, drilling out the ground to build it.
Animal 28 Feb, 2016 @ 10:43am 
i think i shall ahve to take Ratatosk apart later to see what evil i can carry out with it.
Craig P  [developer] 28 Feb, 2016 @ 2:26pm 
It's pretty easy. You can embed your current Mimir scripts inside of a Ratatosk install, it's the same library. Ratatosk is just a few functions on top of it.
Animal 5 Mar, 2016 @ 11:15am 
I just watched the ratatosk video, and oh my ♥♥♥♥♥♥♥ god remote commands i can make a garage door opener!!!!

Or even integrate it into my defensive outposts to trigger an alarm back at base
Last edited by Animal; 5 Mar, 2016 @ 11:36am
Craig P  [developer] 5 Mar, 2016 @ 12:30pm 
Sure, let me know if it mysteriously stops compiling!
Animal 5 Mar, 2016 @ 1:35pm 
Based on experience i'm more likely to have it throw an object does not exist error on game reload. Out of curiosity, does ratatosk do anything with the private text strings?
Craig P  [developer] 5 Mar, 2016 @ 3:05pm 
No, private text didn't work as of two weeks ago.
< >
Showing 1-15 of 28 comments
Per page: 1530 50