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

Yet another scripting system

$
0
0
I have been working on a scripting system for in-game programmable blocks for couple years and now again I am asking some feedback from fellow space engineers.

I have modeled the execution as a set of states: ActionState and JumpState. The execution of the states happens after delay as a call from timer block and then goes to the next state which is defined by the executed state. For JumpState the next state might change on execution. I have used a lcd as a persistence, because it seemed to...

Yet another scripting system

Recompile needed upon login

$
0
0
Every time upon restarting to our DS I basically have to manually recompile a couple of PBs that I'm currently scripting in.
Either there's something wrong or I'm being stupid here but basically initializing some instance members inside the default constructor doesn't seem to take place upon server startup.

Now this script relies almost entirely upon nested classes for the usual reasons of maintainability and me not going crazy over spaghetti code. No clue if that could be the issue but...

Recompile needed upon login

Advanced Modders/Scripters. How would you Scale an Autonomous Fleet?

$
0
0
Hi All,

Over the last few years of this game, I've been using the ingame and modder api's to program 'AI' drones as well as the underlying coordination and fleet logistics needed to basically build a Enemy player that is more significant than the basic Space Pirates.
To skip over the long introduction... Let's talk about scripting something like this.

Topics to cover:
Navigation
Entity Detection
Communication
Mining
Construction
Scaling - My main reason for this post. (so try to stay...

Advanced Modders/Scripters. How would you Scale an Autonomous Fleet?

Ore refining time script - i have some question, can you help me?

$
0
0
This is my 1 script :) hello Refinery ;)
Last time I was programmed I was kid, I have to program on C64 in BASIC and assembler. :)


Ore refining time script - i have some question, can you help me?

Getting Font type

$
0
0
Code:
IMyTextPanel panel = GridTerminalSystem.GetBlockWithName("panel") as IMyTextPanel;
            string selectedFont = panel.GetValue<string>("Font");
            Echo(selectedFont);
            panel.SetValue("Font", "Red");
A simple code I tried for checking the new fonts that DEV version has, I get exception that the property type is not string but MyTextPanel, which don't actually exist.
Trying IMyTextPanel also throw same error. :(

How do I compare a block property/how do I find it?

$
0
0
Hello everyone,

noob question here. I'm basically programming my own airlock script and want to check if the exterior airlock door is open. But I've got no clue how I can actually check that property. My idea was something like this:
Code:
IMyTerminalBlock ExteriorAirlockDoor1 = GridTerminalSystem.GetBlockWithName("Exterior Airlock Door 1");

if(ExteriorAirlockDoor1.Open==true)
{
 //do stuff
}
That doesn't compile, but how do I call on the "Open" property of the Doors?


I've...

How do I compare a block property/how do I find it?

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)?

Ore refine time script

$
0
0
This is my 1 script :) hello Refinery ;)
Last time I was programmed I was kid, I have to program on C64 in BASIC and assembler. :)


Ore refine time script

Log4PB - Logging/Debugging Lib

$
0
0
What is Log4PB?
Log4PB is a versatile loggin framework for Programable Blocks

Minified Version: Download
Current Size: 6355 chars.

Please like/subscribe here so I can keep trak of how many people are using this.


Feature highlights
  • Various logging...

Log4PB - Logging/Debugging Lib

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

Confused from programmable block

$
0
0
Hello guys,

Iam little confused about programming ingame. Iam not using it daily, also my main job is not a programmer. So between two programming attempts I always lost all my knowladge. Every time, I perfectly know what variables I need to use and complete math around them, but I always stuck on a way, how to get those values. I really missing detailed documentation (ideally with simple examples) of functions and methods in programing API.

It is nice, that there is some...

Confused from programmable block

CybillAI Update Thread

$
0
0
Because Steam only allows so many characters in the description and it can be tough to find
update posts in the comments section I am going to keep the updates to the script here in
this post.

Update 1:



It has been a few weeks since I made CybillAI available on my workshop, I see that quite a few
people have already subscribed. Today's update adds important optimization to Cybill's power
management and turret control code.

*Battery blocks are now...

CybillAI Update Thread

How to get position of a block? And matrices for dummies.

$
0
0
How to get position of a block? And matrices for dummies.
I am little bit puzzled - i wanna get a block's position relative to another block (say - a thruster to a cockpit, to decide - is it on a felf side of a craft or on right side of a craft).

I have watched some guides about this stuff (for instance one guys made a dron that follows you everywhere). I wanna replicate his results but i can't wrap my head around - how this game calculates position and speed?

So there is a function that...

How to get position of a block? And matrices for dummies.

Need help with gyro control logic - Greatly Appreciate any assistance

$
0
0
Hi guys.

I write a lot of code related to drones and making them do things like mine, dock, and stuff.. like that.
I'm having trouble with some simple... kind of simple logic that keeps tripping me up.

Here's the situation. I control the navigation of my drones by overriding the gyros and thruster's manually using code rather then using the good-Ai system.
The problem with the way I'm controlling the gyros is when a gyro is placed on grid facing a direction not matching my control block,...

Need help with gyro control logic - Greatly Appreciate any assistance

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)

Setup visual studio for SE programming

$
0
0
Latest update finally broke SE Workbench which I used for writing scripts, King, the user who made SE Workbench was last seen online few months ago and so I'm not sure if when when he will fix it.
I'm now trying to setup VS for SE but so far I've failed.
I'm not sure what files I need to refernce to and what Using statements to use, I have tried to follow an old guide I found in the forum but it did not help..

Monospace in color

$
0
0
How do I get characters to become a different color when using monospace font?
I've searched forums/google but can't find anything specific. I see most scripts are using a special character for each color and changing font to tiny to make pixels and programatically drawing stuff... however I just want plain text in different colors for now.

Simple Scripts gets "Script Too Complex" error

$
0
0
Hey guys i've been having a problem recently that prevents my script from working correctly.

I have a super simple script on a grid of 50 ish blocks that grabs the laser antenna with GridTerminalSystem.GetBlockWithName and then transmit a message. A sensor when activated runs the script with a short argument and it is that argument that is being transmitted by the antenna. However I often but not always get the "Script Too Complex" error message which is weird considering the script is...

Simple Scripts gets "Script Too Complex" error

Early Warning System

$
0
0
On my MP, I have had drones constantly popping up, and causing a bit of damage to my ships. Because of this, I have been trying to find a script which can basically activate an alarm if enemies are sighted and close up exterior doors by groups, and I have yet to find a script that can do this. I know you can attach an antenna to a programmable block but have yet to find a script that makes use of this to find enemies. Anyone have an idea for this??

PB display all blocks to LCD

$
0
0
Hey guys,

Im fairly new to scripting (ha have been for years) and im trying to get started in C# within SE.

i wanted to make a simple script that created a list ALL functional blocks on an LCD screen.

so far i have raided other scripts and tried using my limited knowledge to write it myself but always get the same error.

i have tried

List<IMyTerminalBlock> var = new List<IMyTereminalBlock>;
for (int i = 0; i < var.Count; i++){
/*output to LCD screen*/
}
but i always get 'cannot...

PB display all blocks to LCD
Viewing all 903 articles
Browse latest View live