HammerAddons icon indicating copy to clipboard operation
HammerAddons copied to clipboard

"Value - Position" keyvalue for `comp_kv_setter`

Open vrad-exe opened this issue 1 year ago • 14 comments

Add a keyvalue to comp_kv_setter that has the origin type, so the position is transformed when the entity is in an instance.

(This is needed for the final PEE update)

vrad-exe avatar Aug 19 '23 06:08 vrad-exe

Seems useful, though I should try and figure out a better system, so there's not an option for every FGD value type...

TeamSpen210 avatar Aug 19 '23 07:08 TeamSpen210

Well it only needs to include separate KVs for things that are transformed by instances, so targetnames, positions, and angles, anything else can just be set as a string value

vrad-exe avatar Aug 19 '23 08:08 vrad-exe

Hmm, this actually broke things, VBSP/Hammer will set this keyvalue when you move the entity around/collapse it, meaning the regular string is never used. Guess we need a mode choices field instead.

TeamSpen210 avatar Apr 03 '24 05:04 TeamSpen210

Maybe you could make it where the other fields always take priority if set?

vrad-exe avatar Apr 03 '24 05:04 vrad-exe

I could, but then you couldn't set it explicitly to an empty string if you needed that.

TeamSpen210 avatar Apr 03 '24 05:04 TeamSpen210

Ah yeah

vrad-exe avatar Apr 03 '24 05:04 vrad-exe

I'm making a func_instance for some meat hooks hanging by phys_hinges in a map and I'm having trouble getting the axes to replicate properly.

image

I'm pretty sure comp_kv_setter is the way I'll be able to fix this issue but I've yet to figure out how I'm supposed to configure it to fix hingeaxis on a per-instance basis.

image

Any suggestions? Just throwing this out there; I've tried every combination I can think of. Also the comp_kv_setter is within the func_instance, just thought I should maybe make that clearer.

image

piqey avatar Jul 04 '24 14:07 piqey

If the phys_hinge's keyvalue isn't being changed when the instance is collapsed, the comp_kv_setter isn't going to be transformed either. Which game are you doing this in? It might be the case that Valve didn't implement instance functionality for the position keyvalue type. In that case, you'll need to move the KV setter outside of the instance and do it yourself manually.

TeamSpen210 avatar Jul 05 '24 02:07 TeamSpen210

I think the current release build doesn't work right in older games but I fixed it in dev

vrad-exe avatar Jul 05 '24 02:07 vrad-exe

The type needs to be origin for it to get transformed I'm pretty sure, but the current release has it as like vector or something

vrad-exe avatar Jul 05 '24 02:07 vrad-exe

If the phys_hinge's keyvalue isn't being changed when the instance is collapsed, the comp_kv_setter isn't going to be transformed either. Which game are you doing this in? It might be the case that Valve didn't implement instance functionality for the position keyvalue type. In that case, you'll need to move the KV setter outside of the instance and do it yourself manually.

It's Source SDK 2013 Multiplayer.

I think the current release build doesn't work right in older games but I fixed it in dev

The type needs to be origin for it to get transformed I'm pretty sure, but the current release has it as like vector or something

I ought to switch builds then, my thanks

piqey avatar Jul 05 '24 13:07 piqey

Having issues compiling the dev branch, though—can't build postcompiler.exe. Stuck on this error:

Error: Invalid hiddenimport 'srctools._pyinstaller.hook-srctools'. Hidden imports should be importable module names – not file paths. i.e. use --hiddenimport=foo.bar instead of --hiddenimport=.../site-packages/foo/bar.py

~~Everything else seems to work fine. Tried on both Python 3.12 and 3.11. Should I be using an earlier version?~~

~~I still didn't figure that out locally, but I saw your comment here and decided to fork the repo and use the CI workflow instead, which appears to be working. Thanks for the help!~~

Looks like the CI workflow has the same issue when building:

image

piqey avatar Jul 05 '24 15:07 piqey

Yeah that's a bug with the latest version of PyInstaller, try version 6.1.0? But the change here is just in the FGD for comp_kv_setter, you don't need the different compiler build.

TeamSpen210 avatar Jul 05 '24 20:07 TeamSpen210

Yeah that's a bug with the latest version of PyInstaller, try version 6.1.0? But the change here is just in the FGD for comp_kv_setter, you don't need the different compiler build.

Yep, that was it. ~~Will give comp_kv_setter a shot soon.~~ Seems like it works. Thank you!

piqey avatar Jul 06 '24 04:07 piqey