Register for your free account! | Forgot your password?

You last visited: Today at 08:39

  • Please register to post and access all features, it's quick, easy and FREE!


[Source Release]Day & Night System

Reply
 
Old   #1
 
elite*gold: 4
Join Date: Mar 2010
Posts: 3,149
Received Thanks: 1,531
[Source Release]Day & Night System

Hier release ich mal das day & night system.
Was ist das day & night system?
Seht es euch am besten an mit den screens.
Dmmerung :

Dunkler :

Nochmal dunkler als voher :

das wird nacher noch viel dunkler und spter wieder hell.

Jetzt zum Code
1.
Ihr geht in world.h
sucht nacht
Code:
public:
	BOOL			InitWorldEnvir( );		// 24ð Light   Ÿ ȯ ʱ* 

#if __VER >= 15 // __GUILD_HOUSE
	void			InProcessing( );		// gmpbigsun :   Խ ѹ ȣ
	void			OutProcessing( );		// gmpibgsun :  忡*  ѹ ȣ 
#endif

	// Render
	void			Projection( LPDIRECT3DDEVICE9 pd3dDevice, int nWidth, int nHeight );
	void			Render( LPDIRECT3DDEVICE9 pd3dDevice, CD3DFont* pFont = NULL );
	void			RenderBase( LPDIRECT3DDEVICE9 pd3dDevice, CD3DFont* pFont );
		
	// Light, Camera and etc...
fgt darunter ein
Code:
	bool			IsNight();
	FLOAT			GetRealTime();
