Showing/Hiding entities? Created 5 years ago2018-10-06 20:07:32 UTC by MOCOLONI MOCOLONI

Created 5 years ago2018-10-06 20:07:32 UTC by MOCOLONI MOCOLONI

Posted 5 years ago2018-10-06 20:07:32 UTC Post #340997
Is there a way to do such thing in GoldSrc?

In Source, for example, there are "Outputs" and "Inputs". To certain entities, such as prop_dynamic and func_brush, you can set "Disable" to 'hide', and "Enable" to 'show', and even do so all the times you want.

In GoldSrc, the only "similar" (if at all) thing I ever did was making use of a func_breakable entity that would reappear on round restart.
MOCOLONI MOCOLONIinfo_player_mocoloni
Posted 5 years ago2018-10-06 20:19:48 UTC Post #340998
torekk torekkProcrastinator of the Year
Posted 5 years ago2018-10-07 11:09:29 UTC Post #341001
torekk said:env_render
Thank you for answering, but can it do both Show and Hide? My intention is to continuously make an entity flicker, and I'd like to know if that's possible and a brief explanation on how to do it, because I never heard of / worked with that entity.
MOCOLONI MOCOLONIinfo_player_mocoloni
Posted 5 years ago2018-10-07 14:57:56 UTC Post #341002
Use another entity called multi_manager with it's "multithreaded" flag ticked and which basically calls itself, two env_renders, one which "shows" the entity, and one that "hides" it. E.g. if you have want to toggle an env_sprite, set the env_sprite's rendermode to "Glow" and the amount to e.g. "255", then for the env_render that shows it copy those values and for the one that hides it change the amount to "0".

To create a multi_manager, just place it as a normal entity, edit it's properties, give it a name and set SmartEdit to off, then just add the name of the env_render that hides the entity as a key and for value give it 0.1(I read that using 0 can cause bugs), do the same for the env_render that shows it but this time set a delay of 1 (or how fast you want it to flicker). Then add another key with the name of the multi_manager and the delay should match with the last key you added. Then switch to the flags tab and tick the "multithreaded" one.

However I'm not sure if this will work with every entity and I read that using "multithreaded" multi_managers for more complex stuff isn't really efficient, as it basically just creates a copy of the multi_manager until you hit the engine's limits. There's a way to prevent this though: https://twhl.info/index.php/wiki/page/Tutorial%3A_Multi_manager_Looping_Made_Easy

An easier way to "loop" this would be using an env_beam, but it's "random": https://twhl.info/index.php/wiki/page/Tutorial%3A_Random_entity_triggering
torekk torekkProcrastinator of the Year
Posted 5 years ago2018-10-07 17:09:27 UTC Post #341003
torekk said:Use another entity called multi_manager with it's "multithreaded" flag ticked and which basically calls itself, two env_renders, one which "shows" the entity, and one that "hides" it. E.g. if you have want to toggle an env_sprite, set the env_sprite's rendermode to "Glow" and the amount to e.g. "255", then for the env_render that shows it copy those values and for the one that hides it change the amount to "0".

. . .
I kinda figured it out already that I need two different entities, one to Show and the other to Hide, but thanks again for the clarification and the env_render entity.

One thing to let you know about: a multi_manager can't be "activated" again until all its targets have been fired. Ticking the "multithreaded" flag will make the entity retriggerable any time, but it depends on the function/complexity of that entity that may or Not crash your map. I don't think the flag should be ticked unless really necessary.
MOCOLONI MOCOLONIinfo_player_mocoloni
Posted 5 years ago2018-10-07 18:33:18 UTC Post #341004
Would highly advise against a multi-manager targeting itself. Torekk is correct with using two separate env_renders if you simply want the visibility of an object to change (whether this be sprites or normal entities). func_wall_toggles will change it's own visibility and solidity. To make a loop, make a normal multi manager and a separate, invisible func_button who's target is the multi manager. Trigger this func_button at the end of the "loop" - this will sidestep the instability that will inadvertently arise. Can simply use a changetarget entity on the func_button to jump out of the loop at any point.
Instant Mix Instant MixTitle commitment issues
You must be logged in to post a response.