AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Model disappears by distance on separate map areas (https://forums.alliedmods.net/showthread.php?t=346159)

ZASTRELIS 02-11-2024 13:49

Model disappears by distance on separate map areas
 
2 Attachment(s)
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); 


Natsheh 02-11-2024 14:38

Re: Model disappears by distance on separate map areas
 
kRenderFxDistort :arrow: kRenderFxNormal

ZASTRELIS 02-11-2024 15:04

Re: Model disappears by distance on separate map areas
 
Quote:

Originally Posted by Natsheh (Post 2817910)
kRenderFxDistort :arrow: kRenderFxNormal

tried fully disable FX method, bug stays (and I need alpha)

ZASTRELIS 02-11-2024 15:12

Re: Model disappears by distance on separate map areas
 
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 :\ 


DJEarthQuake 02-12-2024 09:25

Re: Model disappears by distance on separate map areas
 
Use env_sprite NOT info_target.

georgik57 02-24-2024 05:53

Re: Model disappears by distance on separate map areas
 
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 



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

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