TeamSpen210 / HammerAddons

Useful tweaks and content for Source Engine Games
123 stars 36 forks source link

SunSpreadAngle must be capitalized #274

Open ozxybox opened 1 month ago

ozxybox commented 1 month ago

It turns out, this keyvalue, SunSpreadAngle, must always be properly capitalized for it to be read by VRAD. By having it lowercase in the FGD, the final result will be a lowercased keyvalue in the entity lump, which VRAD skips over.

https://github.com/TeamSpen210/HammerAddons/blob/47afc57e3ff272ebe75a8277b36514bb0a2f10ef/fgd/point/light/light_environment.fgd#L16 https://github.com/TeamSpen210/HammerAddons/blob/47afc57e3ff272ebe75a8277b36514bb0a2f10ef/fgd/point/light/light_directional.fgd#L11

The variable is read from here: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/utils/vrad/lightmap.cpp#L1483C1-L1483C64

The case-sensitive strcmp that checks it is here: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/utils/vrad/lightmap.cpp#L1470C1-L1470C31

TeamSpen210 commented 1 month ago

That's quite dumb. I think I'll also add a postcompiler transform to adjust the casing as well then, to fix this issue.

ozxybox commented 1 month ago

Related, does HA always emit (or intake when importing) lowercase keyvalue names?

TeamSpen210 commented 1 month ago

Nah, srctools does lookups case-insensitively, but preserves the casing used when it’s initially set/parsed. I need to revamp this though, currently it’s directly exposed as the keys dict meaning it has to just loop over all the keys each time…

ozxybox commented 1 month ago

Ah okay, thanks! Was wondering as I was futzing around with it the other day