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.

Modding API - new requests

Discussion in 'Modding API' started by joeblack616, Oct 22, 2014.

Thread Status:
Not open for further replies.
This last post in this thread was made more than 31 days old.
  1. midspace Senior Engineer

    Messages:
    2,224
    The skybox is a texture, that is defined in the Environment Definition.
    A custom skybox usually implies a modded Environment Definition.

    That would be cool, but I'm not sure Keen has set up the code to allow a moving sun as yet. Or one that flares bright and blacks out before emitting solar flares (but considering I just had a play with MinerWars recently which had random solar flares, I think Keen would be accused of simply copying their old game if they implemented solar flares).

    I was thinking it would be nice if we had the sun's direction, to create automated solar panel tracking through any connected rotors.
    And if the sun was too dim (considering the skybox's environment definition), that it would simply switch off tracking.
     
    Last edited by a moderator: Nov 14, 2014
  2. Ravenal Apprentice Engineer

    Messages:
    362


    I so agree with you on that, that would be awesome!
     
  3. Ravenal Apprentice Engineer

    Messages:
    362

    I so agree with you on that, that would be awesome! I just came up with an idea too, make it so that my system that I am using on a large ship could have a satellite rotate to keep it'self focused on the sun when I create an orbital movement, this is something that will be really handy
     
  4. Vdragon Apprentice Engineer

    Messages:
    326
    Could we have a function to add blocks to a grid?
    That would be something like Grid.Add(Vector3I Position, string SubtypeName)
    or Grid.Add(MyObjectBuilder_CubeBlock cube)
    And a way to create dummy players/controllable animated dummy thing which would take a name and a npc id to create?
     
    Last edited by a moderator: Nov 14, 2014
  5. soat7ch Junior Engineer

    Messages:
    605
    Well, i am pretty sure you can not only read those values but alter them as well. Guess that's how all those super dark skyboxes were made.
     
  6. Ongy Trainee Engineer

    Messages:
    1
    Hi,

    I have a few requests for the API

    We plan to create a adventure type of map and we would need access to a few things, I have not seen in the API.

    First of all: this may all be me beeing blind and stupid, if that's the case please point me to the correct resources.

    1. Access to player gamemode (set to spectator when they die instead of respawn, set to survival when starting a new game)
    2. Access to player current health, to heal/damage player
    3. A way to block jetpack/build/weld, for a mission part, where features are broken by the story
     
  7. midspace Senior Engineer

    Messages:
    2,224
    Existing mod that blocks jetpack.
    http://steamcommunity.com/sharedfiles/filedetails/?id=318021627&searchtext=

    Script that blocks construction.
    http://forums.keenswh.com/post/show_single_post?pid=1284556568&postcount=275
     
  8. Malware Master Engineer

    Messages:
    9,705
    Please move the IlCompiler initialization code somewhere I can call it without hacking into the game code. I want to quickly be able to check if my script code is valid without having to start the game. While I can easily hack your game to do what I want, since it is a couple of simple methods without any dependencies, I REALLY DO NOT want to do that. Hacking BAD. I'd much prefer having a legal and officially supported method to do this.
     
  9. Muse Trainee Engineer

    Messages:
    7
    I would really like access to GUI code.

    Specifically, I'm looking to be able to open a simple window with a scrolling textbox and a single text entry + enter button / enter button shortcut key at the bottom. Just a console.

    Being able to reference other libraries would be nice, too.

    I want to add a "Master Computer" block with monitor blocks that can be interacted with to bring up a DOS prompt, and the ability to create LUA scripts to perform simple functions.

    Just a higher level access to the API in game. With the GUI code I'm pretty sure I can do that. Writing a LUA interpreter isn't the most difficult thing.
     
  10. fabricator77 Apprentice Engineer

    Messages:
    399
    +1
    I've been manually adding factions and adding NPC/neutral players to it, by editing the xml.
    However there isn't a way to add players, looks like I have to prompt the player to join a faction, and set the faction to auto accept.
     
  11. joeblack616 Apprentice Engineer

    Messages:
    225
    Hi guys,
    sorry for not being active here. But don't worry I read everything.

    I will clarify sun related thing at Monday in team. Also I will check faction stuff and adding cubes (right now I'm at home and don't have access into code) into cubeGrid. Sorry that I have no answers yet, I just wanted to let you know that I'm alive :D
     
  12. Sp[a]cemarine Apprentice Engineer

    Messages:
    101
    Great to hear that! :D

    By the way, the mission dialog is very nice, but for more intuitive handling, I'd like to suggest to create a 'cancel' button or the possibility for us to add this button. Pressing it should do the same as what pressing the 'X' button does. The reason is quite simple: The 'X' is quite small and it might confuse people that they can only press 'Ok' (regarding missions I'd label it 'Accept' but that's not important when I can change it) because they don't notice the 'X'. Furthermore it would better fit in the usual windows design the people are used to.
     
  13. midspace Senior Engineer

    Messages:
    2,224
    We require a way of determining the difference between a FloatingObject and a Meteor from an Entity without having to call GetBuilderObject().

    We can check if the entity has an interface. We have a IMyCubeGrid for ships/stations, IMyVoxelMap for asteroids, and IMyControllableEntity for players. But nothing specific for either FloatingObject or Meteor. An IMyDestroyableObject actually covers both of them, but doesn't distinguish between them.
     
  14. midspace Senior Engineer

    Messages:
    2,224
    I'm trying to understand how this is relevant to the API. :confused:
     
  15. midspace Senior Engineer

    Messages:
    2,224
    Is there a better way of checking the ISlimBlock.FatBlock.BlockDefinition.TypeId?
    The MyObjectBuilderType only allows comparison directly against a single type.
    There does not appear to be any method for checking if a block inherits from a particular type.
    Ie., checking for any Rotor base, by using MyObjectBuilder_MotorBase, instead of checking

    By being able to use this...
    Code:
    if (block.FatBlock.BlockDefinition.TypeId.InheritsBaseType(typeof(MyObjectBuilder_MotorBase)))
    
    Instead of....

    Code:
    if (block.FatBlock.BlockDefinition.TypeId == typeof(MyObjectBuilder_MotorAdvancedStator) ||
    block.FatBlock.BlockDefinition.TypeId == typeof(MyObjectBuilder_MotorStator) ||
    block.FatBlock.BlockDefinition.TypeId == typeof(Yet Another Rotor))
    
     
  16. joeblack616 Apprentice Engineer

    Messages:
    225
    Hi,
    would you like to have interfaces for concrete block ? E.g. Sensor, rotor, gravity generator. I don't mean logic now, but I notices that you would like to have access to sensor field size. Would you like to have other blocks available ?
     
  17. tyrsis Junior Engineer

    Messages:
    862
    Yes. Unless you can think of a better way of accessing properties of concrete blocks. Right now there is 0 choice of updating things that are specific to blocks. There needs to be something. An interface to each of these concrete blocks is fine.

    In fact, you should just mirror the MyObjectBuilder_ with interfaces.
     
    Last edited by a moderator: Nov 24, 2014
  18. Ravenal Apprentice Engineer

    Messages:
    362
    I'm with you there, this may help later when we can create our own functional blocks
     
  19. herichimo Trainee Engineer

    Messages:
    60
    I would like to see an anti-gravity generator. Designed to nullify the effects of selected gravity generator.

    That, or some grav projectors that work in only specific directions/hemispheres. i.e. not centered on the generator but projecting out away from it.
     
  20. botelhorui Trainee Engineer

    Messages:
    53
    hello there,
    I'm new to Havok physics engine.

    I'm trying to make an autopilot, but I dont have enough precision on the ship movement/rotation.

    I would like to have access to read-only physics properties of a ship, like center of mass, aplied forces, moments of intertia (linear and rotational), etc.
    Those you have in Havoc entities.
    Also the constants the that Space engineers uses for havok simulation. Like timestep for example.

    I have been reading space engineers source code and reading havok manual. And it seems you use impulses to move the ship. You also use dampening for linear and rotation. Where can I get those values?

    I need to use those values in the equation of 3D movement, so that I can have precise movement of ships.

    For example, I will want to make a flight formation of 3 ships, I pilot the middle one and the others 2 are autopiloted. Currently this doesn work well because positions and alignments are not precise enough.

    Thank you
     
  21. midspace Senior Engineer

    Messages:
    2,224
    A lot of these properties should already be available through the Sandbox.ModAPI.IMyEntity.Physics property.
    Physics is a MyPhysicsComponentBase, which has LinearVelocity, LinearAcceleration, LinearDamping, Mass, CenterOfMassWorld, AngularAcceleration, AngularDamping, AngularVelocity, and many others.
     
  22. botelhorui Trainee Engineer

    Messages:
    53
    thanks. I didnt know that.
     
  23. midspace Senior Engineer

    Messages:
    2,224
    I was thinking, we could also use a method to open the steam overlay, and open a webpage.
    I know it sounds risky, but the allowed urls should be whitelisted, and should only allow the steam community domain.
    That would allow us to open up own workshop or guide pages.
     
  24. fabricator77 Apprentice Engineer

    Messages:
    399
    I did play round with some of the ship Physics, with LinearVelocity it's relative to the ship, y is forward.

    One issue I see, is not having any feedback on what the ship is actually doing.
    When I fly a ship, I can see from the side/up/down thrusters, and the screen, that the ship is no longer turning. But if you give the ship a target position/rotation, you don't get feedback on what the thrusters/gyro is actually doing.

    To be honest I'd like to see some sort of ship controller helper/example, which would also open the door to smarter NPC ships.
    At a basic level can give it commands like "look at", "turn to", "move to", "move and turn to", "accelerate to (Vector3D)" and the script will deal with the finer points, with optional auto dampeners on/off.

    I had to hack my mission/level entry so the ships take off at 17m/s in a straight line. As it's the only practical way to get a constant speed with dampeners off, breaks the Mission01 enemy bot code for rotation/position.
     
  25. Ravenal Apprentice Engineer

    Messages:
    362
    Forward is actually Z -1 on the Z Axis
    Backward is Z +1 on the Z Axis

    Up and Down is the Y Axis and Left and Right is the X Axis.

    Also what your trying to do can all be done already with the Modding API. Ultimate Mod will have an entire AI and Navigational Behaviors that can do more than just "Look At", "turn To" methods.
     
  26. fabricator77 Apprentice Engineer

    Messages:
    399
    My code says:
    // where I spawn the ship (example code by midspace)
    grid.PositionAndOrientation = new MyPositionAndOrientation(pos, Vector3.Forward, Vector3.Up);


    // where I move it
    Ship.Physics.LinearVelocity = new Vector3(0, -MaxSpeed, 0);

    Given I pivot matched the ships to the same as keen's own cargo ships, then my code is correct.


    I'm sorry I don't want to micro manage ships, with constant polling to figure out if it's accelerated to it's top speed yet, if it's finished it's turn etc etc. Just because it's possible, doesn't mean every single modder wants to write that code/use your Ultimate Mod.
     
  27. midspace Senior Engineer

    Messages:
    2,224
    I think we need a single Method call to set the IEntity LinearVelocity, Orientation (WorldMatrix) and Position in one single call, and sync them in single frame.

    The issue is, if I call :
    Code:
    Entity.Physics.LinearVelocity = myNewVelocity;
    Entity.SetWorldMatrix(newMatrix)
    The orientation does not appear to get set until a frame after position.
    And the Physics.LinearVelocity, a few frames after that.

    So if I were trying to perfectly place one object next to another, especially when one is moving, I cannot do so without risk of them smacking into one another.

    If think this condition also occurs when the player spawning at the Medbay.
    Speeds do not match on the instant you first spawn, and you can drift into a wall. (In addition to the player spawning in the air, which I think is more because of using the player's raw position which comes from their feet to center them in front of the medbay, rather than center of player mass.)
     
  28. Ravenal Apprentice Engineer

    Messages:
    362
    I understand that not everyone will want my mod, the whole purpose of the ultimate mod will be to make it dynamic and fluid to any mod out there, another words. You will be able to just plug in a single Extension script that bridges my system so that you can use Ultimate Mod for your own benefits. The navigation system (Behaviors) will have everything you will ever possibly need.

    To better understand where I am coming from in Navigation System take a look here:

    http://gamedevelopment.tutsplus.com/series/understanding-steering-behaviors--gamedev-12732

    The system will work very similar to what I just posted above.
     
  29. tyrsis Junior Engineer

    Messages:
    862
    Can we get an event when a block is damaged / destroyed with the entity / playerid that caused the damage, and also an event when a player kills another player (if by turrets, or other weapons)? Then we can implement scoring and other neat things along those lines. As it is right now, we can't really tell who killed who.
     
  30. midspace Senior Engineer

    Messages:
    2,224
    That's funny. I was thinking about this 10 hours ago!
    As well as environment death information. Fall/impact, welder, grinder, drill, heat/thruster, battery depletion.
    I was also thinking of other stats, like blocks built, and this is starting to get into the tracking stats required for Steam Achievements.
     
Thread Status:
Not open for further replies.
This last post in this thread was made more than 31 days old.