Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-09-2018, 01:15 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default Weather Question

Looking at zone table in DB I noticed that there are 4 different chances for rain/snow.
Could someone tell me what does this mean? Are these 4 different types of rain that can happen? Like how strong it is?
And apparently it can Snow in Gfay? =)

Also, there are 4 different types of Fog setting - why 4? How do they combine with each other?

Thank You so much!
Reply With Quote
  #2  
Old 01-09-2018, 02:07 PM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,106
Default

Check the source.
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
  #3  
Old 01-09-2018, 08:20 PM
Coenxai's Avatar
Coenxai
Hill Giant
 
Join Date: Dec 2013
Posts: 151
Default

If I recall it selects one of the four "chances" and then performs a roll against that selected chance or something super weird?

Edit: On quick glance that's how it appears? There may be further reasoning though. I have always have had my weather/sky off :P
__________________
"The true sign of intelligence is not knowledge but imagination."
Reply With Quote
  #4  
Old 01-19-2018, 10:18 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Ok guys, so I am looking at
https://github.com/EQEmu/Server/blob...one/zonedb.cpp

I see this:

for (index = 0; index < 4; index++) {
zone_data->fog_red[index] = atoi(row[1 + index * 5]);
zone_data->fog_green[index] = atoi(row[2 + index * 5]);
zone_data->fog_blue[index] = atoi(row[3 + index * 5]);
zone_data->fog_minclip[index] = atof(row[4 + index * 5]);
zone_data->fog_maxclip[index] = atof(row[5 + index * 5]);
}


So are we combing different fog values together? Why, whats the significance? I noticed that for pretty much ALL zones all 4 fog values are the same.
Thanks!
Reply With Quote
  #5  
Old 01-19-2018, 12:12 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

https://github.com/EQEmu/Server/blob...structs.h#L347

Each of those properties is a array of 4 indices.

So you would get:
Code:
zone_data->fog_red[0] = atoi(row[1]);
zone_data->fog_red[1] = atoi(row[6]);
zone_data->fog_red[2] = atoi(row[11]);
zone_data->fog_red[3] = atoi(row[16]);
..by looping like that.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #6  
Old 01-19-2018, 12:22 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Ok so we got those values.
But what does this mean in game?
If my fog RGB is set to 255 0 0 - its red right?
But then if fog1 and fog2 is set to something else - whats the end effect? Because I was changing values back and forth and I can't seem to notice any difference.

Also - multiple fog maxclips confusing me...
Reply With Quote
  #7  
Old 01-19-2018, 12:54 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Pretty sure they correspond to the weather system..but, that's only a guess from me - I've been wrong many times before :P

https://github.com/EQEmu/Server/blob...20_Weather.sql


EDIT: I meant to include this too: https://github.com/EQEmu/Server/blob...zone.cpp#L1301

Just shows that weather takes on one of four states, then intensity is applied for rain/snow.
__________________
Uleat of Bertoxxulous

Compilin' Dirty

Last edited by Uleat; 01-19-2018 at 01:07 PM..
Reply With Quote
  #8  
Old 01-20-2018, 06:38 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Thank you for your reply Uleat!
I trying hard to test the intensity but not sure how to force the client to show me different intensity for rain/snow.

I have tried to force this with a quest script like:



sub EVENT_SAY {

if($text=~/hail/i)
{quest::say("bla bla $name - $zoneweather");
}

if($text=~/rain/i)
{quest::say("bla bla $name - RAIN HARDER! $zoneweather");

quest::rain($zoneweather+5); }

if($text=~/snow/i)
{quest::say("bla bla $name - SNOW HARDER! $zoneweather");

quest::snow($zoneweather+5);}

}

I THINK its working - as I see snowflakes flying faster, but I can't say that I notice any changes on fog levels.


Also, by chance is zone clip exposed to Perl script?
I am asking because we have gm command #zclip, having it accessible via Perl function would be nice - we could then create Fog weather effect by lowering the clipplane.
Reply With Quote
  #9  
Old 01-20-2018, 07:37 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I definitely don't know enough about that to even make an educated guess...

I did see, in that function, that intensity seems to be its own value (1 - 10) and not part of the (0 - 3) array that controls which of the weather chances are used.

I'll keep my eyes open for any documentation concerning this.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #10  
Old 01-20-2018, 08:53 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Thank you Uleat!
Reply With Quote
  #11  
Old 01-20-2018, 10:07 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

You can modify weather and stuff in Perl using quest::UpdateZoneHeader(ID, value).

