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

Gmod FGD origin kv causing certain effect entities having strange behaviour #258

Open
Vinzuerio opened this issue Feb 7, 2024 · 4 comments
Labels
bug FGD Concerns the entity definitions

Comments

@Vinzuerio
Copy link

Hello! I'd like inform there was an issue when using HammerAddons' Garry's Mod FGD.

Recently I was having issues when using from this FGD and figured out this afternoon, some entities such as func_dustmotes and func_dustcloud (or any BModelParticleSpawner base entity) with origin key value present will cause strange effect. The entity itself still stays in exact position, however when map was compiled and loaded map in Garry's Mod, those effects will spawn on the worldspawn origin but not from entities's position.

Upon inspection, this causes internal entities' SaveValue m_AbsOrigin (along with other positions related) are changed from origin kvs thus causing the effect to be broken. it seems working in cs_militia (Apparently the position must stay 0,0,0 so it should be default for these kind of entities?)

Workaround

My current workaround as follows:

  • Deleting origin keyvalue with SmartEdit off or leave Origin keyvalue to be empty
  • Or, edit HammerAddon's Garry's Mod FGD and remove origin key from BModelParticleSpawner and change from BaseEntityBrush to BaseEntity and copy paste some properties from BaseEntityBrush to affected func_dustcloud and func_dustmotes entities. Btw, I'm new to this FGD and I'm not sure how to properly edit this FGD so I simply edit them closely resemble to original base.fgd as possible.

I'm not sure with other entities but I noticed this mostly affecting to func_dustcloud and func_dustmotes on my compiled maps

What I'm using & tested:

  • Hammer++
  • Slammin's Source Tool 1.6 and 1.7 MP Compiler
  • HammerAddons Garry's Mod FGD only

Screenshots

Improper func_dustmotes in my compiled map
Coordinate of entities are changed from origin keyvalue, however it must be 0,0,0 and effects are spawned on world origin instead
dustsmoke_worldspawn2
Close view of the effect near worldspawn origin
dustsmoke_worldspawn1

Testing on cs_militia (what it should be)
20240207155937_1

Comparison
dustsmoke3

I may have to test all effect/any brush entities just in case if this actually having similar effect to this one. I'll may have to update this issue on which entities are effected.

@TeamSpen210
Copy link
Owner

It's those two entities specifically that have the problem in all engine branches. Valve didn't implement them properly, using the local position of the brush but not applying the origin transform. But this should have been fixed via an override in BModelParticleSpawner...

@TeamSpen210 TeamSpen210 added bug FGD Concerns the entity definitions labels Feb 7, 2024
@Vinzuerio
Copy link
Author

Alright thanks for the info!

Unfortunately when removing origin in BModelParticleSpawner it appears they still coming back in hammer and I think it still using from BaseEntityBrush base since it has origin key. I realised on my first workaround seems don't help since they will come back after reloading the vmf file, so the second workaround will fix it.

image

I might have to use my second workaround since it's convinient way to use these entities. (and because they're intended to be static and cant be parented anyway)

Also sorry for unrelated question but is there a way to exclude file(s) when automatic packing is enabled? Would appreciate with the help since I'm not sure how to exclude detail.vbsp to be included inside my map (it always included even though --no-pack is specified)

@TeamSpen210
Copy link
Owner

TeamSpen210 commented Feb 8, 2024

Try adding back origin to BModelParticleSpawner, but defining it like so:

origin(string) readonly: "Origin": "0 0 0" : "Broken origin"

For excluding files, you should be able to use the pack_blocklist setting.

@Vinzuerio
Copy link
Author

Try adding back origin to BModelParticleSpawner, but defining it like so:

origin(string) readonly: "Origin": "0 0 0" : "Broken origin"

For excluding files, you should be able to use the pack_blocklist setting.

image

image

Confirmed the override works!

Also pack_blocklist works too after testing it. I honestly have no idea why these random models, detail.vbsp and some textures always included when auto-packing is enabled and when there is no entities with model or textures associated with it. (the map is completely blank with dev textures, func_dustmote & func_dustcloud, sky texture and that's it). These (except detail.vbsp that stored in <mod> folder) are from recompiled hl2 beta contents using crowbar with newer model format, the contents are loaded using searchpaths in gameinfo.txt
image

Anyway I'll close this issue as it's fixed for now. Thanks for the help once again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug FGD Concerns the entity definitions
Projects
None yet
Development

No branches or pull requests

2 participants