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

Get nearby ships from antenna

$
0
0
Hi guys,
Pretty new to scripting in SE.
I want to write a script that warns me if an enemy ship is nearby.
After grinding duckduckgo for bits and pieces of documentation :p the best thing i found was:
https://fresc81.github.io/SpaceEngineers/interface_sandbox_1_1_mod_a_p_i_1_1_i_my_radio_antenna.html

Im decent with C# so all im looking for is a function that returns a Collection of some type T where i can check if T is hostile.
I thought the Antenna Interface was the first thing...

Get nearby ships from antenna

How to retrieve item name?

$
0
0
This was what I found on the internet:

string myItemName = myItem.Content.SubtypeName.ToString()

But that doesn't work, it fails with the an error:

'MyInventoryItem' does not contain a definition for 'Content' and no extension method 'Content' accepting a first argument of type 'MyInventoryItem' could be found

I assume that something has changed. I tried to get the new property names via reflection, but that didn't work out because it's...

How to retrieve item name?

Projection complete, done welding?

$
0
0
I'm trying to figure out how, in a PB, to tell that a projection is not just "complete", but that all the welding is done. Is there any way to do this, other than iterating over every block on the grid the projector is on, making sure it's complete?

error script IMyInventory.getItems

$
0
0
Hi,

I have the error of "IMyInventory.getItems" in my script for sorting Container.
I have tried many things but I can not solve this problem.
I put the codes below for those who want to look at it.

Code:
List<string> GetItemsList(IMyInventory inventaire)
		{
			List<string> ItemsList = new List<string>();
			List<IMyInventoryItem> items = inventaire.GetItems();

			for (int i = 0; i < items.Count; i++) ItemsList.Add(items[i].GetDefinitionId().SubtypeId.ToString());
			return ItemsList;...
error script IMyInventory.getItems

How Do You Get X,Y,Z Values From Raycast.HitPosition?

$
0
0
As of recently, I have begun programming a simple laser designator that works with a drone that my friend built a while ago. The script is all done and I have successfully achieved a functional raycast that records a set of coordinates from where the attatched camera hits with a raycast, however, I want to display the individual X Y Z values to an LCD screen so that the player can copy and paste it into their GPS list. If you could also help me to directly add coordinates to the players GPS...

How Do You Get X,Y,Z Values From Raycast.HitPosition?

Need Help With Guided Missile Script (Gyroscope Alignment To Vector3D)

$
0
0
Hey there, recently I have decided to take up the challenge of making a guided missile script / a gyroscope alignment system that looks towards a GPS coordinate. I am unsure of how I am supposed to go about this as I don't know how to align gyroscopes to Vector3D coordinates.

If you could help me out by just breaking it down to me and perhaps giving an example then it would be much appreciated, thanks! :D

Remote Control Commands, please help!

$
0
0
Hi, please can someone give me an example of a scipt with:

Set up remote control´s block Precision Mode_On,
Set Flight Mode to One Way,
and set up Forward Direction to e.g. Forward?

I can´t find appropriate commands anywhere.
And some simple script how to align text to the middle of LCD Panel please?
Thank you.

Newbie help

$
0
0
Been programming a long time, but never in C#. I'm trying to do the simplest of things in this language and just keep getting stone-walled at every attempt. I thought, as a way of getting introduced to the programmable block, I'd try writing a script that moves gravel from a refinery to a connector. That's it.
Well, since the APIs changed and I couldn't use any example scripts from before January, I just spent more than an hour in API documentation and now I'm getting an error that I...

Newbie help

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

Object reference not set to instance of an object/Please help a nub programmer

$
0
0
Hey guys,

I'm attempting my first decently sized script to automate a self-building elevator...I know...I know, its not worth it, and yada yada. However, I already have way too much time invested into the project to give up on it now. I compile the program, and it compiles fine, then when I run it, it throws: "Object reference not set to instance of an object" at me. I have checked all of the block names from what I can tell and they all seem to match up in the code with the terminal...

Object reference not set to instance of an object/Please help a nub programmer

Resource costs of components

$
0
0
Is there any API call that would tell me the resources needed to build the given component? E.g. the same info that the assembler shows when you hover over a component icon.

Couldn't find anything that looked like such...

It's there any way to get blueprint cost in assembler?

$
0
0
I want to know how many component will be used in a assembler blueprint
It's any way to get blueprint cost with in-game programing block?

What am I doing wrong here?

$
0
0
So I'm designing a ship with gravity drives. I'm using this script. Everything's working fine. That is until it randomly decides to not work anymore, and spits back an error message roughly equaling the following. What am I doing wrong and or how do I fix whatever the bug in the script is?


Caught exception during execution of script: Object reference not set to an instance of the...

What am I doing wrong here?

MDK: Malware's DevKit for Space Engineers

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

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 Space Engineers.

General features
  • Helps you create...

MDK: Malware's DevKit for Space Engineers

Game bug? Or a script bug?

$
0
0
Hello guys.

I'm troubled by the strange phenomenon that occurred when testing the program, so I want to rely on everyone's wisdom.

As I am Japanese and not very good at English, this sentence may seem strange.
I hope, however, you will read it to the end.



I have created a program that gives refineries the priority to refine stones in order to make mining easier.

Script URL(https://steamcommunity.com/sharedfiles/filedetails/?id=1704495618)

Specifically, the role of the...

Game bug? Or a script bug?

API or example script for the new LCD?

$
0
0
With the new update, 6 different possible LCD's in cockpits, 2 on the programmable blocks... heck knows how many more are out there.

So the question is how to access each of them?

For example, I want to set up one of the LCD's in a friendly fighter to list the heading/pitch change to point to the nearest enemy, as locked onto by one of it's turrets.

I'm not asking for the turret to LCD code, I'm asking for the actual code that references the LCD itself in the cockpit....

API or example script for the new LCD?

Writing to LCD Panels on the programmable block?

$
0
0
It says in the update that you can write onto the LCD's on the program block and other stuff, but I can't figure out how. Does anyone know?

Item Transfer Script throwing exception

$
0
0
Hey guys,

I've been trying to write a simple item transfer script so I can get the idea down before I write a larger script with this one incorporated into it. This one, I thought was going to be straight forward...but I keep getting this:

"Caught exception during execution of script: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary'2.get_Item(Tkey key)
at Program.Main(string argument)
at...

Item Transfer Script throwing exception

New cockpit LCDs usage

$
0
0
So..How do I use the new LCDs that are in the vanilla (and I assume also in modded) cockpits?
I understand I need to use IMyTextSurface? How exactly I tie it to a block? What would be the difference between it and using IMyTextPanel when refering to regular LCD which is not in a cockpit?

How to know how many LCDs there are, if at all and their order based on the index number?

Setting custom name

$
0
0
I'm not sure if I'm not doing it right but the old .SetCustomName still works buts is obsolete and says to use the setter of "Customname" but neither .SetValue("Customname", ) or .SetValue("CustomName", ) work. Is it not supposed to be a setvalue?
Viewing all 645 articles
Browse latest View live