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

Request for smaller scripting improvements

$
0
0
Ok, here's my request for a few things that I stumbled upon while trying stuff with the ingame API :)
First there are missing whitelist entries for ingame scripting:

Sandbox.Game.EntityComponents.MyResourceSourceComponent.HasCapacityRemainingByType(MyDefinitionId)
Sandbox.Game.EntityComponents.MyResourceSourceComponent.RemainingCapacityByType(MyDefinitionId)
All other ByType-Methods are already accessible, these ones only via the Properties (bool HasCapacityRemaining and float...

Request for smaller scripting improvements

How to find values/properties of a block

$
0
0
To start off, yes I know how to find the basic terminal properties (I think thats what they're called) that look like this:

Laser Antenna
Implements
  • IMyLaserAntenna
  • IMyFunctionalBlock
Properties
  • OnOff: Boolean
  • ShowInTerminal: Boolean
  • ShowInToolbarConfig: Boolean
  • ShowOnHUD: Boolean
  • isPerm: Boolean
Actions
  • OnOff (Toggle block On/Off)
  • OnOff_On...

How to find values/properties of a block

Find Weld/Grind Speed with in-game script?

$
0
0
Can a script look up tool speed?
I really would love it if my auto welders had an idea of how fast they are able to finish a job so they don't skimp on the armour blocks which they cant check the integrity of because armour isn't a terminal block >.<
Right now the only way to be sure is to track steel plates going through which involves regulating how many get into the welder, which basically requires two sorting blocks and a container in an airlock system and even then you cant be sure the...

Find Weld/Grind Speed with in-game script?

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 ?

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.

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

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.
Viewing all 645 articles
Browse latest View live