Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Allow modAPI (script) access to OnGridChanged events. #519

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

fabricator77
Copy link

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.

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.
@Jimmacle
Copy link

Jimmacle commented May 2, 2016

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.

@fabricator77
Copy link
Author

I have to rely on several other PRs (that I'm working on) for my mod to work anyway.
IMyGrid exists for a reason, I'm not going to rely on MyGrid being exposed as that can change (eg the current ISensor secuity hole).

Why are you abusing me for actually improving the API.
For the record I don't believe in programming theory, long debates on best OO designs or endless refactoring.

exposes CreateNewNpcIdentity to IMyPlayerCollection
IMyIdentity IMyPlayerCollection.CreateNewNpcIdentity(string name)

Note this can only be used to create NPCs, not faked players.
@Jimmacle
Copy link

Jimmacle commented May 3, 2016

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.

@fabricator77
Copy link
Author

Huh, stupid GitHub client added that without my permission.

@Jimmacle
Copy link

Jimmacle commented May 3, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants