HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Fog For Certain Players

07-19-2006, 06:30 AM#1
illidan92
Okay I used search forums and didn't get exactly what im looking for, so i'm posting it.
How do I set terrain fog only for certain players? I see it in many maps that use night vision, but how?
07-19-2006, 06:42 AM#2
PipeDream
Collapse JASS:
if GetLocalPlayer() == whichPlayer then
  call SetTerrainFogEx(integer style,real zstart,real zend,real density, real red, real green, real blue)
endif
Check your war3map.j for parameter choices

Chances are you'll also want to use a local cinematic fade filter. That is outlined here.
07-19-2006, 10:44 PM#3
illidan92
Holy crap it's a JASS I think I can actually use!
Lol anyways thanks PipeDream helps a lot.
I think I can just use WEU for fade filters though but thx anyways.
07-20-2006, 04:02 PM#4
James1654
Awww man, Its a pity that no-one helped me with my simular trigger when i asked a few days back ... Nobody loves me! waaaaaa :*(


Oh btw, thanks for the trigger, it helped me too :) KTHXBAI
07-20-2006, 04:19 PM#5
iNfraNe
I can tell you why noone helped you. Your thread title:
"Help! I am totally stuck"
Noone cares about a thread if there's no subject.
07-20-2006, 05:35 PM#6
James1654
Ah good point, i supose, the thread i posted was noobishly named. Anyway, rep given for the jass, pipeframe, needed it.
07-20-2006, 10:42 PM#7
illidan92
It keeps coming up with a bunch of script errors! Heres my trigger:
Collapse JASS:
function Trig_Night_Vision_Goggles_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00P' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Night_Vision_Goggles_Actions takes nothing returns nothing
endfunction

//===========================================================================
function InitTrig_Night_Vision_Goggles takes nothing returns nothing
    set gg_trg_Night_Vision_Goggles = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Night_Vision_Goggles, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Night_Vision_Goggles, Condition( function Trig_Night_Vision_Goggles_Conditions ) )
    call TriggerAddAction( gg_trg_Night_Vision_Goggles, function Trig_Night_Vision_Goggles_Actions )
endfunction

if GetLocalPlayer() == ( GetOwningPlayer(GetSpellAbilityUnit()) then
  call SetTerrainFogEx( 0, 0.00, 4500.00, 50.00, 0.00, 100, 0.00 )
endif

Whats wrong with it?
Has like 18 script problems. On "Call SetTerrainFogEx" it says expected a function name. I don't know what to do!
07-20-2006, 11:01 PM#8
Alevice
You meant:

Collapse JASS:
function Trig_Night_Vision_Goggles_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00P' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Night_Vision_Goggles_Actions takes nothing returns nothing
    if GetLocalPlayer() == ( GetOwningPlayer(GetSpellAbilityUnit()) then
      call SetTerrainFogEx( 0, 0.00, 4500.00, 50.00, 0.00, 100, 0.00 )
    endif
endfunction

//===========================================================================
function InitTrig_Night_Vision_Goggles takes nothing returns nothing
    set gg_trg_Night_Vision_Goggles = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Night_Vision_Goggles, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Night_Vision_Goggles, Condition( function Trig_Night_Vision_Goggles_Conditions ) )
    call TriggerAddAction( gg_trg_Night_Vision_Goggles, function Trig_Night_Vision_Goggles_Actions )
endfunction

07-21-2006, 03:03 AM#9
illidan92
Comes up with 7 compile errors now (not as much so ty) and they are:
-Expected ')' at if GetLocalPlayer() == ( GetOwningPlayer(GetSpellAbilityUnit()) then
-Expected a code statement at endif (under "Call set terainfogex)
-Expected a variable name at set gg_trg_Night_Vision_Goggles = CreateTrigger( )
-Expected a name at:
1: call TriggerRegisterAnyUnitEventBJ( gg_trg_Night_Vision_Goggles, EVENT_PLAYER_UNIT_SPELL_CAST )
2: call TriggerAddCondition( gg_trg_Night_Vision_Goggles, Condition( function Trig_Night_Vision_Goggles_Conditions ) )
3: call TriggerAddAction( gg_trg_Night_Vision_Goggles, function Trig_Night_Vision_Goggles_Actions )
-Expected a function name at call InitTrig_Night_Vision( )

Any idea what the problem is this time >.<? (not very good with JASS)
Also it says when I press enable "The trigger Night Vision must have an initialization function called 'InitTrig_Night_Vision'."
07-21-2006, 03:08 AM#10
Alevice
I was missing a closing parenthesis. Updated:

Collapse JASS:
if GetLocalPlayer() == ( GetOwningPlayer(GetSpellAbilityUnit())) then

Hopefully it will work now.
07-21-2006, 03:29 AM#11
illidan92
It needs an initialization function called 'InitTrig_Night_Vision' wtf does that mean?
07-21-2006, 03:44 AM#12
Alevice
In your script your trigger is called Night Vision Goggles, but it seems that your trigger name is just Night Vision. Remove the _Goggles in every part of the script.
07-21-2006, 03:51 AM#13
illidan92
Ur so helpful Alevice ty ty!
07-21-2006, 03:51 AM#14
Alevice
You're welcome.
07-21-2006, 01:11 PM#15
James1654
My code wont work, either:

function Trig_water_fog2_Actions takes nothing returns nothing
endfunction
function Trig_waterfog2_Actions takes nothing returns nothing
if GetLocalPlayer() == (GetTriggerPlayer()) then
call SetTerrainFogEx( 0, 0.00, 4500.00, 50.00, 0.00, 100, 0.00 )
endif
endfunction
endfunction
function Trig_waterfog2_Actions takes nothing returns nothing
if GetLocalPlayer() == (GetTriggerPlayer()) then
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.00, "ReplaceableTextures\\CameraMasks\\HazeAndFogFilter_Mask.blp", 0, 65.00, 85.00, 90.00 )
endfunction
endif
endfunction
//===========================================================================
function InitTrig_water_fog2 takes nothing returns nothing
set gg_trg_water_fog2 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_water_fog2, Player(0), "-up", true )
call TriggerAddAction( gg_trg_water_fog2, function Trig_water_fog2_Actions )
endfunction

Erm, can anyone help me with this? I had 84 compile errors. I can't do Jass to save my life, but I really need this because it is unavailable in gui, and its really delaying the progress of my map so far.


p.s: sorry, i couldn't get a code window up on my message. I tried.