Skip to content

Add "gamemodes" key value to all entities#328

Open
Panzerhandschuh wants to merge 1 commit into
masterfrom
feat/gamemode-flags
Open

Add "gamemodes" key value to all entities#328
Panzerhandschuh wants to merge 1 commit into
masterfrom
feat/gamemode-flags

Conversation

@Panzerhandschuh

Copy link
Copy Markdown

No description provided.

@TeamSpen210

Copy link
Copy Markdown
Member

You’ll want to add the KV to fgd/base_entity.fgd as well, just as an integer - that way the engine dump used for packing knows it’s common for all entities.

Comment thread fgd/bases/Gamemodes.fgd Outdated
[
gamemode[engine](integer) : "Gamemode" : 0
gamemode(choices) : "Gamemode" : 0 =
gamemodes(flags) : 0 : "Gamemodes" : "Which gamemodes this entity is active in. If no flags are set, the entity is active in all gamemodes." =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Srctools needs to have handling of flag names/help text fixed (is it even broken?). There shouldn't be a default value here. I tested this in hammer earlier today and it worked as expected with var(flags) : "Fancy name" : "Desc goes here" =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not quite broken, more I don't have them implemented - spawnflags are special-cased, I didn't handle descriptions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When I tried mentally to go over the logic in srctools it seemed like it would be able to just handle it as-is, just that stuff would get stored in wrong fields.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually I did implement this but forgot, so we just need the latest srctools.

@Panzerhandschuh Panzerhandschuh Jun 16, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I tried updating srctools and removing the : 0 but that just causes the key name to break again (the key name and tab uses the description instead of "Gamemodes").

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I just tried to run this through latest srctools and it errored out because of the default value:

srctools.fgd.FGDParseError: Too many attributes for flags keyvalue!
['0', 'Gamemodes', 'Which gamemodes this entity is active in. If no flags are set, the entity is active in all gamemodes.']
Error occurred on line 5, with file "bases/Gamemodes.fgd".

@TeamSpen210 TeamSpen210 Jun 20, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Upstream or the strata fork? The latter's quite old... I'll make sure to do some tests tomorrow.

@SCell555 SCell555 Jun 20, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess I used upstream and not the fork. I had a bit of a trouble getting it to run because of getattr check in init.py for some reason.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It was working as expected with the correct format though.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I tried updating again and now it's working after removing : 0

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.

3 participants