Quantcast
Channel: Programming (In-game)
Viewing all 903 articles
Browse latest View live

Get OxygenLevel

$
0
0
Hey guys,

have a question regarding my first selfmade script (using kscript^^)

undependent from the airvent status it passes first two cases and the doors are always off. programm can turn them off if initially on.
edit: i am getting closer, one direction now working. had to remove string argument

maybe a problem with the format of "GetOxygenLevel() == 0.00" ?

Code:
void Main()
{
  if((((IMyAirVent)GridTerminalSystem.GetBlockWithName("Airvent1")).GetOxygenLevel() == 0.00))
  {...
Get OxygenLevel

how to get GPS relative to position & direction?

$
0
0
Hi there, I'm currently on a drone script and it's almost finished. All i need is how to calculate an actuale GPS Coordinate.
I have a Position to which it should relate. What I need to know is how can i calc a GPS Position thats like 20 meters behind and 5 meters up of my current position.

I know how I can obtain my positon, but I have no idea how to calcualte the Position I'm looking for.

let me clarify this a little bit:

Code:
            IMyCockpit Cockpit =...
how to get GPS relative to position & direction?

Getting Font type

$
0
0
Code:
IMyTextPanel panel = GridTerminalSystem.GetBlockWithName("panel") as IMyTextPanel;
            string selectedFont = panel.GetValue<string>("Font");
            Echo(selectedFont);
            panel.SetValue("Font", "Red");
A simple code I tried for checking the new fonts that DEV version has, I get exception that the property type is not string but MyTextPanel, which don't actually exist.
Trying IMyTextPanel also throw same error. :(

Class for work with lcd as char grid

Obtaining Filled % from a tank

$
0
0
I have been unable to utilize GetOxygenLevel() to obtain the fill % from a Hydrogen (or oxygen) tank. Here is what I have been trying:
Code:
void Main(string argument)
{
	var tankArray = new List<IMyTerminalBlock>();  
	GridTerminalSystem.GetBlocksOfType<IMyOxygenTank>(tankArray);
  
	float fillPercentage = tankArray[0].GetOxygenLevel();
}
The goal is to obtain all tanks (I can narrow it down to hydrogen only later) in an array and then average their "GetOxygenLevel()"s to find a...

Obtaining Filled % from a tank

Vanilla Animated GIF Player for LCDs

String class extension for string width measuring with default font

$
0
0
There is an extantion for string class with some methods in purpose to measure string width.
https://gist.github.com/krypt-lynx/497a0b8846705846038ea3f5cf8579bd

It contains:

public static int Width(this string str, char lead = '\0')
returns width of string str
lead
is previous character in line, will used to calculate kerning, if nessesary

public static int Width(this char ch)
returns width of char ch

public static int Kern(this...

String class extension for string width measuring with default font

Log4PB - Logging/Debugging Lib

$
0
0
What is Log4PB?
Log4PB is a versatile loggin framework for Programable Blocks

Minified Version: Download
Current Size: 5248 chars.

Feature highlights
  • Various logging destinations, including
    • DetailedInfo (Echo)
    • TextPanels
    • Kryp's...

Log4PB - Logging/Debugging Lib

Passcodes in Space Engineers!

$
0
0
Hey Hey Peoples! =)

i saw here is a Forum for In-Game Scripts.
So i wanted to show you my Script for Passwords in Space Engineers, you are safe now from unauthorized guys in you part of the Station!

Here is the Link:
http://steamcommunity.com/sharedfiles/filedetails/?id=744883945&searchtext=passcode

The Script can do much more as just unlocking a door, you can toggle everything with it! =)


So Thanks to my Friend who helped me an did the most Work on it! =)

And Bye bye! =P

New Camera Raycast and Sensor API (Update 01.162 DEV)

$
0
0
by Rexxar:
--------------------------------------------------------------------

This week brings several big changes to the programmable block API. The major features are:
  • IMyRemoteControl.GetFreeDestination has been removed
  • IMySensorBlock.LastDetectedEntity no longer returns an IMyEntity reference, instead returns MyDetectedEntityInfo
  • IMyCameraBlock has new raycast functions to replace GetFreeDestination
  • New MyDetectedEntityInfo struct to contain information...

New Camera Raycast and Sensor API (Update 01.162 DEV)

Communication Satellite bugs

$
0
0
I'm currently working on a new communication satellite.
It is desgined to work at low altitude (15km to 18km for use without relay in the middle) and has modded solar panels for extra power
and transmite data using the antenna communication mod.
I'm currently at the stage of writing code that display information on an LCD screen, and here I have the problems:
1) Only the options of the main menu show, the title however does not.
2) Choosing any of the options cause the LCD to display the...

