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

Wondering if this is possible.


[wip] kScript; a flowchart based graphical programming interface for space engineers

$
0
0
kScript (the K stands for Keen) is a little project I have been working on for the past few weeks, which will hopefully make ingame programming much more accessible. Most of you already know that a huge part of the playerbase can't use the programmable block because they don't have the time, skill, or just absolutely refuse to learn c#. I think it sucks that such an awesome feature is unusable to most of SE's players, so I decided to write a tool to fix that. As the thread title implies,...

[wip] kScript; a flowchart based graphical programming interface for space engineers

[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.

Need help with LCD panel method

$
0
0
This block of code does exactly what I want it to.
Code:
var screen = (IMyTextPanel)GridTerminalSystem.GetBlockWithName("LCD Panel");
screen.ShowTextureOnScreen();
This code throws an error.
Code:
List<IMyTerminalBlock> allScreens = new List<IMyTerminalBlock>();
GridTerminalSystem.GetBlocksOfType<IMyTextPanel>(allScreens);
allScreens[0].ShowTextureOnScreen();
This is the error:
"'Sandbox.ModAPI.Ingame.IMyTerminalBlock' does not contain a definition for 'ShowTextureOnScreen'...

Need help with LCD panel method

Need Help Understanding SE syntax

$
0
0
So I was having difficulty understanding the syntax of SE scripting since I had no knowledge of C#, but I do know .net, html, css, and some php. So i decided I would teach myself C# as well. So I went to https://channel9.msdn.com/series/C-Fundamentals-for-Absolute-Beginners and I've gotten to module 18 (Understanding Namespaces and Adding References to Assemblies), but I'm still having trouble understanding this thingy "&lt;", I know it means less than according to Textors' guide,...

Need Help Understanding SE syntax

Get power consumption of a single block

$
0
0
Is there any way to do this? I know that it was not possible a few months back, but since then the way you access the power from a programme has been reworked and this might have changed things.

The only way I can think of right now is to get the output of all batteries, solar panels and reactors and see whether that value changes when you switch the block on and off, and I really don't want to do that.

DetailedInfo dosen't work on IMyReactor

$
0
0
When i use DetailedInfo on reactor block, I get an error. Should it work without errors?

EasyAPI not functioning - Assembly Not Found

$
0
0
With the recent update a script called "EasyAPI" have ceased to function due to "assembly not found". I cannot get the script to work and I need it working ASAP. I've contacted the author of the codes but I'm not sure when the script will be updated to reflect the changes to the programming language.

I'm betting that with the recent failure of the EasyAPI that the Keens changed the C# programming language *AGAIN*!

Any suggestion of an API that works the same as EasyAPI and...


EasyAPI not functioning - Assembly Not Found

how to catch advaced rotor "Angle" value ?

$
0
0
hi,

I can get all other values but not "Angle" for rotor block.

var rotor = GridTerminalSystem.GetBlockWithName("Rotor_drill") as IMyMotorAdvancedStator;
float angle = rotor.GetValueFloat("Angle");

Object reference not set to an instance of object error.

float angle = rotor.GetValueFloat("Velocity"); - this and any other float variable work fine.

Is Angle disabled through script ingame ?

Dave

What's wrong whith my scripts with detailed info?

$
0
0
Firstly I was thinking that detailed info didn't work only for IMyReactor. Now it didn't work with rotors. What I'm doing wrong? Code:

Code:
void Main(string argument)
{
	//variables
	string angle_rotorx;
	string angle_rotory;
	IMyMotorSuspension rotorx = GridTerminalSystem.GetBlockWithName("RotorX") as IMyMotorSuspension;
	IMyMotorSuspension rotory = GridTerminalSystem.GetBlockWithName("RotorY") as IMyMotorSuspension;
	
	//angles checking
	
	angle_rotorx = rotorx.DetailedInfo;...
What's wrong whith my scripts with detailed info?

Index was out of range

$
0
0
Hi,

I am having issues with some code, it compiles but when I run it I get an error message saying:

"Caught exception during execution of
script: Index was out of range. Must be
non-negative and less then the size of the
collection.
Parameter name: index"

Code is as follows:
Code:
void Main(string argument)
{
  //Variables
  int numOfSolarPanels = 4;

  //Create List
  List<IMyTerminalBlock> solarPanels = new List<IMyTerminalBlock>(numOfSolarPanels);

  //Populate List
  for...
Index was out of range

IMySolarPanel interface is empty?

$
0
0
I tried to fix my old solar tracking script and found out that IMySolarPanel currently is empty.
How can I get current output, max output and defined output now?

localOrientation

$
0
0
Consider the code:
Code:
Matrix localOrientation;
gyroscope.Orientation.GetMatrix(out localOrientation);
currentVector = localOrientation.Forward;
Is localOrientation.Forward in relation to the ships forward direction, or a particular face on the block that is its 'forward' face?

Additional information for the programmable block

$
0
0
After my frustration trying to get certain basic physics information about the current grid, I managed to create a workaround by making a workshop mod to expose some otherwise inaccessible values.

This mod exposes linear velocity and acceleration (so you don't have to figure those out yourself), rotational velocity and acceleration, total grid mass, center of mass, thruster strength, thruster force and thruster min/max power consumption.

More information on the workshop page:...

Additional information for the programmable block

Rotation scripts

$
0
0
I want to know what the best way is to rotate a ship to face a certain direction by script.

I have been using the script below and it works fine. Most of it I've written myself (except for Joe's grid2world methods). However I have no idea if there is anything better out there. I would really like it if there was a rotation-method that ran faster (CPU-wise), or has less lines or just performs better to do the same thing. I am not really interested in "rolling", mostly pitch and yaw....

Rotation scripts

Tuning Thruster Control with PID

$
0
0
I have a script that works, well at higher speeds - it responds in a decent time and adjusts thrust accordingly with maybe a little yo-yo effect. But at low speeds its really not very good, if I set my target speed to 1m/s it will do fine if moving flat, but as soon as gravity is involved I get crazy yo-yo'n with the ship moving backwards and forwards.

I am looking for tips on how to tune this to get a good result with gravity. At the moment it will do, but I am a perfectionist, I want my...

Tuning Thruster Control with PID

Long range Lock-On concept, no turrets.

$
0
0
Hello, space engineers!
I want to share with you a concept of long-range lock-on.
It's described in this short video.

I will add script later and transfer this thread to "ingame scripting" tree.
But, since this feature can be of interest to all players, not only involved in ingame programming, and the possibility of lock-on weapons was discussed many times, let it hang a couple of days in general discussion.

UPD#1 Workshop item:...

Long range Lock-On concept, no turrets.

Comparing Block Orientations

$
0
0
Although I sometimes think I'm getting a good understanding of vectors and vector math, I have become confused once again.

My goal is to cycle through the all thrusters on a ship and compare the forward orientation to a positionReferenceBlock (which in my case is a cockpit that is facing 'forward' in relation to the ship design) and from the comparison add the thruster to the appropriate group (Forward, Backward, Left, Right, Up, Down).

I imagine the comparison would be something like:...

Comparing Block Orientations

Nobody owns script

$
0
0
I'm looking for a script that when I press a button on a button panel a programming block sets all blocks to nobody, any ideas?

Damage Reporter

$
0
0
Hello,

I have small problem with my code posted bellow.
I wanted to have simple dmg report, which would display only damaged blocks and how much they are damaged.
Problem is that, when one blocks is damaged. It will return all blocks from my ship, not only damaged.
What I missed? :)

Code:
//==========================Damage Report==========================
void main()
{
string DamageReport = "";
 
var AllBlocks = new List<IMyTerminalBlock>();...
Damage Reporter
Viewing all 903 articles
Browse latest View live