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

Editor

$
0
0
Currently, when I am Programming I use the ingame editor.
But it's limited, unless it has a few features I've overlooked.

A few things that I am missing are for example:
- PageUp/PageDown doing something (scroll a side or scroll a fixed nr of lines)
- A key to go to a specific line in the code
- A (sorted) list of all functions/classes (clickable or with line nr)
- double click select the clicked text (all char's connected by a letter/digit or underscore from the clickpoint)

Is any of...

Editor

North and South, and all that.

$
0
0
Hi

I want to script a compass. Apparently I can get the gravity vector using some method of a RC block called GetNaturalGravity() unless its been borked. But I don't know how to get the axial centreline of the planet except by dropping waypoints at the poles and copy/pasting the vectors.

Is there a better way ? or is it planetary survey time ??

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

[Solved] Rotate rotor to specified angle

$
0
0
As the title says, I want to rotate a rotor to a specified angle, taking the shortest route. This seems it shouldn't be too difficult, the only problem is due to the fact that 359 is a lot closer to 1 than 358 degrees due to overflow/underflow. However, I can't seem to get my script to work, and it is driving me crazy. Perhaps a new set of eyes might help?

Code:
	 if(angleCurrent < 0)
            {
                angleCurrent += 360;
            }

            if(angleTarget < 0)...
[Solved] Rotate rotor to specified angle

Great C# tutorial on YouTube.

$
0
0
I was surfing looking for explanations about dictionaries and found this series containing 102 tutorials on C# for beginners.

The first video has choppy audio. I'm not sure if that's just a problem in the first or first few, but I think the Youtuber figured that problem out.

#72, where I jumped in, was easy to understand and explained very well. I'm going to go back to #1 and go through all 102.

If you're a noob like me, this may be very useful to you. I just thought I'd share....

Great C# tutorial on YouTube.

Get nearby Antennas

$
0
0
Is there a way to get the position of nearby antennas.
I know it's doable with the new SendMessage function, but is there a build-in way?

So...I'm trying to learn how to program

$
0
0
i did read all of the guides that I can find, the issue is that I have no idea on the IMycubes thing and what do they do. I'm currently trying to do a solar alignment script(yes I know there are others on the workshop, but we have to start somewhere in coding). Soooo, any help?
Pesodocode:
Code:
Solarpanel=GridTerminalSystem.Get(IMySolar)
Maxpower=Solarpanel.powerOutput

//want to do name tagging thing here
RotorX=GridTerminalSystem.GetRotorWithName("[x]"OR "[X]")(x axis)...
So...I'm trying to learn how to program

Is there no String.Split()?

$
0
0
I might have it wrong but isen't there a split function for strings in C#?
Keep getting an error: "Cannot convert from string to char" when I try to split detailedinfo of a block.
I've looked up different tuts on check if anyone else ran into this issue but could not find anything :S

I'm trying to get the number of how long a battery will get depleted and do something at certain numbers.

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

Working on an Elevator Programme

$
0
0
Hello.
I have been working on a script to work with a 1x1 elevator I designed. As it stands, I am not knowledgeable enough to fix the errors I've been getting on my own.
Could someone help me out with making it compile in-game? I've commented the code as best I could so you'll know what my intent is.
What it should do:
  1. set pistons(marked by a tag) to a list and .count to an int
  2. calculate and pass(to pistons[divided across equally]) distance from current floor to destination...

Working on an Elevator Programme

Set iMyThrust.MaxThrust?

$
0
0
I'm working the kinks out of a tilt-rotor FCS script and I'm running into a brick wall. I think what I need is to be able to write to iMyThrust.MaxThrust (or maybe ThrustMultiplier) from my script.

I have a ship with four primary thrusters: two vertical lift (fixed, mounted on main grid) and two mounted on rotors. At current weight, output from two thrusters is just below that necessary to lift off.

I have modded up a "reference thruster" that looks like a standard armor block and provides...

Set iMyThrust.MaxThrust?

Anyone willing to help me with programming?

$
0
0
Hi, is anyone willing to help me to get started with programming (someone who I can ask anytime if I have questions, maybe chat in Steam?)

CustomData adds extra space to each line.

$
0
0
Whenever I copy and paste lines of text into the custom data field or manipulate the .CustomData string via code, there's always an extra empty space at the end of each line before the carriage return/new line, Environment.NewLine, etc.

I'm working with "MMaster's Automatic LCDs 2" and in order to manipulate the what's displayed on an LCD screen I have to access the custom data for that LCD.

Is there any way possible to get rid of that extra space (" ") attached to the end of each line?...

CustomData adds extra space to each line.

Need help with my Airlock Script

$
0
0
Hi

I have tried to create my own airlock script and
I thought I was very successful but then some random problems occured.
Some times the inner doors just won't open even if the oxygenlevel is 100% and all doors are closed.
Another thing that is bothering me is that when I move to quick from sensor1 to sensor2
or from sensor2 to sensor1 I need to leave the sensor area an enter it again to trigger the airvent.
I started learning C# 2 weeks ago so every advice is appreciated.

Code:
public...
Need help with my Airlock Script

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.

How to get the name of the block which is running the programmable block

$
0
0
Hi

Is there a way to get the name of the block which is running the programmable block?

Get the refinery output inventory?

$
0
0
Hello,

I wrote a script to output my ores and ingots in my inventory to a LCD-panel but i seem to be missing the ingots inventory of the Refinery.

I have been going through the inheritance structure but couldn't find any method or get property for the output inventory content?

With which instance, method call, or get property can I get the content of the output inventories?


Cursedth

Testing containment of a detected ship in a sensor's detection zone

$
0
0
I've been trying to test whether a ship detected by a sensor is actually contained within the sensor's detection zone or just intersecting, but I can't seem to get it to work right for some reason.

Code:
public string ToString(Vector3D vector)
{
  return string.Format("({0}, {1}, {2})", Math.Round(vector.X, 3), Math.Round(vector.Y, 3), Math.Round(vector.Z, 3));
}

public void Main(string argument)
{
  if(argument.ToLower() == "clear")
  {

  }
  else
  {
  var sensor =...
Testing containment of a detected ship in a sensor's detection zone

Log4PB - Logging/Debugging Lib

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

Minified Version: Download
Current Size: 6200 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

Is there a way to get battery remaining charge

$
0
0
Hello guys, i was writing some code for battery charge tracking, and i couldn't found a way to get battery remaining charge. .HasRemainingCapacity can only return true or false. Is there a way to get it? Thanks.
Viewing all 903 articles
Browse latest View live