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

auto-sorting block by type

$
0
0
hi there,

i'm trying to make a system that could discover what is in the grid tu use it afterward (in form of lists)

i'v came with the following

Code:
  void main()
   {   
	//variable declaration
	int i;
	List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
	List<IMyTextPanel> panels = new List<IMyTextPanel>();
	List<IMyReactor> reactors = new List<IMyReactor>();
	List<IMySolarPanel> solPanels = new List<IMySolarPanel>();
	List<IMyBatteryBlock> batteries = new...
auto-sorting block by type

Need Help Understanding SE syntax

$
0
0
So I was having difficulty understanding the syntax of SE scripting since I had no knowledge of C#, but I do know .net, html, css, and some php. So i decided I would teach myself C# as well. So I went to https://channel9.msdn.com/series/C-Fundamentals-for-Absolute-Beginners and I've gotten to module 18 (Understanding Namespaces and Adding References to Assemblies), but I'm still having trouble understanding this thingy "&lt;", I know it means less than according to Textors' guide,...

Need Help Understanding SE syntax

Failsafe system

$
0
0
Hello! I built a system that, lets say, changes LCD text to "System online". It works from timer. But when you turn it off it will keep text of LCD to System Online (even tho its not online anymore). When you turn the lcd's on they will say online lie that will mislead the user. Does anyone have any idea how to make it so LCD clear/changes text when timer block is not working?

Async cannot be used in SE compiler it seems :(

[Create Cargo Ships out of your own Ships AI Request(?)] as per in the brackets

Boxing Bots - Team Recruiting

$
0
0
Hello fellows,
You can call me Dengue.
As the title says I am here ito show an idea or maybe more than just an idea,
maybe a proof of concept of a new script for spaceships.
That thing would bring the game to a whole new perspective and make the game a bit more fun and a bit more competitive.
So I tell what it is, first I need to say the concepts about it.
Concept of SpaceShip (bot):
images

http://prntscr.com/8qziv7
How it works is simple as it is, rotors are in places of joints...

Boxing Bots - Team Recruiting

Self Aligning Solar Array parsing problem in multiplay

$
0
0
I've written a small piece of code that runs every second to auto align the solar panels, and I've tried them in multiplay server. In the beginning it worked fine until certain point the parsing process malfunctioned. The program no longer parses the right info as max power output and instead shows a different reading from you can see in terminal. I wonder if anyone have seen the simliar problem and is it part of SE coding.

Finding actions for blocks?

$
0
0
I'm pretty lost with the (quite frankly very terrible) documentation for scripting. I need to know how to find the available actions for a block, but I cannot seem to find help anywhere on the internet or these forums for this issue. For instance, you can open doors with something like...
IMyDoor Door = (IMyDoor)GridTerminalSystem.GetBlockWithName("MyDoor");
Door.GetActionWithName("Open_Off").Apply(Door);

I'm lost though. How did the person who originally wrote this code know where to...

Finding actions for blocks?

IMySolarPanel.DetailedInfo returning 0kW Max and Current

$
0
0
Hi,

I modified a script that I found online to rotate my solar panels to face the sun as it passes overhead on a planet.
However, after I restarted my server for the latest updates, the DetailedInfo call now returns 0kW for both Max and Current Output even though both of those values are not zero.

Has something changed in the API?

Reprogram Toolbars from Programmable Block

$
0
0
Is this possible from the code exposed for the programmable block?

I thought this might be useful for multi-player (where Toolbars magically disappear). Being able to run a script and have the Toolbar set itself up again would be great.

My thought is to be able to read a toolbar, write the contents to an LCD, then be able to write the contents back to that Toolbar or a different cockpit/flightseat all all-together; which would also be great for setting up multiple flight seats or...

Reprogram Toolbars from Programmable Block

PSA: laser antenna communication WITHOUT the delay

$
0
0
When you run lazertenna.ApplyAction("isPerm") or lazertenna.SetValueBool("isPerm", true/false), this toggle option is actually saved on the receiver in real time. What this means is we've had cross-grid communication, without the massive sync delay, right under our gaze for some time! Weve known communication when you write a string to DetailedInfo but now you must also consider sending binary at 60 bits per second.

an idea for telling the receiver when a packet has...

PSA: laser antenna communication WITHOUT the delay

How to get inventory of cockpit?

$
0
0
For Cargo Containers this works by simply calling GetInventory, but for cockits and the like this seems to return null all the time.
Is it possible to get the inventory of a cockpit? And if so: How?

Orbital Supply Drop Script (Advice Requested)

$
0
0
Hello!

I've been working on an orbital supply drop script for fun which will stop a package before it hits the ground of a planet. The idea is simple: Let the object free fall until it is a certain distance from the ground, fire the thrusters until the package reaches a slow enough speed, and then maintain that speed until the object hits the ground at which point the thrusters will turn off.

Two scripts will run, the first would be an initialization script which will do the calculations...

Orbital Supply Drop Script (Advice Requested)

SE Auto Pilot stays clear from planet surface?

$
0
0
Good day,

I was doing some tests with the autopilot from the rc block and i noticed that the drone in this case
does not like going to a target which is below about 75 meters from the surface. This is without collision
detection turned on.

Is there anyway to bypass this or would the only option be to write an AI system tailored for the drone i
am working on?

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

Is it possible to calculate the mass of a ship?

$
0
0
I am trying to make cargo containers that will be shipped all across my server, however I have a limit on how much one can hold, simply because the ship design can't carry that much mass. So is it possible for a programmable block to calculate mass or all the cargo + blocks on it, since these are containers, I want to put a timer, programmable block and an LCD screen to show mass, and change it to red if its overweight.

Much appreciated for any help!

Compile error with generics

$
0
0
What is the current status of generics in scripts?

The following code used to work fine until a recent patch (don't know exactly which since I've been away from SE for a while), and now it fails after closing the editor (the type rewrite/inject phase I think):

Code:
public class MyTuple<T1,T2> {
	private List<T1> first; 
	private List<T2> second;
 
	public MyTuple(T1 a, T2 b) {
		first = new List<T1>(1);
		second = new List<T2>(1);
		first.Add(a); second.Add(b);
	}
 
	public T1 First()...
Compile error with generics

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)

Aligning ship to planet gravity

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

Nobody owns script

$
0
0
I'm looking for a script that when I press a button on a button panel a programming block sets all blocks to nobody, any ideas?

Find Planet Center

$
0
0
Threw this together because I needed the planet center coordinates for something else I'm working on.

For it to work you need a remote control and text panel (and a programmable block, obviously).

Run the PB with the following arguments:
1) "sample" takes a gravity measurement at the current location (using the first remote control it finds)
2) "calc" calculates the center point using all the samples taken so far and writes GPS coordinates into the first text panel it finds
3) "reset"...

Find Planet Center
Viewing all 903 articles
Browse latest View live