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

Feedback on upcoming PB changes

$
0
0
Hey guys, I've been working on some big changes to the programmable block API and I would really like to get your feedback!

First off: reference exploits. I've removed two such exploits: IMyLandingGear.AttachedEntity and IMySensor.LastDetectedEntity. The landing gear attachment was never meant to be available to PB in the first place, so it's been moved up into ModAPI.

I know this has been a can of worms for a long time, but LastDetectedEntity has finally been sandboxed. Instead of...

Feedback on upcoming PB changes

Rotor-Bomb Script (IK for walkers)

$
0
0
For the past few months I've been casually working on a walker script that uses inverse kinematics. With my recent run-in with the limits of rotors, I rewrote most of my code today. I haven't tested the previous (mostly working) version since the last update, and my rotors seem to be acting strangely. Anyway, I figured maybe it's time to start getting some feedback on it. Oh, and for some reason, executing this now freezes my game.

Excuse the mess...
Code:
        IMyMotorStator[] rotors;...
Rotor-Bomb Script (IK for walkers)

Code compilation successful but does not work once run

$
0
0
Hi There, before I start I would like to let everybody know that I have no background in programming. Everything I've done below has been through reading tutorials and guesswork.

I'm basically trying to disable the rocket launchers on a small ship until a given set of GPS coordinates are reached. once at that point the launchers become active and stay active permanently (I know, I know, biting off more than I can chew most likely).

The reason for using GetBlocksOfType instead of the...

Code compilation successful but does not work once run

Last few problems with renderer code

$
0
0
I'm getting near to finishing the renderer code for the OS script I'm working on.
The method for rendering is designed to get the index of the screen to write to, an array of the text as well as the number of lines possible to write and width of the screen.
This is the code I wrote:

Last few problems with renderer code

Repair the cheat function allows you to scan the other players.

$
0
0

It is necessary to fix the function GetFreeDistance so that it works only on the view distance. the script used to search for other people's buildings and their destruction. You can not play multiplayer because finding any hidden construction.

1.123 compile error: (MyCubeSize) missing from namespace

$
0
0
The following code is getting a compile error. It used to work before 1.123.


Line 12: The type or namespace name 'MyCubeSize' does not exist in the namespace 'Sandbox.Common.ObjectBuilders', are you missing an assembly reference?

Does anybody know another way to get the current grid size? @LordDevious

And/Or is this a bug for 1.123?

My work-around is to hard-code the enum value (1) that I'm looking for.... but I'd rather not do that....

1.123 compile error: (MyCubeSize) missing from namespace

Aligning ship to planet gravity

$
0
0
Does anybody have any clue on how to approach this? :)

MyTuple broken?

$
0
0
Declaring 'MyTuple':
The type or namespace name 'MyTuple' could not be found, are you missing a using directive or an assembly reference?

Explicitly using VRage.MyTuple
Type VRage.MyTuple`2[System.Int32, System.Int32] used in <function> not allowed in script.

Extension Methods and Properties

$
0
0
This may seem trivial but is there a way we can use C# extension methods and properties? Like a static class with static methods doing all the customizing work.
I've been using Visual Studio to build my scripts and it seems I can't make it work.

Changing Light Intensity with PB's

$
0
0
Quick Question here, is it possible to change the intensity of a light using a programmable block?

And if so, How?

Align text to right side of screen

$
0
0
One of the features my ScreenDriver class has is the ability to write text on both corners of a line.
This is the following code that I wrote:
Code:
            public string AlignToRight(string textOnLeft, string textOnRight)
            {
                int txtLeftSize = CalcTextWidth(textOnLeft);
                int txtRightSize = CalcTextWidth(textOnRight);
                int ratio = 0;
                int divLeftOver = 0;

                bool wide =...
Align text to right side of screen

I Made a Cargo Drone Script

$
0
0
Hi everyone,

I made a script for cargo drones on planets.
If you have a mobile drill(or ship) with a connector On top (facing upward) and a sorter block directly under that, you can lock a cargodrone on it.

with this script installed in the cargo drone, it asks the mobile drill where it's connector is and which way it's facing. then flies to predetermined coordinates, connects to a connector, waits 5 seconds and returns to land and connect to the mobile drill.

The ship it launches from...

I Made a Cargo Drone Script

IMyTextPanel Properties: How do they work

$
0
0
I've been trying to remake my textpanel warp class , and after some digging I still don't understand how exactly text works.
Clearly, the default font has some not-the-same sized letters, and I already saw some of the render script definitions of character width. What unit are they using, and how does the font size and the size of panel factor in? Can anyone explain it to me?

Programmable block API documentation

$
0
0
Topic Permalink




EDIT: Keen now generates the documentation and the file Documentation.chm can be found inside the Tools folder in your Space Engineers game folder!



This documentation is no longer updated!





Hey everyone!

I've started documenting the in-game (programmable block)...

Programmable block API documentation

Closing door then turning it off

$
0
0
Hello,

I have a script which (eventually) will control airlocks on my ships and stations, but I have come across a problem. As the title suggest, I want to close the doors and then when they are closed, lock them until (de)pressurization have been completed.
Code:
void Main(string argument)
{
    string[] keywords = argument.Split(' ');
    switch (keywords[0])
    {
        case "Depressurize" :
            if (keywords[1] == "Begin")
            {...
Closing door then turning it off

Finally!! lag free VANILLA FLEET AUTO-Pilot concept! @@

$
0
0
After spending a year and a half and a lot of frustration in attempting grid to grid auto pilot, (not 700 seconds of lag in commands that is), learning that NO you CANNOT use the magic CONTROL action in IMyRemoteControl on a remote ship in script...come on ksw.. I had given up for a long time(waiting for api to change more honestly). I have decided to take another crack at it recently. I had an idea finally and I need idea on how to use the right actions and interfaces, any help really. my...

Finally!! lag free VANILLA FLEET AUTO-Pilot concept! @@

Spawn Spiders per Script.

$
0
0
Is it possible to spawn spiders or dogs per in-game script?

any ideas?

IMyTextPanel: API Method Change?

$
0
0
I've noticed after the update, IMyTextPanel has a method changed, particularly WritePublicText() (or GetPublicText() I can't tell).
The change is really subtle but it did break one of my scripts. I've been trying to figure out what it is, and I'm guessing it's an up limit on how many chars can be output per call. So far I can't figure out the mechanism.
Anyone has any insight on this?
It could be the thing that mentioned in the update list:
IMyTextPanel: API Method Change?

parallel processing, is pb capable of doing this?

$
0
0
Some scripts, like mine for example, fake a loading screen before proceeding doing whatever they were designed for.
However I'm sure that even the simplest of real life programs actually preform different tasks while showing the user a loading screen, as opposed to just wasting time.
I was wondering if programmable blocks can do that too or if they are limited to simple straightforward programs.

How to determine how much ship rotation happens per second based on gyro override value

$
0
0
I want a script to set a gyro override values to turn my ship to a target point that is X degrees in exactly one second. So the override value should be perfect so that the ship is pointing at the target one second after the script stops.

And how can I account for stopping time as well?

I'm in way over my head Physics/Math-wise.
Viewing all 903 articles
Browse latest View live