Code:
void QuestManager::UpdateZoneHeader(std::string type, std::string value) {
    if (strcasecmp(type.c_str(), "ztype") == 0)
        zone->newzone_data.ztype = atoi(value.c_str());
    else if (strcasecmp(type.c_str(), "fog_red") == 0) {
        for (int i = 0; i < 4; i++) {
            zone->newzone_data.fog_red[i] = atoi(value.c_str());
        }
    } else if (strcasecmp(type.c_str(), "fog_green") == 0) {
        for (int i = 0; i < 4; i++) {
            zone->newzone_data.fog_green[i] = atoi(value.c_str());
        }
    } else if (strcasecmp(type.c_str(), "fog_blue") == 0) {
        for (int i = 0; i < 4; i++) {
            zone->newzone_data.fog_blue[i] = atoi(value.c_str());
        }
    } else if (strcasecmp(type.c_str(), "fog_minclip") == 0) {
        for (int i = 0; i < 4; i++) {
            zone->newzone_data.fog_minclip[i] = atof(value.c_str());
        }
    } else if (strcasecmp(type.c_str(), "fog_maxclip") == 0) {
        for (int i = 0; i < 4; i++) {
            zone->newzone_data.fog_maxclip[i] = atof(value.c_str());
        }
    }
    else if (strcasecmp(type.c_str(), "gravity") == 0)
        zone->newzone_data.gravity = atof(value.c_str());
    else if (strcasecmp(type.c_str(), "time_type") == 0)
        zone->newzone_data.time_type = atoi(value.c_str());
    else if (strcasecmp(type.c_str(), "rain_chance") == 0) {
        for (int i = 0; i < 4; i++) {
            zone->newzone_data.rain_chance[i] = atoi(value.c_str());
        }
    } else if (strcasecmp(type.c_str(), "rain_duration") == 0) {
        for (int i = 0; i < 4; i++) {
            zone->newzone_data.rain_duration[i] = atoi(value.c_str());
        }
    } else if (strcasecmp(type.c_str(), "snow_chance") == 0) {
        for (int i = 0; i < 4; i++) {
            zone->newzone_data.snow_chance[i] = atoi(value.c_str());
        }
    } else if (strcasecmp(type.c_str(), "snow_duration") == 0) {
        for (int i = 0; i < 4; i++) {
            zone->newzone_data.snow_duration[i] = atoi(value.c_str());
        }
    }
    else if (strcasecmp(type.c_str(), "sky") == 0)
        zone->newzone_data.sky = atoi(value.c_str());
    else if (strcasecmp(type.c_str(), "safe_x") == 0)
        zone->newzone_data.safe_x = atof(value.c_str());
    else if (strcasecmp(type.c_str(), "safe_y") == 0)
        zone->newzone_data.safe_y = atof(value.c_str());
    else if (strcasecmp(type.c_str(), "safe_z") == 0)
        zone->newzone_data.safe_z = atof(value.c_str());
    else if (strcasecmp(type.c_str(), "max_z") == 0)
        zone->newzone_data.max_z = atof(value.c_str());
    else if (strcasecmp(type.c_str(), "underworld") == 0)
        zone->newzone_data.underworld = atof(value.c_str());
    else if (strcasecmp(type.c_str(), "minclip") == 0)
        zone->newzone_data.minclip = atof(value.c_str());
    else if (strcasecmp(type.c_str(), "maxclip") == 0)
        zone->newzone_data.maxclip = atof(value.c_str());
    else if (strcasecmp(type.c_str(), "fog_density") == 0)
        zone->newzone_data.fog_density = atof(value.c_str());
    else if (strcasecmp(type.c_str(), "suspendbuffs") == 0)
        zone->newzone_data.SuspendBuffs = atoi(value.c_str());

    auto outapp = new EQApplicationPacket(OP_NewZone, sizeof(NewZone_Struct));
    memcpy(outapp->pBuffer, &zone->newzone_data, outapp->size);
    entity_list.QueueClients(0, outapp);
    safe_delete(outapp);
}
Reply With Quote
  #12  
Old 01-20-2018, 10:51 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Kingly_Krab thank you very much for sharing this.
I just need a little bit more help translating this into plain English =)
Lets say I only want to alter clip plan (not entire zone header) in real time how do I pass it my quest npc that tracks weather?

so I put
quest::UpdateZoneHeader(maxclip, 300)
into npc script, where ID and value can be my clipplane?

and then I have
void QuestManager::UpdateZoneHeader(std::string type, std::string value)
as independent function, right?

PS wanted to add that I don't see UpdateZoneHeader on official Perl functions list:
http://wiki.eqemulator.org/p?Ultimat...rence&frm=Main
Reply With Quote
  #13  
Old 01-20-2018, 11:28 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

It's not on the official list because it's undocumented (my fault). But all you need to do is put the following in a quest file:
Code:
quest::UpdateZoneHeader("maxclip", 300);
Reply With Quote
  #14  
Old 01-21-2018, 12:58 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Thank you so much! You have no idea how many issues this solves for me!
Reply With Quote
  #15  
Old 01-21-2018, 04:52 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

Another question for today
Playing around with fog color - I want to make bright yellow fog - using 255 255 0 does give me yellow color but it is still very dark with sky 0.
Any idea how to get bright yellow fog?
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:33 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3