This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Solved sv_zmax limit Dynamic Sky (Animated Sky)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kelso
Junior Member
Join Date: Nov 2019
Old 09-15-2023 , 18:22   sv_zmax limit Dynamic Sky (Animated Sky)
Reply With Quote #1

I have a problem with the dynamic sky when I zoom out far enough you can see that the sky replaces the wall



PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <fakemeta_util>
#include <engine>

#define PLUGIN    "Dynamic sky"
#define VERSION    "1.0"
#define AUTHOR    "Sneaky.amxx | "

new const g_szSky[] = "models/ciela.mdl";
new 
g_iSkyEnt;
new 
g_fwCheckVisibilityg_fwAddToFullPack;

//new map_light;

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
//fix 1
    
set_cvar_num("sv_zmax"9999999)
    
//fix 2
//    Set_lights();
    
    
g_fwCheckVisibility register_forward(FM_CheckVisibility"fw_CheckVisibility");
    
g_fwAddToFullPack register_forward(FM_AddToFullPack"fw_addToFullPackPost"1);
    
    if (!
unloadlist())
        
g_iSkyEnt CreateSky();
    else
    {
        
unregister_forward(FM_CheckVisibilityg_fwCheckVisibility);
        
unregister_forward(FM_AddToFullPackg_fwAddToFullPack);
        
g_fwCheckVisibility = -1;
        
g_fwAddToFullPack = -1;
        
g_iSkyEnt 0;
    }
}
//fix 2
//public Set_lights()
//{
//    new light[2];
//    set_lights("z")
//}
//
public unloadlist()
{
    new 
boolismap;
    new 
customdir[64], mapfile[128], mapname[32]

    
get_customdir(customdircharsmax(customdir));
    
format(mapfilecharsmax(mapfile), "%s/unloadmaps.ini"customdir);

    
get_mapname(mapnamecharsmax(mapname));
    
strtolower(mapname);
    
    
ismap false;

    if (
file_exists(mapfile))
    {
        new 
File fopen(mapfile"r")
        new 
text[256]
        new 
tempMap[32]

        while(
File && !feof(File))
        {
            
fgets(Filetextcharsmax(text))

            if (
text[0] == ';')
                continue

            if (
parse(texttempMapcharsmax(tempMap)) < 1)
                continue

            if(!
is_map_valid(tempMap))
                continue

            
trim(tempMap)
            
            
strtolower(tempMap);
            
            if (
equal(mapnametempMap))
            {
                
ismap true;
                break;
            }
        }

        if (
File)
            
fclose(File)
    }
    else
    {
        
write_file(mapfile"; 需要关*动态天空的地图列表", -1);
        
write_file(mapfile"; *式:一行一个地图名", -1);
        
write_file(mapfile"; 例*:de_dust2", -1);
    }
    
    return 
ismap;
}

public 
fw_CheckVisibility(iEntpset)
{
    if (
g_iSkyEnt)
    {
        if (
iEnt == g_iSkyEnt)
        {
            
forward_return(FMV_CELL1);
            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;
}

public 
fw_addToFullPackPost(eseenthosthostflagsplayerpSet)
{
    if (
g_iSkyEnt)
    {
        if (
ent == g_iSkyEnt)
        {
            new 
FloatfOrigin[3];
            
pev(hostpev_originfOrigin);
            
fOrigin[2] -= 1000.0;
            
set_es(esES_OriginfOrigin);
        }
    }
}

public 
plugin_precache()
{
    
engfunc(EngFunc_PrecacheModelg_szSky);
}

public 
CreateSky()
{
    
set_cvar_num("sv_skycolor_r"0);
    
set_cvar_num("sv_skycolor_g"0);
    
set_cvar_num("sv_skycolor_b"0);
    new 
iEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));
    
set_pev(iEntpev_classname"dynamic_sky");
    
set_pev(iEntpev_solidSOLID_NOT);
    
set_pev(iEntpev_sequence0);
    
set_pev(iEntpev_framerate0.5);
    
set_pev(iEntpev_effectsEF_BRIGHTLIGHT EF_DIMLIGHT);
    
set_pev(iEntpev_light_level10.0);
    
set_pev(iEntpev_flagsFL_PARTIALGROUND);
    
engfunc(EngFunc_SetModeliEntg_szSky);
    
engfunc(EngFunc_SetOriginiEntFloat:{0.00.00.0});
    return 
iEnt;


I tried several values but it is always the same: 4620, 5620, 50000....

50000 is the default in the plugin

Does it have any limits? I can't do anything to improve it?
__________________

Last edited by Kelso; 09-20-2023 at 13:16.
Kelso is offline
DeMNiX
Veteran Member
Join Date: Nov 2011
Location: Russia
Old 09-20-2023 , 05:07   Re: sv_zmax limit Dynamic Sky (Animated Sky)
Reply With Quote #2

U should scale sky model
__________________
My channel with test codes
https://www.youtube.com/user/demnix03

Zombie Riot [Scenario & bots-zombie 11.11.2023]
https://youtu.be/8ZZan-aq2sc
DeMNiX is offline
Kelso
Junior Member
Join Date: Nov 2019
Old 09-20-2023 , 13:03   Re: sv_zmax limit Dynamic Sky (Animated Sky)
Reply With Quote #3

Quote:
Originally Posted by DeMNiX View Post
U should scale sky model
Thank you very much for the information, it now works correctly!



__________________
Kelso is offline
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 16:39.


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