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

Inventory API change after update?

$
0
0
After the update, my inventory script stopped working. The code checker says "The type or member 'string MyObjectBuilder_Base.SubtypeName' is prohibited.'" The code in question is

Code:
var itemList = bl[i].GetInventory(0).GetItems(); 
  for(int j = 0;j<itemList.Count;++j){ 
  var it = itemList[j]; 
  string its = it.Content.SubtypeName + " " + ((it.Content.TypeId.ToString().Contains("Ingot") || 
  it.Content.TypeId.ToString().Contains("Ore")) ? it.Content.TypeId.ToString().Remove(0,16) :...
Inventory API change after update?

Update a script from a different computer

$
0
0
Hey everyone,

It's not exactly a programming but a workshop publishing question.

When in create a script in a computer A, I can of course download it on a computer B by the workshop but when I try to modify it I can't publish it in the same workshop object even if I download it with the same Steam account.
It seem that the script ownership is not linked to the Steam account.

Maybe the link is in a file ?

Auto pilot

$
0
0
Hi,

I want to try to make my own script to stop using the auto pilot.
Because I have really too much trouble with that, and the last update seem to make it even worse.

Before the update my drone where working fine on planet but now I have again those bugs (the drone approch the coordinate and then start to fly slowly up).

Then I want to make a basic script that tell the drone to go to position x and then run another thing (programmable, timer, what ever).

All scripts that I found on the...

Auto pilot

Ingame API Feature Requests

$
0
0
I know you guys have a million feature requests for the PB, so give them to me!

Be aware that the PB is limited by design. You probably won't get access to System classes.

Save And Restore State Of A Block

$
0
0
Is there a way to save the state of a block (all its properties and settings) and then at a later point restore it?

I am currently saving the On/Off state to the Custom Data field of the block but I would like a way to serialize all the other settings which can very from block to block.

Raycasting Not Working Anymore?

$
0
0
Edit: Figured it out, people on the discord were nice enough to help me. Not sure how to delete this thread.

full list of itemids or something equivalent.

$
0
0
hi ;)
im coding a control script for my sorters and for that i need a list of all component/ore/ingots ... ids.
aka anything that can land into a sorters filterlist.
the reason is i want to display a list of these items having the user select what he wants to be filtered,
but for that i need all the itemids to throw them at the sorters additem function.
i could create list by hand but that would exclude anything that comes from mods.

any idea?

Issue terminal commands to another ship?

$
0
0
Is there some script or programming that can access the terminal controls of another ship?

What I want to do is activate the Autopilot on a ship from another grid via a button press. You can do this via an Antenna and Remote Access, but what I'm looking for is essentially a shortcut for this function so I can do it with a single button.

This is actually an elevator driven by a Remote Control block and what I'm trying to put together is the "call elevator" button.

How can I roll my ship to align its floor with the floor of a station?

$
0
0
So I'm trying to make an automated ferry that will bounce around between 2 or more stations. To make this work really well, I want the ship to orient itself on the roll axis so that it's idea of "down" matches that of the station it's trying to dock at.

Unfortunately though, my knowledge of the in game API AND my knowledge of trigonometry leave a lot to be desired.

So, my first attempt was recommended to me on Reddit. Have a remote control in the front of the ship, a remote control on one...

How can I roll my ship to align its floor with the floor of a station?

Is there a getTime function?

$
0
0
I would like to know the time the block has been running or the sim time. when I use ray cast from a camera block it gives a timestamp but idk where to grab time to compare the timestamp to. I would love to get the time elapsed from last scan :)

Change Button Panel Via A Script?

$
0
0
Is it possible to change what the buttons on a button panel activate via a script?

Change Color Of A Block Via Script?

$
0
0
Is there a way to do this and if so what effect would it have on server performance.

Create And Edit Block Groups Via Script?

$
0
0
I am wondering is there a way to create and edit block groups via a script?

Set Share Inertia Tensor?

Ingame scripts on online server (dedicated) not working as expected

$
0
0
Hey everyone,

I have a script which couldn't be any simpler:

public void Main(string argument, UpdateType updateSource)
{
IMyFunctionalBlock thruster = GridTerminalSystem.GetBlockWithName("Atmospheric Thrusters") as IMyFunctionalBlock;
thruster.ApplyAction("OnOff");
}

In Offline mode this works just fine. I mean, why shouldn't it. (I have the thruster placed directly next to the programmable block, for testing purposes. Both blocks built and owned by me.)

Now...

Ingame scripts on online server (dedicated) not working as expected

Cryo Chamber Properties

$
0
0
According to API Cryo Chamber's have the following properties:

Code:
Actions
Name	Description
ControlThrusters	Control thrusters On/Off
ControlWheels	Control wheels On/Off
DampenersOverride	Inertia dampeners On/Off
HandBrake	Handbrake On/Off
HorizonIndicator	Show horizon and altitude On/Off
MainCockpit	Main cockpit On/Off
- https://github.com/malware-dev/MDK-SE/wiki/List-Of-Terminal-Properties-and-Actions#imycryochamber

I tested this ingame by jumping in one and trying...

Cryo Chamber Properties

Override Detailed Info

$
0
0
I think it would be quite handy if players could override the detailed info for a block and it replace it with some custom text.

For example the turret block currently displays nothing but you make a script that overwrote it and instead displayed how many bullets it had or how many shots it had fired.

Set Block Ownership To Neutral?

$
0
0
I know ages ago they removed the ability to "hack" blocks you didn't own but is it possible to assign a block you own to ownership: neutral or space pirates? You can do this via the terminal but you can do it via a script?

Generic GetValue Option?

$
0
0
I have been trying to do something like the following:

Code:
myBlock.GetValue<T>(prop.Id);
Basically I want to be use GetValue on the property of a block without first knowing if its boolean, float so on.

Is this possible in Space Engineers?

Currently I am doing:
Code:
if (prop.TypeName == "Boolean")
	 myBlock.GetValue<Boolean>(prop.Id);
}
else if(prop.TypeName == "Float")
{
	myBlock.GetValue<float>(prop.Id);
}
Etc
It would be nice to have more a more compact way of doing...

Generic GetValue Option?

How Does CubeGrid.GetHashCode Work?

$
0
0
I have been trying to find out a way to check a grid to see if it has been physically changed ie if a new block has been added or one has been deleted.

Currently I am simply fetching all the terminal blocks and counting them to see if they match an earlier count. This kind of works but if for instance someone deleted a door then replaced it was a beacon, it wouldn't detect a change as the totals would still be the same.

I am wonder would GetHashCode work for this or would the hash also...

How Does CubeGrid.GetHashCode Work?
Viewing all 903 articles
Browse latest View live