function AddFogForPlayer takes real start, real end, real Red, real Green, real Blue, player whichplayer returns nothing
local integer i = 0
if (udg_Fog_Player_CurrentFogRed[GetPlayerId(whichplayer) + 1] == Red) then
set i = i + 1
endif
if (udg_Fog_Player_CurrentFogGreen[GetPlayerId(whichplayer) + 1] == Green) then
set i = i + 1
endif
if (udg_Fog_Player_CurrentFogBlue[GetPlayerId(whichplayer) + 1] == Blue) then
set i = i + 1
endif
if (i < 3) then
set udg_Fog_Player_FogZ_Start[GetPlayerId(whichplayer) + 1] = start
set udg_Fog_Player_FogZ_End[GetPlayerId(whichplayer) + 1] = end
set udg_Fog_Player_FogRed[GetPlayerId(whichplayer) + 1] = Red
set udg_Fog_Player_FogBlue[GetPlayerId(whichplayer) + 1] = Blue
set udg_Fog_Player_FogGreen[GetPlayerId(whichplayer) + 1] = Green
set udg_Fog_Player_FogFading[GetPlayerId(whichplayer) + 1] = true
call EnableTrigger( gg_trg_Fog_Fade_System )
endif
endfunction
Name | Type | is_array | initial_value |
Fog_ChangeSpeed | real | No | |
Fog_FogInt | integer | No | |
Fog_Player | player | Yes | |
Fog_Player_CurrentFogBlue | real | Yes | |
Fog_Player_CurrentFogGreen | real | Yes | |
Fog_Player_CurrentFogRed | real | Yes | |
Fog_Player_FogBlue | real | Yes | |
Fog_Player_FogFading | boolean | Yes | |
Fog_Player_FogGreen | real | Yes | |
Fog_Player_FogRed | real | Yes | |
Fog_Player_FogZ_End | real | Yes | |
Fog_Player_FogZ_Start | real | Yes |
###########################################################################################################
###########################################################################################################
################################ THE_FLOOD'S FOG SYSTEM ###################################################
################################ VERSION: 1.2.1a #################################################
###########################################################################################################
This system is created by The_Flood (Flood @ hiveworkshop). Give credits when used or modified.
You may edit this system how much you want, but don't contact me if your changes does not work properly,
because that isn't my problem, but if you haven't modified anything and the system isn't working as it
should, please contact me then! =)
The_Flood's Fog System is a system that allow you to create an original way of changing the fog in-game.
The system is very useful for RPG maps, when you can make the areas more unique with different fogs. The
bonus of this system is that the fog you will change to, will not be changes directly, it will be changed
smoothly to the numbers you've chosen.
This system is also MPI, allowing up to 12 players use it at the same time. I'm using
GetLocalPlayer() to make sure each player has it's own fog.
This system is user-friendly and has no leaks at all, so have fun using it!
###########################################################################################################
[How do I import this system?]
It's simple. Paste the whole folder "The_Flood's Fog System" into your map and make sure you've checked the
"[X] Automatically create unknown variables while pasting trigger data" in File > Preferences.
Also, you need to copy some script that can be found under the script folder called: "The_Floods_FogSystem.w3x" and
paste it at the same place in your map.
When you've done this, you can start using this system!
###########################################################################################################
[How do I use this system?]
It's very simple! If you check the EXAMPLE triggers you'll see. Only ONE function call will change the fog as
you want it to. So, what is what? Check below.
Custom script: call AddFogForPlayer(400, 2500, 10, 10, 10, udg_Fog_Player[0])
400 = This is the number of where the fog will start (z).
2500 = This is the number of where the fog will end (z).
1st 10 = This is the % of how much of the color RED the fog will use.
2nd 10 = This is the % of how much of the color GREEN the fog will use.
3rd 10 = This is the % of how much of the color BLUE the fog will use.
udg_Fog_Okayer[0] = This is the player that will have its fog changed.
Simple isn't it? Remember that the % has a maximum of 100!
Also, in the Fog Fade System Initialization trigger you can change the start fog to the one you want.
You can also change the speed of the fog change. A higher value will make the fog changing faster.
Set Fog_ChangeSpeed = 2.00
Note: As you can see in the EXAMPLE triggers, I'm using a region as the event. If you will also use regions, make sure
you leave a small space between the "fog regions", like in this test map.