Raised This Month: $51 Target: $400
 12% 

Model disappears by distance on separate map areas


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 02-11-2024 , 13:49   Model disappears by distance on separate map areas
Reply With Quote #1

Nothing understand what happened.. how to fix that?

PHP Code:
iEntSprite rg_create_entity("info_target");
            
if(
is_nullent(iEntSprite))
    return;
            
// set_entvar(iEntSprite, var_movetype, MOVETYPE_TOSS);
// set_entvar(iEntSprite, var_solid, SOLID_TRIGGER);
            
engfunc(EngFunc_SetOriginiEntSpritefOrigin);
engfunc(EngFunc_SetModeliEntSpriteMODEL_GUNDROP);
// engfunc(EngFunc_SetSize, iEntSprite, Float:{0.0,0.0,0.0}, Float:{15.0,15.0,50.0});
            
set_entvar(iEntSpritevar_classname"gundrop");
set_entvar(iEntSpritevar_scale0.5);
set_entvar(iEntSpritevar_teamTEAM_TERRORIST);
            
            
// dllfunc(DLLFunc_Spawn, iEntSprite)
            
//set_pev(iEntSprite, pev_effects, pev(iEntSprite, pev_effects) & ~EF_NODRAW);
            
rg_set_rendering(iEntSpritekRenderFxDistortFloat:{255.0255.0255.0}, kRenderTransAdd255.0); 
Attached Thumbnails
Click image for larger version

Name:	HalfLife01.jpg
Views:	45
Size:	103.5 KB
ID:	203198   Click image for larger version

Name:	HalfLife02.jpg
Views:	47
Size:	100.1 KB
ID:	203199  

Last edited by ZASTRELIS; 02-11-2024 at 13:51.
ZASTRELIS is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-11-2024 , 14:38   Re: Model disappears by distance on separate map areas
Reply With Quote #2

kRenderFxDistort kRenderFxNormal
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-11-2024 at 14:39.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 02-11-2024 , 15:04   Re: Model disappears by distance on separate map areas
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
kRenderFxDistort kRenderFxNormal
tried fully disable FX method, bug stays (and I need alpha)

Last edited by ZASTRELIS; 02-11-2024 at 15:23.
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 02-11-2024 , 15:12   Re: Model disappears by distance on separate map areas
Reply With Quote #4

Is it normally create ent in SetThink() via static ?)
PHP Code:
SetThink(entity"Corpse_Sprite_Think");
set_entvar(entityvar_nextthinkget_gametime() + 0.1); // entity - it's a weaponbox
// ...

public Corpse_Sprite_Think(const iEnt)
{
  static 
iEntSprite NULLENT;
  if ((
get_entvar(iEntvar_flags) & FL_ONGROUND)) {
    if (!
is_entity(iEntSprite)) {
      
iEntSprite rg_create_entity("info_target"false);
      
engfunc(EngFunc_SetModeliEntSpriteMODEL_GUNDROP);
      
// then I set couple of entvars
    
} else {
      
// fixes ents' origin, because SetThink called from rg_CBasePlayerDropPlayerItemPost (in this case weaponbox can still moving somethime)
    
}
  }
}


// This's my plugins logics :\ 

Last edited by ZASTRELIS; 02-11-2024 at 15:21.
ZASTRELIS is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 02-12-2024 , 09:25   Re: Model disappears by distance on separate map areas
Reply With Quote #5

Use env_sprite NOT info_target.
__________________
DJEarthQuake is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-24-2024 , 05:53   Re: Model disappears by distance on separate map areas
Reply With Quote #6

Also, scaling sprites too big or too small can make them disappear.
See: https://forums.alliedmods.net/showth...20#post2673120
PHP Code:
        if (g_fScale[iID][iID2] <= 0.003905)
            
g_fScale[iID][iID2] = 0.003907 
__________________

Last edited by georgik57; 02-24-2024 at 05:58.
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:53.


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