Dann geht ihr in
World3D.cpp
Sucht nach
Code:
// ī޶ 浹üũ ÿ µ.. 
BOOL CWorld::CheckBound(D3DXVECTOR3* vPos,D3DXVECTOR3* vDest,D3DXVECTOR3* vOut, FLOAT* fLength )
{
	D3DXVECTOR3 tempVec=(*(vPos)-*(vDest));// /10.0f;
	float length=D3DXVec3Length(&tempVec);
	D3DXVec3Normalize(&tempVec,&tempVec);
	tempVec/=10;
	D3DXVECTOR3 tempVec2=*(vDest);
	D3DXVECTOR3 vDist1, vDist2;
	float tempheight;
	BOOL	b1, b2;
	b1 = FALSE;	b2 = FALSE;
	tempVec2 += (tempVec * 10);		// ī޶ ڲ  *  .
	
	BOOL  bWaterChkDn = FALSE;
	BOOL  bWaterChkUp = FALSE;
	FLOAT fWaterHeight = 0.0f;
	LPWATERHEIGHT pWaterHeight = GetWaterHeight( *vDest );
	if( pWaterHeight && 
		( pWaterHeight->byWaterTexture & (byte)(~MASK_WATERFRAME)) == WTYPE_WATER )
	{
		fWaterHeight = (FLOAT)pWaterHeight->byWaterHeight;
		//vDest->y += 0.5f;
		
		if( fWaterHeight < vDest->y )
		{
			bWaterChkDn = TRUE;
		}
		else
		{
			bWaterChkUp = TRUE;
		}
	}					

	for( int i = 0; i < int( length * 10 ); i++ ) 
	{
		tempVec2+=tempVec;
		tempheight=GetLandHeight( tempVec2.x, tempVec2.z );
		#if __VER >= 11 // __FIX_PICKING
		// ī޶ ణ  ֱ ؼ*  - 07.10.24 - micky
		if(tempVec2.y<tempheight+0.6f)
		#else
		if(tempVec2.y<tempheight+0.3f)
		#endif
		{
			b1 = TRUE;
			vDist1 = tempVec2 - *vDest;		// *  ⺤
//			*(vOut)=tempVec2;
//			vOut->y+=1.1f;
//			return TRUE;
			break;
		}

		// ɸͰ  ְ,  ʾҴٸ  浹üũϿ ī޶  ȵ ó.
		D3DXVECTOR3 vWaterVec = tempVec2;
		//vWaterVec.y+=0.5f;
		if( bWaterChkDn )
		{
			if(vWaterVec.y<fWaterHeight+0.3f)
			{
				b1 = TRUE;
				vDist1 = vWaterVec - *vDest;	
				break;
			}
		}
#if __VER < 10
		else
		// ɸͰ  ְ, ٸ  浹üũϿ ī޶   ó
		if( bWaterChkUp )
		{
			if(vWaterVec.y>fWaterHeight-0.3f)
			{
				b1 = TRUE;
				vDist1 = vWaterVec - *vDest;	
				break;
			}
		}
#endif
	}
	D3DXVECTOR3 vIntersect;
	BOOL bRet = IntersectObjLine2( &vIntersect, *vDest, *vPos, TRUE );
	if( bRet )
	{
		b2 = TRUE;
		vDist2 = vIntersect - *vDest;		// *  ⺤
//		*vOut = vIntersect;
	}
	FLOAT	fDist1, fDist2;
	if( b1 == TRUE && b2 == TRUE )	// ̶ Ʈ  ߴ
	{
		fDist1 = D3DXVec3LengthSq( &vDist1 );
		fDist2 = D3DXVec3LengthSq( &vDist2 );
		if( fDist1 < fDist2 )		//   
		{
			*fLength = D3DXVec3Length( &vDist1 );
			*vOut = tempVec2;
		}
		else
		{
			*fLength = D3DXVec3Length( &vDist2 );
			*vOut = vIntersect;
		}
		return TRUE;
	} else
	if( b1 )	//  ε.
	{
		*fLength = D3DXVec3Length( &vDist1 );		
		*vOut = tempVec2;
		return TRUE;
	} else
	if( b2 )	// Ʈ ε
	{
		*fLength = D3DXVec3Length( &vDist2 );		
		*vOut = vIntersect;
		return TRUE;
	}

	// ƹ ε ʾҴ.
	*fLength = length;
	return FALSE;
}
fgt darunter ein
Code:
#ifdef __CLIENT
bool CWorld::IsNight(){
return ( g_GameTimer.m_nHour-1 <= 6 || g_GameTimer.m_nHour-1 >= 18 ); 
}
FLOAT CWorld::GetRealTime()
{
FLOAT nRlTime = 0;
nRlTime = (FLOAT)(g_GameTimer.m_nHour-1)*2;
if( g_GameTimer.m_nMin < 30 )
--nRlTime;
if( g_GameTimer.m_nHour-1 == 23 && g_GameTimer.m_nMin > 45 )
nRlTime+=0.5F;
if( nRlTime > 24 )
{
return ((-1)*(nRlTime - 48 ));
}
return nRlTime;
}
#endif
dadrunter set ihr
Code:
void CWorld::SetLight( BOOL bLight )
sucht in dieser funktion nach
Code:
			pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
			pLight->Appear( m_pd3dDevice, TRUE );
	
			DWORD dwR, dwG, dwB;
			dwR = (DWORD)( pLight->Ambient.r * 255 );
			dwG = (DWORD)( pLight->Ambient.g * 255 );
			dwB = (DWORD)( pLight->Ambient.b * 255 );
			dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
		}
	}
	else
	{
und added DADRBER!
Code:
#ifdef __DAY_NIGHT
if( !m_bIsIndoor ){
m_fFogStartValue = 10.0F;
m_fFogEndValue = 70.0F + GetRealTime() * 30.0F;
m_fFogDensity = 0.0F;
m_v3LightDir.x = 0.0F;
m_v3LightDir.y = -1.0F;
m_v3LightDir.z = 0.0F;
}
#endif // __DAY_NIGHT
jetz sucht ihr nach
Code:
if( m_bIsIndoor )
	{
		if( pLight )
		{		
			//  * 
			pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
			pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff)  / 255.f;
			pLight->Diffuse.b = ((m_dwDiffuse) & 0xff)     / 255.f;
und macht daraus
Code:
	if( m_bIsIndoor
#ifdef __DAY_NIGHT
|| IsNight()
#endif // __DAY_NIGHT
)


	{
		if( pLight )
		{		
			//  * 
			pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
			pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff)  / 255.f;
			pLight->Diffuse.b = ((m_dwDiffuse) & 0xff)     / 255.f;
dann in neuz/versioncommon.h
added ihr
Code:
#define __DAY_NIGHT
Fertig

Credtz an Pumbaaa



Jopsi332 is offline  
Thanks
9 Users
Old 11/23/2011, 18:46   #2

 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,162
Received Thanks: 14,383
gib wenigstens credits an...
eenn ich zuhaus bin nehm ich index auf


Sedrika is offline  
Old 11/23/2011, 18:49   #3

 
elite*gold: 21
Join Date: Nov 2010
Posts: 2,060
Received Thanks: 2,317
wo sind die Credits? das haste nie im Leben selbst gecodet
Deda94 is offline  
Old 11/23/2011, 18:53   #4
 
elite*gold: 4
Join Date: Mar 2010
Posts: 3,149
Received Thanks: 1,531
Quote:
Originally Posted by ToxicLibrary™ View Post
wo sind die Credits? das haste nie im Leben selbst gecodet
ich wrd ja mal die augen aufmachen

Edit fr die nachwelt :
wobei mir pumba auch nur 3snippets gegeben hat was ich damit machen muss mnusstte ich selber zusehen. also das war was er mir geschickt hat (genau so)
Code:
#ifdef __DAY_NIGHT
if( !m_bIsIndoor ){
m_fFogStartValue = 10.0F;
m_fFogEndValue = 70.0F + GetRealTime() * 30.0F;
m_fFogDensity = 0.0F;
m_v3LightDir.x = 0.0F;
m_v3LightDir.y = -1.0F;
m_v3LightDir.z = 0.0F;
}
#endif // __DAY_NIGHT
#ifdef __CLIENT
bool CWorld::IsNight(){
return ( g_GameTimer.m_nHour-1 <= 6 || g_GameTimer.m_nHour-1 >= 18 ); 
}
FLOAT CWorld::GetRealTime()
{
FLOAT nRlTime = 0;
nRlTime = (FLOAT)(g_GameTimer.m_nHour-1)*2;
if( g_GameTimer.m_nMin < 30 )
--nRlTime;
if( g_GameTimer.m_nHour-1 == 23 && g_GameTimer.m_nMin > 45 )
nRlTime+=0.5F;
if( nRlTime > 24 )
{
return ((-1)*(nRlTime - 48 ));
}
return nRlTime;
}
#endif
if( m_bIsIndoor
#ifdef __DAY_NIGHT
|| IsNight()
#endif // __DAY_NIGHT
)


Jopsi332 is offline  
Old 11/23/2011, 19:41   #5

 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,162
Received Thanks: 14,383
So es ist jetzt im Index
Sedrika is offline  
Old 11/23/2011, 19:43   #6
 
elite*gold: 1
Join Date: May 2010
Posts: 676
Received Thanks: 223
Nice , knntest mir das auch vorher sagen das du das Releast ansonsten nice!
Razzer' is offline  
Old 11/23/2011, 19:43   #7
 
elite*gold: 0
Join Date: Dec 2009
Posts: 113
Received Thanks: 21
Also ich muss sagen, ich finds echt n1
Kann man gut gebrauchen ^^
Waat is offline  
Old 11/23/2011, 19:56   #8

 
elite*gold: 21
Join Date: Nov 2010
Posts: 2,060
Received Thanks: 2,317
Dann gib Pumbaaa Credits Ist ja keine Meisterleistung es an den richtigen Platz zu setzen
Deda94 is offline  
Old 11/23/2011, 20:01   #9
 
elite*gold: 6
Join Date: Oct 2011
Posts: 506
Received Thanks: 84
Echt nice werde es auf jedne fall benutzten

EDIT: Brauch man keine Files fr den Weather ordner?
N8Schatten is offline  
Old 11/23/2011, 20:07   #10
 
elite*gold: 1
Join Date: May 2010
Posts: 676
Received Thanks: 223
Nein , man braucht kein Weather files , der Ordner ist ja nur fr Sternhimmel etc.
Razzer' is offline  
Thanks
1 User
Old 11/23/2011, 20:10   #11
 
elite*gold: 4
Join Date: Mar 2010
Posts: 3,149
Received Thanks: 1,531
Quote:
Originally Posted by ToxicLibrary View Post
Dann gib Pumbaaa Credits Ist ja keine Meisterleistung es an den richtigen Platz zu setzen
du bist immer noch blind. die stehen schon die ganze zeit . schon vor deinem 1.post im thread xD
Jopsi332 is offline  
Old 11/23/2011, 20:12   #12
 
elite*gold: 455
Join Date: Jun 2009
Posts: 1,601
Received Thanks: 1,103
Quote:
Originally Posted by ToxicLibrary View Post
Dann gib Pumbaaa Credits Ist ja keine Meisterleistung es an den richtigen Platz zu setzen
Quote:
Originally Posted by Jopsi332

[...]
Fertig

Credtz an Pumbaaa
Lesen bildet :3
Flash! is offline  
Thanks
3 Users
Old 11/23/2011, 20:16   #13
 
elite*gold: 59
Join Date: Aug 2009
Posts: 1,570
Received Thanks: 487
Meiner Meinung nach wrds mehr sinn haben, wenn sichs an die Reale Zeit anpasst net an die Madrigal Time.. ^_^
.Tear is offline  
Old 11/23/2011, 20:26   #14
 
elite*gold: 0
Join Date: Oct 2011
Posts: 363
Received Thanks: 160
Nice Release

Endlich 1 Release mehr
.Zephion is offline  
Old 11/23/2011, 20:28   #15
 
elite*gold: 4
Join Date: Mar 2010
Posts: 3,149
Received Thanks: 1,531
Quote:
Originally Posted by Waat View Post
Aber dann wrde es etwas lange dauern, wenn man sich z.B. ansehen will, wie es dunkler bzw. heller wird, oder nicht ? ^^
kommt drauf an in welchen zeitabstnden du es dann dunkel lassen wirst.
rein theopraktisch <- lol xD
wre es am coolsten die aktuelle server zeit dem client zu bermitteln und dadrber. so knnte man night events machen. aber das nur in der theroie, die praxis wird da schwer XD


Jopsi332 is offline  
Reply



« Decrypter Giant Of War | [Release] Online Player List Tool »

Similar Threads
[Source] v16 Map System
11/12/2018 - Flyff PServer Guides & Releases - 104 Replies
In diesem mini TuT, zeige ich euch, wie man das v16 Map System nutzen kann. Diesesmal hat uns Offi einen sehr groen teil abgenommen und alles schon reingehauen in v15 ^^ so das wir es eigendlich nur noch aktivieren mssen und dann die ntigen resourcen dafr einbringen. Wir gehen in der Neuz in die VersionCommon.h und schreiben folgendes hinein: #define __IMPROVE_MAP_SYSTEMDamit ist es eingeschaltet und nun brauchen wir noch die richtigen resource dateien, damit diese Funktionieren....
[RELEASE] Source for old ip farm system
03/14/2011 - League of Legends Main - Discussions / Questions - 8 Replies
Hay guys here i give u my beta bot version for old lol GUI style. Its programe in AutoIT its made by simple functions, maybe some of u guys need it, i end with LOL so i can release it here u have ;#include <GuiConstants.au3> #include <INet.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3>
[Release] Socket System for Hybrids Source!
05/12/2010 - CO2 PServer Guides & Releases - 22 Replies
Apple Pie is amazing!!!!
[Release] event handler / system message for 5165 source
05/01/2010 - CO2 PServer Guides & Releases - 10 Replies
i was partially made this and completed by pringle, i dont know if pringle is in here in this forum. but still credit to him. Go to Program.cs and find:public static Random Rnd = new Random(); Above this add:public static DateTime SystemMsgTime = new DateTime(); scroll down and you found this static void ServerStuff_Execute() { try { if (World.BroadCastCount > 0 && DateTime.Now > World.LastBroadCast.AddMinutes(1)) {



All times are GMT +1. The time now is 08:39.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.