Communication Satellite bugs

Need help for this script

$
0
0
need help for this script:
merges doesn't turn on or off when a rotor has a certain degree range
maybe the problem is in the getMerges() method because i used IMyTerminalBlock ???
or maybe it's the FOR inside a FOR in the magneticEngineStart() method.
ty

Code:
        
	private string rotorsName = "[ME";
        private string mergesName = "[ME";
        private string gyrosName = "[ME";
        private string arg = "";
        private int started = 0;

        private...
Need help for this script

Taleden's Inventory Manager

$
0
0
Latest version: 1.5.0 (2016-05-24)
Steam Workshop Page
User's Guide

Taleden's Inventory Manager (TIM) is an in-game script which automates the management of your inventory, refineries and assemblers. It combines and expands on the functionality of the Automated Inventory Sorting mod and the Crafting Components Quotas and Refinery Manager...

Taleden's Inventory Manager

Question to Vector Angle

$
0
0
found my error :)
i should use arccos of the angle, cause both are normalized (uvDist and vFront)

Satellite gravity awareness and thrust managment

$
0
0
I'm trying to write code to make my satellite aware to the gravity well (that it may be inside of).
I've been reading few of the posts here about doing that and on how to rotate a ship which is inside gravity well,
however I did not understand enough as of how it works.
Basically I'm trying to make gravity stabilizer so the satellite will keep the position it is on and rotation of the satellite, so down facing thrusters will keep facing the right way and it won't fall from the sky because of...

Satellite gravity awareness and thrust managment

Transfer items from one container to another - Example please?

$
0
0
Here is a method I've wrote, it's missing the code to transfer items from container to container[k].
Please could you write in the simplest way to transfer all of one containers inventory to another container with the room, as in the missing section below.

Code:
private void take(string take)
{
    int droneStorageContainers = 16;
    if(take == "all")
    {
        List&lt;IMyTerminalBlock> container = new List&lt;IMyTerminalBlock>{};...


Transfer items from one container to another - Example please?

Naed's Market Script - No mods

[Beta] Space Engineers Workbench - A feature rich IDE for Space Engineers program development.

$
0
0
Hello all. My name is Tim and I'm a professional and hobbyist software developer. I had posted my original thread in the modding forum, but I think this forum may be more appropriate. For the last few weeks, I've been developing an IDE specifically tailored for writing Space Engineers programs. I've made a lot of progress in the last week and I feel like it is fairly stable and ready for a beta release.

I'm the only one developing it and it's in my spare time, so one thing I'm really...

[Beta] Space Engineers Workbench - A feature rich IDE for Space Engineers program development.

I need a script updated...

$
0
0
I need this scripts updated as it no longer works and i do not know script.
http://steamcommunity.com/sharedfiles/filedetails/?id=367676577

The error is:

Code:
//Change this to the Antenna Name you want to modify
string origname = "Cargo...
I need a script updated...

Saving/Loading data from Storage in format of "file"

$
0
0
Another class I'm working on which will be importent for the satellite script and for the ship OS script is a
class the utilize the Storage variable and store data in format similar to real computer file.
Basically each "file" will have a tag to indicate its beggining and end inside the string, as well as name, creation date,
possibly last alteration date and pincode to determine if there is premission to read it. (ignoring the fact that its still possible to
simply read all the data from...

Saving/Loading data from Storage in format of "file"
Viewing all 903 articles
Browse latest View live