PDA

View Full Version : [C++ QUESTION] Booling RemoveFog Function?


DarkEvilTwin`
23rd July 2005, 21:47
I'm trying to bool the RemoveFog function of Tamimego so I can turn it on and off with his DrawString Menu.
Compiling without errors, but when i'm ingame, and im trying to switch the nofog off, it doesnt work.
Can anyone help me out plz?

bool:bool bRemoveFog = true;

RemoveFog function:void inline RemoveFog ()
{
if (!bRemoveFog) return;

for (TObjectIterator<AZoneInfo> Target; Target; ++Target)
{
AZoneInfo* ZI = *Target;
ZI->bClearToFogColor = false;
ZI->bDistanceFog = false;
}
}

added the function into DrawMySettings function: SetPos(20, Canvas->ClipY / 2 + 50);
appSprintf( StrTemp,TEXT("RemoveFog"));
Canvas->pCanvasUtil->DrawString(Canvas->CurX, Canvas->CurY, StrTemp, Canvas->TinyFont, FColor(9,99,141,255));
OnOff(Canvas, bRemoveFog);

added the function into DrawMySwitches function: case 3:
SetPos(10, PosY+30) // + 10 Y From Last Case (Change To Your Menu Space Y)
if (Toggle)// If Toggle Is On Switch Bool
bRemoveFog = !bRemoveFog; // Bool To Switch
Toggle = false;
break;

I can configurate thru the menu and switch the RemoveFog on and off, but it doesn't Remove my fog :(
Anyone know how to fix the problem?

ScreenShot:
- http://img347.imageshack.us/img347/1453/etbv11139df.png
- I didnt had autoaim on when i was turning left of the enemy then quickly turned on and made screenshot ^^

- kthx.

ReckaH
23rd July 2005, 23:00
void inline RemoveFog ()
{
for (TObjectIterator<AZoneInfo> Target; Target; ++Target)
{

AZoneInfo* ZI = *Target;

if (bRemoveFog)
{

ZI->bClearToFogColor = False;
ZI->bDistanceFog = False;
}
else
{
ZI->bClearToFogColor = True;
ZI->bDistanceFog = True;
}
}
}

DarkEvilTwin`
23rd July 2005, 23:08
Tested it, didn't work.

HyPeR-X
23rd July 2005, 23:39
What about:


bool bNoFog = true;

void CheckKeys ()
{
if (GetASyncKeyState(VK_NUMPAD0)& == 1)
{
bNoFog = !bNoFog;
FogHack();
}
}

void FogHack ()
{
if ((MyController != NULL) && (MyController->Region != NULL) && (MyController->Region->Zone != NULL))
{
MyController->Region->Zone->bDistanceFog = bNoFog;
}
}


Just something i coded without even looking at header's so i'm not 100% sure if you can use this method but something simulair to this should work ;)

- HyPz

ReckaH
23rd July 2005, 23:45
Thats a good way to do it hyper but you should have

MyController->Region->Zone->bDistanceFog = !bNoFog;

Since if nofog = true you don't want any fog.

HyPeR-X
24th July 2005, 10:58
Thats a good way to do it hyper but you should have

MyController->Region->Zone->bDistanceFog = !bNoFog;

Since if nofog = true you don't want any fog.

Ye, just read it i first tryed it in another way but i messed it up a bit, let me post the best way:


void CheckKeys ()
{
if (GetASyncKeyState(VK_NUMPAD0)& == 1)
{
if ((MyController != NULL) && (MyController->Region != NULL) && (MyController->Region->Zone != NULL))
{
MyController->Region->Zone->bDistanceFog = !MyController->Region->Zone->bDistanceFog;
}
}
}


Just switch the param's directly ;)

- HyPz

I Like Chicken
24th July 2005, 11:02
if(Me->Pawn->Region.Zone->bDistanceFog != !bNoFog)
Me->Pawn->Region.Zone->bDistanceFog = !bNoFog;

I just have that in post render.