Jump to content

Environment effects ignore collision (like rain, fog, ...)


Recommended Posts

Hello everyone,

 

I've noticed in quite some mods that whenever new entities / brushes / geometry gets added to the world (using the editor or System.SpawnEntity(...)) - environmental effects (like rain) are not included in the collision with these new entities - which means that the rain drips though houses for example - is there anything that can be done against this?

 

Cheers

dataframe / benjamin foo

Link to comment
Share on other sites

Take this with a grain of salt.

 

According to KCD mods documentation here on nexus (which is more like a leaked in-house Q&A) for newly placed brushes\entities\<you_name_it> "RainOccluder" flag is set to false, resulting in environmental effects like rain to ignore collisions with such objects.

 

When editing a level from within an editor one just have to select a brush they're interested in and set "RainOccluder" flag to true. That will enable this object to be registered by rain (unless collisions are unloaded\disabled or simply not existing).

 

As for changing this flag from within a LUA script, there's a function you can call on entity named "SetFlags" with "ENTITY_FLAG_RAIN_OCCLUDER" parameter, setting it to 0 or 1 like that:

local spawnedEntity = System.SpawnEntity(<...>)
spawnedEntity:SetFlags(ENTITY_FLAG_RAIN_OCCLUDER, 1)

But that's in theory. In practice I was unable to make it work, so more investigation is needed.

Link to KCD mods documentation page: https://wiki.nexusmods.com/index.php/Weather_Documentation#Rain_occluders

 

A list of what I believe are entity flags:

ENTITY_FLAG_WRITE_ONLY
ENTITY_FLAG_NOT_REGISTER_IN_SECTORS
ENTITY_FLAG_CALC_PHYSICS
ENTITY_FLAG_CLIENT_ONLY
ENTITY_FLAG_SERVER_ONLY
ENTITY_FLAG_CALCBBOX_USEALL
ENTITY_FLAG_IGNORE_PHYSICS_UPDATE
ENTITY_FLAG_TRIGGER_AREAS
ENTITY_FLAG_NO_SAVE
ENTITY_FLAG_NO_PROXIMITY
ENTITY_FLAG_VOLUME_SOUND
ENTITY_FLAG_AI_HIDEABLE
ENTITY_FLAG_MODIFIED_BY_PHYSICS
ENTITY_FLAG_UPDATE_HIDDEN
ENTITY_FLAG_EXTENDED_NEEDS_MOVEINSIDE
ENTITY_FLAG_EXTENDED_CAN_COLLIDE_WITH_MERGED_MESHES
ENTITY_FLAG_EXTENDED_FORCE_UPDATE
ENTITY_FLAG_CASTSHADOW
ENTITY_FLAG_RAIN_OCCLUDER
ENTITY_FLAG_GOOD_OCCLUDER

P.s. "EXTENDED" flags are probably used with "SetFlagsExtended(<...>)".

Link to comment
Share on other sites

Hey adm244,

 

thanks four your response - this looks pretty valid to me - I tested the code and looked at the pages you mentioned but also couldnt make it work - I guess there needs some kind of update / refresh / generate call - I can update the scene by saving and loading it - the shadowmap / shadowproxy / idk will then be regenerated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...