Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Space Engineers Ingame API Feature Requests

Discussion in 'Programming (In-game)' started by rexxar, Oct 10, 2017.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Phoera Senior Engineer

    Messages:
    1,713
    plugin already can do whatever it want.

    including, where is file must be stored?
    scripts compiled on server side, where on DS it must access that?
    where on client it must be? program code holder is only PB, nothing outside SE must hold data.

    in that way it will be anyway better just use VS(it's free you know?)
     
  2. rexxar Senior Engineer

    Messages:
    1,530
    That's not a feature request. That's asking us to fundamentally change how the PB works.

    Which isn't happening.
     
  3. [HEX] 0x00 Trainee Engineer

    Messages:
    8
    Its the other side of the coin. So If you see in my message only *pls change SE ingame code editor, because I want it* - its not what I meant.
    I guess I need to add more details to the question:
    Do you have any plans for changing Ingame Editor and do you have in the plans what I'm asking for? Or is it an approved and finished gameplay part which does not imply future changes? (like netcode or physics it can be upgraded to more powerfull tool)

    Sry for missunderstanding)
     
  4. Malware Master Engineer

    Messages:
    9,601
    You're asking for a huge project for use by only a small minority of the player base. I'm sorry, but this is quite simply infeasible. Most scripters use external editors anyway. There is no way Keen could reasonably make an ingame editor good enough for me to stop using Visual Studio. Pretty sure that goes for a lot of people.
     
    • Agree Agree x 2
  5. 1wsx10 Trainee Engineer

    Messages:
    24
    not quite PB API buuuuuuuut...

    fixing preprocessor directives:

    so you can't #define in the programmable block since it has to be before any code.

    why not use the c preprocessor instead since it doesn't worry about any syntax apart from preprocessor directives.

    i mean, the 'check code' button would run that through cpp before running it through the normal compiler. since the preprocessor removes all preprocessor directives, it wouldn't effect the c# preprocessor.

    edit: we don't really need __line__ etc... so maybe just grab the macro and #ifdef from c preprocessor and make a mini KPP. its all open source :p
     
    Last edited: Jan 28, 2018
  6. Phoera Senior Engineer

    Messages:
    1,713
    cuz C# don't uses it.

    C# have #if and etc, just not avaliable for PB(also i don't even see why it need in PB?)
    if you really wanna preprocess, use something external then.
     
  7. 1wsx10 Trainee Engineer

    Messages:
    24
    so? C# doesn't start you inside a class which requires you to close it if you want to make custom program extensions.

    you can run the c preprocessor on arbitrary text and it will do the same thing. afaik the C# syntax doesn't have anything that would count as a C preprocessor directive, that isn't already a C# preprocessor directive. so it wouldn't break existing scripts

    its useful for printing debug info without that going in the final product, and without the end-user getting unreachable code warnings
    its also useful for doing macros
    basically any reason you would want a preprocessor...

    why not bring an external cd player into your car?

    if it is built-in, everyone can use it. this also means there is less confusion for beginners.
    having a small build system also makes it easier to use for beginners or non-programmers that might want to get an early version off github, since the workshop doesn't give options for multiple working versions.


    lastly, this isn't a massive undertaking like building syntax-highlighting into the PB editor.
     
  8. zysen Trainee Engineer

    Messages:
    1
    Hello KSH,

    The PB feature that i would like to see would be some information about Welder Status.

    I have a 3d printer setup and would like to have the retracting pistons pause while the welders are welding. This should allow me to speed the process up significantly.

    I apologize if this is already possible and i just failed at google.

    Thanks
     
    Last edited: Feb 4, 2018
  9. Wanderer308 Trainee Engineer

    Messages:
    5
    I request proper setter APIs for wheel suspension block. Because... common Keen, so much time passed but there is still such gap in API for this block. Power, strenght, height offset, steer angl etc. There only getters, and no setters.
     
  10. BAM5 Trainee Engineer

    Messages:
    2
    The ability to get the same PoI/radio signal information that is available on the player hud via a radio type antenna. Such as Name & world position vector, also type of signal/affiliation? Not sure what it is that changes the colors of the font on the hud.

    As others have mentioned...
    For Sandbox.ModAPI.Ingame.IMyOreDetector have the ability to to retrieve what ores are currently being detected. For extra brownie points also the world position vectors of those ores!
     
  11. Wanderer308 Trainee Engineer

    Messages:
    5
    Since 1.186.2 there is still missing suspension block API for speed limit property and 'Add Top Part' action (adds wheel to suspension).
     
  12. SiBaz Trainee Engineer

    Messages:
    14
    Just thinking about the real world, a piece of kit, or interface I'd expect on most things that move around in 3 dimensions is a set of gyro's to give a consistent direction (such as a navball or artificial horizon, or something on a gimbal). In reality, you fire up your aeroplane, the gyro's spin up, and you calibrate it with your compass, and then whatever you do, it stays giving you a reference to the original starting direction.
    There are programmatic ways of deducing direction WRT the grid, but in the real world, it would be part of the cockpit, and so accessible via a PB. It would be nice to have something similar, even if that original directions is always fixed in SE.
     
  13. Blargmode Trainee Engineer

    Messages:
    21
    I want to know what oxygen tanks are connected to an air vent.
    I've tried using .IsConnectedTo(), but it does not work since the air vent does not have an inventory.

    So I'd like to have either a separate method for it or for the vents to have inventories in order to use the existing stuff.

    I assume there already is functionality for it since the vents must check that in order to pressurize. Is it possible to expose that to scripts?

    I guess this would be useful for thrusters as well.
     
  14. Elfi Wolfe Apprentice Engineer

    Messages:
    498
    IMyOxygenFarm.Enabled.

    It is not extended from IMyFunctionalBlock

    Only way to turn it on or off is to use terminal action
    IMyOxygenFarm de.ApplyAction("OnOff_Off");
    IMyOxygenFarm de.ApplyAction("OnOff_On");
     
  15. Arcturus Senior Engineer

    Messages:
    1,649
    I wonder if anyone took over API/scripting improvements when Rexxar left?
     
  16. Bullet_Force Apprentice Engineer

    Messages:
    348
    I suggest 2 new additions:
    • Allow the PB to access and control the Jump Drive in particular let it do blind jumps
    • Allow the PB to get the property for the ships heist above a planet. It is currently shown to the player on the HUD in meters but there seems to be no way to get it using the PB.
     
  17. Malware Master Engineer

    Messages:
    9,601
    @Bullet_Force Automatic jump drives are unfortunately deliberately disallowed from the PB. They have explicitly coded that action to not be available. It won't happen.

    The height above planets is already available from any IMyShipController derived block.
    Code:
    		//
    		// Summary:
    		//	 Attempts to get the elevation of the ship in relation to the nearest planet.
    		//	 This method is only available when a ship is within the gravity well of a planet.
    		//
    		// Parameters:
    		//   detail:
    		//
    		//   elevation:
    		bool TryGetPlanetElevation(MyPlanetElevation detail, out double elevation);
    
     
  18. Bullet_Force Apprentice Engineer

    Messages:
    348
    Thx for the code.
    @Malware Any reason why accessing the jump drive is deliberately disabled?

    Also I have 2 more suggestions:
    • Allow the PB to set GPS co ordinates to the remote control block
    • Allow the PB to pick from the pre-packed default sounds in the sound block. AFAIK its still not possible to make the sound block play a sound without first manually selecting it in the terminal.
     
    Last edited: Jul 28, 2018
  19. Malware Master Engineer

    Messages:
    9,601
    @Bullet_Force Yes, there are reasons. something-something-game balance and something-something lose your ship. Other than that I don't know.

    Both of those suggestions are already possible.

    Code:
    	public interface IMySoundBlock : IMyFunctionalBlock, IMyTerminalBlock, IMyCubeBlock, IMyEntity
    	{
    		//
    		// Summary:
    		//	 Gets or sets the volume level of sound
    		float Volume { get; set; }
    		//
    		// Summary:
    		//	 Gets or sets the range the sound is audible.
    		float Range { get; set; }
    		//
    		// Summary:
    		//	 Gets if a sound is currently selected.
    		bool IsSoundSelected { get; }
    		//
    		// Summary:
    		//	 Gets or sets the loop period of a loopable sound, in seconds.
    		//
    		// Remarks:
    		//	 This value is ignored if the selected sound is not loopable.
    		float LoopPeriod { get; set; }
    		//
    		// Summary:
    		//	 Gets or sets the selected sound.
    		//
    		// Remarks:
    		//	 The sound can be selected either by using the unique hash name, or the user visible
    		//	 text. Fetching the name will always return the unique hash name.
    		string SelectedSound { get; set; }
    
    		//
    		// Summary:
    		//	 Gets a list of all sound IDs this block can use.
    		//
    		// Parameters:
    		//   sounds:
    		void GetSounds(List<string> sounds);
    		//
    		// Summary:
    		//	 Plays the currently selected sound.
    		void Play();
    		//
    		// Summary:
    		//	 Stops the currently playing sound.
    		void Stop();
    	}
    
    Code:
    	public interface IMyRemoteControl : IMyShipController, IMyTerminalBlock, IMyCubeBlock, IMyEntity
    	{
    		//
    		// Summary:
    		//	 Determines whether the autopilot is currently enabled.
    		bool IsAutoPilotEnabled { get; }
    		//
    		// Summary:
    		//	 Gets or sets the autopilot speed limit
    		float SpeedLimit { get; set; }
    		//
    		// Summary:
    		//	 Gets or sets the current flight mode
    		FlightMode FlightMode { get; set; }
    		//
    		// Summary:
    		//	 Gets or sets the current flight direction
    		Base6Directions.Direction Direction { get; set; }
    		//
    		// Summary:
    		//	 Gets the current target waypoint
    		MyWaypointInfo CurrentWaypoint { get; }
    
    		//
    		// Summary:
    		//	 Adds a new waypoint.
    		//
    		// Parameters:
    		//   coords:
    		//
    		//   name:
    		void AddWaypoint(Vector3D coords, string name);
    		//
    		// Summary:
    		//	 Adds a new waypoint.
    		//
    		// Parameters:
    		//   coords:
    		void AddWaypoint(MyWaypointInfo coords);
    		//
    		// Summary:
    		//	 Removes all existing waypoints.
    		void ClearWaypoints();
    		//
    		// Summary:
    		//	 Gets the nearest player's position. Will only work if the remote control belongs
    		//	 to an NPC
    		//
    		// Parameters:
    		//   playerPosition:
    		bool GetNearestPlayer(out Vector3D playerPosition);
    		//
    		// Summary:
    		//	 Gets basic information about the currently configured waypoints.
    		//
    		// Parameters:
    		//   waypoints:
    		void GetWaypointInfo(List<MyWaypointInfo> waypoints);
    		//
    		// Summary:
    		//	 Enables or disables the autopilot.
    		//
    		// Parameters:
    		//   enabled:
    		void SetAutoPilotEnabled(bool enabled);
    		//
    		// Summary:
    		//	 Enables or disables collision avoidance.
    		//
    		// Parameters:
    		//   enabled:
    		void SetCollisionAvoidance(bool enabled);
    		//
    		// Summary:
    		//	 Enables or disables docking mode.
    		//
    		// Parameters:
    		//   enabled:
    		void SetDockingMode(bool enabled);
    	}
    
    
     
  20. Bullet_Force Apprentice Engineer

    Messages:
    348
    Who needs a code repository when you got a @Malware on the forum :D

    In terms of the Jump Drive I don't really see any real game balance issues with it. It would certainly be interesting for PVP and certain other uses.. ;)
     
  21. Malware Master Engineer

    Messages:
    9,601
    @Bullet_Force Well I wish you luck in convincing them to do something nobody has been able to convince them of doing for years... ;)
     
  22. Bullet_Force Apprentice Engineer

    Messages:
    348
    This is not an API request but closely related - would it be possible to increase the character count from 10,000 to something a bit higher?
     
  23. Wicorel Senior Engineer

    Messages:
    1,242
    How about 100,000! Done!

    But it's not going to go any higher of that because of the size of the transfer needed over the network.
     
  24. Bullet_Force Apprentice Engineer

    Messages:
    348
    The custom data field for blocks is 64k I'm pretty sure so surely it could be at least 64k for the program block.
     
  25. Malware Master Engineer

    Messages:
    9,601
    @Bullet_Force I tend to agree, this has been discussed before (of course, I mean what hasn't). I think the difference is how often changes will happen for a script while you edit and try, edit and try, edit and try... That's not as likely to happen with CustomData. There you just type in your text and is done with it, while scripting might cause you to make small changes and try for hours.
     
    Last edited: Jul 29, 2018
  26. Digi Senior Engineer

    Messages:
    2,384
    Add a reasonable cooldown for MP clients for re-editing PB scripts :p maybe set the cooldown higher the more characters it has.

    CustomData also doesn't have a limit I think? That maybe should get one...
     
  27. Bullet_Force Apprentice Engineer

    Messages:
    348
    Could a few serialization classes be whitelisted like BinaryFormatter?
     
  28. Malware Master Engineer

    Messages:
    9,601
    @Bullet_Force You can use MyIni for data storage. Serializing is a no go. All storage options are strings anyway.
     
    • Agree Agree x 1
  29. Chinchilla Trainee Engineer

    Messages:
    9
    This is a bit confusing to write, I hope it won't be so confusing to read...

    I would like to be able to detect blocks that aren't shared with the player who placed the programming block the script is in.

    Basically, I've got this script that outputs a graphical map of the grid that it's on. After many a few hours of trial and error, with practically no documentation to go on, I finally figured out how to detect the faction of a block on a grid. Unfortunately, if the block isn't shared with everyone, like say lights, thrusters, passenger seats, or armor blocks, it seems the block doesn't show up at all.

    I get that there's permissions stuff to deal with, but the programmable block should be able to know that a block exists and what faction it is. After all, players can view terminal blocks that exist but aren't shared with the player or their faction.
     
  30. Bullet_Force Apprentice Engineer

    Messages:
    348
    I would like a way for a script to be able to activate the "right click" action of the drill block ie the mining style that removes a lot of rock but doesn't collect any ores.

    I also got another request, its probably a long shot but here goes. Could it be allowed that one program block can replicate itself on other ones. Like copy itself and overwrite whatever script was in there and compile. I think this would add some unique interesting results.
     
    Last edited: Jul 30, 2018
Thread Status:
This last post in this thread was made more than 31 days old.