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

Where to find latest source code?

$
0
0
EDIT: Solution: Download ILSpy (http://ilspy.net/) open SpaceEngineers\Bin64\Sandbox.Common.dll with ILSpy, go to Sandbox.ModAPI.Ingame and there you have the overview I was looking for. Thanks to Inflex.

Currently I am using https://github.com/KeenSoftwareHouse/SpaceEngineers/tree/master/Sources/Sandbox.Common/ModAPI/Ingame to learn about all the possibilities in ingame programming. But it seems this page doesn't get any updates anymore...
At this moment, for...

Where to find latest source code?

PB Sensor Feature Suggestions

$
0
0
Greetings programmers! I want to hear your suggestions for new PB features.

Disclaimers first: I'm not officially working on PB, it's just a pet project. Anything we discuss here is just for discussion sake, and will most likely never see the light of day.

After seeing how well everyone's reacted to the camera raycast, I've been thinking of other ways I can make more blocks useful. Instead of the PB magically gathering data from the ether, I want you to have to use blocks as sensors.

For...

PB Sensor Feature Suggestions

Taleden's Inventory Manager Auto Deployment Script, Type Less!

$
0
0
Github link: https://github.com/Therianulf/SpaceEngineersScripts
Steam Workshop link: http://steamcommunity.com/sharedfiles/filedetails/?id=847583443

I love Taleden's Inventory Manager, but I hate typing. So I wrote a script that does a lot of the typing for you by Tagging common blocks with [TIM] and whatever would be assigned to it. A good example of this is [TIM Ore] for any refineries on the grid.

I hope you enjoy, This is just the first version of the script so...

Taleden's Inventory Manager Auto Deployment Script, Type Less!

Get Blocks with name Tag

$
0
0
Hello,

is there a common solution to get Blocks by a Nametag.

for Example all Blocks with "Test - " in thier name.

I know there a multiple ways, but wich one is the most performant?

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

Problems with IMyTextPanel

$
0
0
Hello there.

I think there is something wrong, Visual Studio dont know about the CustomData proberty of a IMyTextPanel.

Ingame the code compiles with no errors

"Strafing" ships

$
0
0
Hey,

nvm, fixed it :)


I'm trying to get a ship to "strafe" without rotating to a given point but something is behaving silly.

At first it worked, but then i turned the drone around and it didn't work anymore.

It seems like the direction isn't updating but i'm new to Vector3's and Matrices so i'm not sure where i'm messing up....
(replacing matrix with rc.WorldMatrix or it's inverted version is giving the same problems)

Code:

bool PrecisionMove(Vector3D target,...
"Strafing" ships

Obtaining Filled % from a tank

$
0
0
I have been unable to utilize GetOxygenLevel() to obtain the fill % from a Hydrogen (or oxygen) tank. Here is what I have been trying:
Code:
void Main(string argument)
{
	var tankArray = new List<IMyTerminalBlock>();  
	GridTerminalSystem.GetBlocksOfType<IMyOxygenTank>(tankArray);
  
	float fillPercentage = tankArray[0].GetOxygenLevel();
}
The goal is to obtain all tanks (I can narrow it down to hydrogen only later) in an array and then average their "GetOxygenLevel()"s to find a...

Obtaining Filled % from a tank

Scripting Autopilot Forward Direction

$
0
0
Is there a way to designate the forward direction of a remote control via scripting?

EDIT: Got it, remote.ApplyAction("Forward");

Getting World Vector of a point 20 meters below current

$
0
0
I'm trying to create a Vector3D coordinate using GetPosition() of a block, and I want this new point to be 20 meters directly under it. I'm having trouble understanding the linear algebra methods to describe it.

Is there any way using only 2 programable blocks to make a timer like block?

$
0
0
I am trying to work around the bug where a projected/built timer block does not remember its actions (like a call to a programmable block, and then to itself to create a loop). In the past I would use a timer block and programmable block to perform multiple timed events (in this case for a missile assembly). With the timer block broken as I have described, I am at a loss to get another solution working. I have tried using programmable blocks calling each other, this fails when the...

Is there any way using only 2 programable blocks to make a timer like block?

Load blueprint into projector?

$
0
0
I can't seem to find any way to load a particular blueprint into a projector.. I can see all the manipulations to move one, but nothing to actually drop the blueprint in there to start with. Anyone know of a way to do it?

Is the foreach loop working in game

$
0
0
haven't done ingame programming in a while has this problem gotten fixed

Get grid length, width, height

$
0
0
Is there a scripting method to get the volume of space a grid is occupying?

Raycasting Implementation

$
0
0
Is anyone planning to revive script concepts (such as GFCS), rebuilt to rely on raycasting? I'd like to have some options for targeting PMWs that utilize this new system.

myAirVent.Status.ToString() unexpected report

$
0
0
If the air vent cannot pressurize (the air vent is exposed to vacuum), it will report whether it is attempting to pressurize or depressurize. It will not report "depressurized" at any point.

If the air vent can pressurize (the room is sealed), it will only report that it is pressurized, as if it is trying to report that it indeed can pressurize.

I don't have an issue with it, personally, I can use this to more easily open/close doors and execute the pressurization procedure, but I was...

myAirVent.Status.ToString() unexpected report

How can I use Linq extension methods?

$
0
0
Hello everyone.
I've been playing the game for a couple of weeks and recently I discovered the programmable blocks. Luckly, I don't have too much difficulty making scripts since I'm a C# developer for less than 2 years. So almost all my doubts come from the API and not from programming itself.

I was writing a script in which I used the FirstOrDefault extension method from Linq but for my surprise when I tried to compile the code in the game I got this exception:...

How can I use Linq extension methods?

Rotor's attached grid

$
0
0
Is there a way to find out which grid is attached to a rotor?

Something like connectors:
Code:
List<IMyShipConnector> connectors = new List<IMyShipConnector>();
GridTerminalSystem.GetBlocksOfType<IMyShipConnector>(connectors, x => x.CubeGrid == Me.CubeGrid);

...

IMyCubeGrid seachedGrid = connectors[0].OtherConnector.CubeGrid;
Thank you for the help. :)

Ingame Programming missing API and functions and known issues

$
0
0
So i've decided to sum up, what i'm mostly missing on blocks in ingame API
Please add things you want to see, or that should be here
Before i list missing APIs i add few known issue and possible circumvents

Some values are not available trough IMyTerminalBlock.GetProperties(), but you still can parse them from IMyTerminalBlock.DetailedInfo(which is enough, if you don't need to modify this values), list of detailed info strings can be found here...

Ingame Programming missing API and functions and known issues

Natural Gravity as an Integer

$
0
0
Hey guys :)

I have somewhat of a problem scripting...
I want to have the natural gravity as an Integer for further calculations, but the problem is I am not able to find a way to use the result of GetNaturalGravity()
I can't even add .Length() as mentioned in some posts...

Code:
IMyRemoteControl rc = GridTerminalSystem.GetBlockWithName("Remote Control") as IMyRemoteControl;
VRageMath.Vector3D gravity = rc.GetNaturalGravity().Length();
Which shows me this error
Natural Gravity as an Integer
Viewing all 903 articles
Browse latest View live