Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added spawn origin flags. #2931

Merged
merged 1 commit into from
Feb 20, 2025
Merged

Conversation

inkoalawetrust
Copy link
Contributor

Added new spawn flags that allow for checking if an actor was spawned by the level, the console, or ACS/DECORATE/ZScript.

The below example mod replaces the vanilla Demon with one that prints a console message based on which of these flags is true on it, or if neither are (Which means that it must've been scripte spawned, if not from the console or level itself). It also spawns a pinky at the world origin after 5 seconds in-game.

SpawnFlagExample.zip

@MajorCooke
Copy link
Contributor

While appreciated, what about RandomSpawners? I think those should transfer the flag if they're map spawned or not too.

Copy link
Collaborator

@madame-rachelle madame-rachelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me but I want to see what Jay or Graf say before merging this.

@inkoalawetrust
Copy link
Contributor Author

While appreciated, what about RandomSpawners? I think those should transfer the flag if they're map spawned or not too.

Depends on what @madame-rachelle thinks I guess. I think that's a fine idea at least, having MTF_MAPTHING RandomSpawners also pass the flag to whatever they spawn (Though ideally that'd also be marked too, but SpawnFlags is running dry already).

@madame-rachelle
Copy link
Collaborator

I agree with Cooke's idea if you want my opinion.

@inkoalawetrust
Copy link
Contributor Author

inkoalawetrust commented Feb 7, 2025

Alright, currently working on another PR, when I finish that, I'll make a separate commit for that I guess.

Edit: Nevermind, RandomSpawners pass all their SpawnFlags already, and Cooke apparently wants MTF_CONSOLETHING to be passed down too, so I guess I don't even need to add a special check for RandomSpawner to not pass that flag down either.

@MajorCooke
Copy link
Contributor

Perfect. I think this is good to go then.

@madame-rachelle
Copy link
Collaborator

Good enough for me - my previous point still stands, I want another pair of eyes on this before it's merged.

- Added new spawn flags that allow for checking if an actor was spawned by the level, the console, or ACS/DECORATE/ZScript.
@inkoalawetrust
Copy link
Contributor Author

Ah fuck, I just noticed earlier today that map-spawned allies didn't work, turns out I had accidentally used = instead of |= to ADD the new MTF_ flags to the spawned thing, instead of also replacing every other spawn flag in their field.

@RicardoLuis0 RicardoLuis0 merged commit b54da61 into ZDoom:master Feb 20, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants