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

Help needed to update simple script

$
0
0
Hello fellow Space Engineers,

I had a very rudimentary but working script that allowed me to change the color of a group of lights for a airlock from green to red or red to green depending on the status of the airlock. I know there are scripts out there for it but I just wanted something simple for it. Now with the update and the change to the Mod API, the code doesn't work any more and throws an error. Here is the code:
Code:
string Group1 = "Starboard Exterior Lights";
string Group2 =...
Help needed to update simple script

Request: Aiming thrusters

$
0
0
So. I have this project in SE. :D

Ok this is like the VTOL control problem, but in space. I have a movable thruster on each corner of this ship:
[​IMG]

It's a freighter for the feb UESC contest. So as of now have 2 weeks to figure out how to control these babies.
This ship in particular a work in progress but you get the idea. Each thruster can spin 360º and has an azimuth range of motion as well. Like most PMW turrets. (It's on my workshop friends-only...

Request: Aiming thrusters

Actual limits of script complexity

$
0
0
What are the current actual limits to script complexity? I've read that it's 10,000 method calls and 50,000 "operations" (I don't know if that means bytecode level ops or statements), but that source didn't cite where it got that info (ie, source code?) and I can't pull the source down right now to grep it out myself. I did also try searching, but didn't see any threads that seemed to call out the specifics.
--- Automerge ---
Nvm, found the answer, still...

Actual limits of script complexity

Microsoft Visual Studio - Intellisense stopped working with today's update.

$
0
0
Has this happened to anyone else? We got a stealth update I think today.

Has anyone tried to write code with the new dlls?

I don't know enough about VS to pinpoint what changed or if I accidentally set something amiss. But I am working from a template from a tutorial in the forums that was doing just fine last week.

Var + Group

$
0
0
Hello,
I have a question.
I Script a Program and I need the "var light1"

my script part:

var light1 = List<IMyBlockGroup> BlockGroups {light};

I want my Group of the interior Lights... i dont find the right way.

Have anyone a answer?

(Sory for my bad english.. I am German :D )

Script Solar Day Night Detector Tutorial (German, English)

$
0
0
German: (English under German)
Hier ein Extrem hilfreiches Script!!!

Was kann das Script?

Es erkennt wenn Sonne auf die Solar Panel trift und Deaktiviert automatisch Lichter (und andere objekte)

Was wird benötigt?
Ihr braucht:
3 Timer Blöcke
1 Programierblock
1 (mindestens) Solar Panel
1 LCD Panel

Zur Config:

Ihr müsst das LCD Panel in "LCD - Solar" benennen.
Anschließend 1 Timer in "D" und 1 weiteren in "N" benennen.
Ganz wichtig das Script nochmal Kompilieren!!!!

Den Letzen Timer...

Script Solar Day Night Detector Tutorial (German, English)

Small improvement on stock drone AI.

$
0
0
I've written some other stuff that is much more complicated that uses two programmable blocks and two timers and three remote blocks that splits up drone behaviors and the ability to bread crumb it's way back to a patrol route. Cool. But I found myself needing just a basic AI for some space drones. The stock AI is... okay. But I tweaked it a little... plus have a little out-of-script advice.

This thread is more for those at the entry level of scripting. I consider myself still there....

Small improvement on stock drone AI.

script UI sugestions

$
0
0
I am designing a script to network together many ship and station grids and i already have a framework and basic menu system in place. I am interested to know if anyone has found a good way to do inputs of sentences or longer commands without having to input them directly into a programming block/lcd. Any suggestions would be greatly apreciated

Concept: auto docking?

$
0
0
Has anyone done something like this:?
  1. In space, you fly your ship close to a station, but not super-precisely and with some clearance to obstacles.
  2. You press a button on the console, activating a programmable block.
  3. Program uses cross-grid communication antenna to send the location of your connector.
  4. The station receives the signal, and determines that you are close enough.
  5. A piston/advanced rotor/connector arm moves out from the station and locks onto your connector....

Concept: auto docking?

Dynamically Selective Merging

$
0
0
Is there a way to script/mod for a block to not be able to merge with other blocks on a certain side?

The application is for a shipping container system. Containers have a merge block on each of it's 6 sides for stacking. Whenever I attach 2 containers, the cargo container blocks are attached to other cargo containers, making it one continuous grid through the connection of 2 merge blocks....

Dynamically Selective Merging

Do I Have This Right?

$
0
0
My understanding of programmable blocks is that they can run for a maximum of one second, and every time you run them they get reset and everything gets reinitialized. So, if you have a for loop counting some numbers, such as a typical i = i+1, except that you only want to count a new iteration every time that you, say, push a button, this isn't as simple as just rerunning the block right? Because i will be reinitialized to 0. So if you keep manually running the block, it'll always...

Do I Have This Right?

Please help! DetailedInfo Line Casts an error

$
0
0
I've spent all day trying to make a script work.
Now I'm so close to my goal but this line casts an error.

"Input string was not in a correct form"

Code:
double RotorAng = Convert.ToDouble ((Rotors[0].DetailedInfo.Remove (0, 15)).TrimEnd ('°'));
What did I do wrong here? :)

Thanks in advance!

Get current angle of rotor

$
0
0
Hello Coders!

Getting the current angle of a rotors is something that has been somewhat of a problem for me. Because of this i set out to create a simple piece of code that could get said angle.

Below you will find some code that gets the current angle of the rotor.

Code:
void Main()
{
var rotorStator = GridTerminalSystem.GetBlockWithName("Rotor") as IMyMotorStator;

string info = rotorStator.DetailedInfo;

string CAngString = System.Text.RegularExpressions.Regex.Replace(info,...
Get current angle of rotor

3rd party script compiler

$
0
0
Is there a lightweight program that I can use to check if a script compiles without using the SE client? I sometimes work on scripts away from home and I'd like a way to check their validity on my lower spec laptop that can't run SE.

Get Programmable block that runs code

$
0
0
How can I get the programmable block that runs the current program within the program?

my script will crash every time when one of the blocks is destroyed or missing

$
0
0
my script will crash every time when one of the blocks is destroyed or missing
i am looking for another way
i do it this way now:

void Main(string argument)
{
IMyTimerBlock Tsaver = GridTerminalSystem.GetBlockWithName(itemname+"T [saver]") as IMyTimerBlock;
IMyTimerBlock Ttwo = GridTerminalSystem.GetBlockWithName(itemname+"T [two]") as IMyTimerBlock;
IMyTimerBlock Tfp = GridTerminalSystem.GetBlockWithName(itemname+"T [Floor plan]") as IMyTimerBlock;
IMyTimerBlock Tup =...

my script will crash every time when one of the blocks is destroyed or missing

Get thruster types and size without name

$
0
0
Is there a way I can specify the thruster type (ion, hydrogen, atmospheric) and its size in a PB program without sorting it by name?

Help: IsConnected & IsLocked obsolete?

$
0
0
Hello,

I am writing a script that is reliant on knowing when a connector can connect and when it is connected, but when I run it it says IsConnected & IsLocked are obsolete and the if's that are dependent on them are not triggering. What were they replaced with and what is the new syntax for finding those out?

I appreciate the help :)
--- Automerge ---
Nevermind,...

Help: IsConnected & IsLocked obsolete?

Block scripts requests thread

$
0
0
As programmable blocks came to SE, and not all players are programmers, I guess a thread with block requests is reasonable.

Basically, if you want a script on your block, post explanation here. Other programmers and I (Although I'm generally a busy person so maybe not often) will be more than happy to program it for you. Of course I still suggest you to learn programming, but you might not want to, and it's all fine. Other people like other things.
(Yes, I wanted to create website for that,...

Block scripts requests thread

Wheel Suspension Speed Limit not accesible through ingame scrips? Why?

Viewing all 903 articles
Browse latest View live