-
Notifications
You must be signed in to change notification settings - Fork 897
Allow modAPI (script) access to OnGridChanged events. #519
base: master
Are you sure you want to change the base?
Conversation
OnGridChanged is used in the cargoship code to detect when a Player has taken over a ship so it doesn't despawn. It's not possible to create the same functionality with other available events, which can be triggered by things like minor damage to ships, or unpowered ships drifting.
I already spoke to you on Discord, but for the record I'll put it here too. Can't you use the event directly by casting your object to MyCubeGrid? The modding API still has a lot of work left but that method should work until the API gets some more love. |
I have to rely on several other PRs (that I'm working on) for my mod to work anyway. Why are you abusing me for actually improving the API. |
exposes CreateNewNpcIdentity to IMyPlayerCollection IMyIdentity IMyPlayerCollection.CreateNewNpcIdentity(string name) Note this can only be used to create NPCs, not faked players.
Calm down, dude. I'm just trying to help you get whatever you're working on going without having to rely on PRs as they aren't getting merged right now. Sorry for trying to help. Now you've put an unrelated change in your PR so it's even less likely to get merged. |
Huh, stupid GitHub client added that without my permission. |
This reverts commit 4f36ab8.
When you make a PR it's possible to update it by committing to the same branch. Good practice is to make a separate branch for each PR so you can have multiple open at once without interference :) You can look at my fork if you need a visual. |
OnGridChanged is used in the cargoship code to detect when a Player has
taken over a ship so it doesn't despawn.
It's not possible to create the same functionality with other available
events, which can be triggered by things like minor damage to ships, or
unpowered ships drifting.