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

Drones [Solved]

$
0
0
Hey all, I've recently started modding space engineers, but I haven't really gotten into the in-game scripting yet. I've read this tutorial and have gotten everything right until it comes to the drone coming at the player. https://steamcommunity.com/sharedfiles/filedetails/?id=519946091 I use the script below in the programmable block (I actually got this script out of a programmable block on one of the default pirate ships). Anyway, I put the script in the programmable block, use...

Drones [Solved]

Precision Drill Speed Script needs some LOVE

$
0
0
Hi fellow Engineers,

one of my favorit scripts stoped working as of late and i need some help fixing it.



when started with the proper setup it should move the ship with about 0.1-0.3m/s forward (perfekt drilling speed)

but as of late it just shows some index error.

help is very much welcome since the original script vanished from the workshop and i sadly lack the skills to fix it.

Thanks in advance

I need an idea: how to select all block of type, specified by user?

$
0
0
My script allows for user perform operations over block groups. It have multiple filters to select a group and I want to add one more: "select all blocks of specified type".

But there is a question: how to specify block type?
For example, if user want to disable all hydrogen thrusters, it probably will use "hydrogen thruster". But is user want to enable override for gyroscopes - it can type "gyro" or "gyroscope" or "gyroscopes". Also "door" is hard one. because Sliding Door is also a door....

I need an idea: how to select all block of type, specified by user?

Quick Introduction to Space Engineers Ingame Scripts

MDK: Malware's DevKit for Space Engineers

$
0
0
https://github.com/malware-dev/MDK-SE

Currently at Release Candidate. I'm just one guy, I need your help to test this!

MDK-SE
(Malware's Development Kit for SE)

A toolkit to help with ingame script (programmable block) development for Keen Software House's space sandbox Space Engineers. It helps you create a ready-to-code project for writing ingame scripts, and provides an analyzer which warns you if you're trying to use something that is not allowed in...

MDK: Malware's DevKit for Space Engineers

Easy Automation (In Game Script)

$
0
0
Hello there, I just finished a script that I have been working on for a while now called Easy Automation. It allows you to access a bunch of different functionality by writing simple instructions in an LCD screen. Building this script was a learning process. I now know much more about programming then I did before. Check it out and let me know what you think.

Easy Automation (In Game Script)
http://steamcommunity.com/sharedfiles/filedetails/?id=566270789

Intro...

Easy Automation (In Game Script)

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)

Adding Needed Projector BP Components to Assembler

$
0
0
First post here. I'll jump right in. All the code in this post in a prototype state, but working.

I wanted to make a script to automatically add components to an assembler's queue, based on what blocks needed to be built on a projected blueprint. I ran into some problems, first with getting the names of the blocks needed, then with getting the required components.

What I discovered from the forums was that there is no in-game way of accessing most of this info. I looked at the source of a...

Adding Needed Projector BP Components to Assembler

Projector programming needs love

$
0
0
I've tried to search for this, but have yet to see anything newer than 2015, so I'm asking anew.

For the projector, the API documentation does not define how things work, such as the .LoadBlueprint (string name) and .LoadRandomBlueprint (string searchPattern). I noticed a thread on Reddit way back when that said LoadBlueprint required the full path to the blueprint, not just the name, and LoadRandomBlueprint didn't work. Since I remember reading that the PB is not supposed to be able to...

Projector programming needs love

MyDefinitionBase and Projector RemainingBlockPerType

$
0
0
I know that MyDefinitionBase is restricted and was wondering if there was some magical way to access say the DisplayNameString or something that gives me an idea of the block type when getting the RemainingBlockPerType from a Projector. Suppose a secondary question is what is the use of the RemainingBlockPerType if half the dictionary is inaccessible?
Code:
  Dictionary<MyDefinitionBase, int> RemainingBlocksPerType
 {
 get;
 }
I've been able to get the values from the dictionary...

MyDefinitionBase and Projector RemainingBlockPerType

Help with variable casting - Airlock Pressurize script

$
0
0
I am trying to create one snippet of code that will change which LCDs the ouput is displayed on, based on which Airlock is tasked to Pressurize/Depressurize. Currently, I have this:

