AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Entity disappearing on certain areas in relation to observer (https://forums.alliedmods.net/showthread.php?t=346376)

taski 02-22-2024 10:13

Entity disappearing on certain areas in relation to observer
 
Having an odd issue with entity disappearing on seemingly random, but consistent parts of the map depending on where the observer is. Not sure what's causing it as I haven't worked with entities in this game that much. I've tried a few different methods of creating the entity, different rendermodes and perhaps other things. All seems to have this same effect.

In some maps like dust2 and nuke the entity doesn't actually appear at all.
On a bigger map it does appear but disappears once the observer walks into seemingly random parts of the map, so clearly something is not right.

Here's the function where entity in question is being created:

Spoiler



And here's the thinking function where the entity being moved frame by frame

Spoiler


Sort of similar post was created a week ago (nothing much to see):
https://forums.alliedmods.net/showthread.php?t=346159

Made an attempt to scout some other threads, couldn't quite find anything similar.

Phant 02-24-2024 00:40

Re: Entity disappearing on certain areas in relation to observer
 
Did you tried to use "cycler_sprite" instead of "info_target"?

georgik57 02-24-2024 05:39

Re: Entity disappearing on certain areas in relation to observer
 
Try using what phant said or env_sprite. Don't set any rendering or scaling options.
IMO try removing this completely and see what happens and also try to spawn entity with dllfunc_spawn:
PHP Code:

set_pev(entpev_solidSOLID_NOT);
    
set_pev(entpev_scale0.5);
    
set_pev(entpev_renderfxkRenderFxDistort);
    
set_pev(entpev_frame0.0);
    
set_pev(entpev_rendermodekRenderFxDistort);
    
set_pev(entpev_renderamt0); 


taski 02-24-2024 09:47

Re: Entity disappearing on certain areas in relation to observer
 

Quote:

Originally Posted by Phant (Post 2818540)
Did you tried to use "cycler_sprite" instead of "info_target"?

Now I have. That just makes it really laggy, and the same issue persists

Quote:

Originally Posted by georgik57 (Post 2818548)
Try using what phant said or env_sprite. Don't set any rendering or scaling options.
IMO try removing this completely and see what happens and also try to spawn entity with dllfunc_spawn:
PHP Code:

set_pev(entpev_solidSOLID_NOT);
    
set_pev(entpev_scale0.5);
    
set_pev(entpev_renderfxkRenderFxDistort);
    
set_pev(entpev_frame0.0);
    
set_pev(entpev_rendermodekRenderFxDistort);
    
set_pev(entpev_renderamt0); 


Thanks for the replies, already tried both of these. Whether there was rendering / scaling, DLLFunc_Spawn / DispatchSpawn or not, it makes no difference.
However, looking at hlsdk_const.inc, this was fixed by just setting movetype to 10, it seems to be 0 by default (NONE). I tried 12 before (FOLLOW) and that had the same problem.

But MOVETYPE_BOUNCE fixes this. If you get some unwanted bouncing, MOVETYPE_FLY also works.
If anyone has this problem you can fiddle with different movetypes to see what suits you.

Spoiler


Here's the working function:

Spoiler




All times are GMT -4. The time now is 00:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.