Code:
public void Pressurize(int airlockNum)
{
    switch(airlockNum)
    {
        case 1:
            vent = ventOne;
            inDoor = inDoorOne;
            outDoor = outDoorOne;
            light = warnLightOne;
            airlock = "Airlock 1 ";
            inLCDGrp =...
Help with variable casting - Airlock Pressurize script

[SOLVED] Help with Exception handling - Vent Pressure snippet

$
0
0
So I'm writing a script for my airlocks, and I have a method for converting the % pressure from the vent's DetailedInfo into an int for status checking.

Code:
public int VentPressure(IMyAirVent vent)
{
    int vPressure;
    string info = vent.DetailedInfo;
    string[] infoSplit = info.Split('\n');
    string[] pressureLine = infoSplit[2].Split(':');
    string[] pressure = pressureLine[1].Trim().Split('%');
    vPressure = (int)Convert.ToDouble(pressure[0]);
    return vPressure;
}...
[SOLVED] Help with Exception handling - Vent Pressure snippet

Beacon and Antenna GPS

$
0
0
I think I may have found a way for drones to extract Vector3D info and create waypoints from Broadcasts (like Beacons and Antennas)

Each Beacon and RadioAntenna block creates a MyRadioBroadcaster object, which is an extension of MyDataBroadcaster class.

We can get a List of all broadcasters in a certain radius by using the public static MyRadioBroadcasters.GetAllBroadcastersInSphere(new BoundingSphere(Entity.PositionComp.GetPosition(), 0.5f), out list)

The MyDataBroadcaster class has a...

Beacon and Antenna GPS

[SOLVED] Help implementing complex numbers

$
0
0
I've finished coding the equations for quartic and cubic polynomials, but I'm running into an issue during execution of the code since the equation calculates a complex value. I have a class that I found online for using complex numbers, but I'm not exactly sure how to implement it in the script to actually return the roots in terms of (i) for those that are imaginary. The code for the cubic equation is where I've narrowed down my results to (by use of adding to CustomData and throwing...

[SOLVED] Help implementing complex numbers

Help, is it possible to check if a laser anttena has broken its laser designation.

$
0
0
So like the title explains is it possible too check if a laser connection is broken. For example if the active laser connection is broken trigger an alarm.

As of this moment iv'e only been able to check if "X" block is turned on or off but this doesn't have the functionality i would like.

Appreciate all replies and look forward to feedback

How to negate gravity with a missile (forward thrust only)?

$
0
0
I'm trying to miniaturize my intercept script from a drone into a missile. In order to drop excess weight to increase acceleration and decrease time to target, I want to drop all but forward-propelling thrusters. As such, I need to figure out how to negate gravity (and drift). What is the algorithm I need to calculate this? For example, currently I'm working on this:
Code:
		 /
	       / V
	a -> /
F ->	M> ---------------------> []
	|	     d		   T
	v
	g
F = ma
a = f/m
g =...

How to negate gravity with a missile (forward thrust only)?

Need we "ingame time since world creation" variable for ingame scripts?

$
0
0
There is ongoing discussion about request to add a way to obtain ingame time since world creation.
Saying in another way, to add Internal variable which represent count of logic ticks passed in the world.
It will allow to track scaled ingame time affected by SimSpeed in easy way.

Current way to track time is to use Runtime.TimeSinceLastRun. It works fine inside single game session. But it don't work then game load happens. This property have 0 as value inside Save method(), which prevents...

Need we "ingame time since world creation" variable for ingame scripts?

Gravity drive control comparison

$
0
0
A few remarks at the beginning:
Though you won't find any code in this thread, this is about programming. Specifically the control algorithm used in the two different solutions presented here without giving any details.
This thread is not to discuss the pro and cons of the gravity drive or using gravity drives in general. There are already numerous more or less emotional threads in this forum where you can do this. Not here, please ! If you don't like them, leave this thread and find...

Gravity drive control comparison

Translate position of a Ship using thrusters

$
0
0
Given a current position and a target position i'm trying to apply thrust to a ship to cause it to move toward the target position without changing the orientation(arbitrary) of the ship. I'm not even sure where to start.

Anyone have experience with this?

Characters created when copying code?

$
0
0
When copying a script from one programming block to another, I am getting the issue that extra characters appear to be created in the copy. Script was fine before, copy over and suddenly its got about 10% bigger and no longer fits in the programmable block, anyone know if there is a way around this?

I encounter this every time I try to update the drone AI for my ships using Rdavs fleet command.
Viewing all 903 articles
Browse latest View live