Hi lads.
Im currently working on a version of BattleShips that allows ships to submerge down to the ground of the sea, offering a second plane to fight. My trigger in GUI works pretty well, but i stumbled across some problems concering fade filters. As a total JASS newbie (yeah, im working on that ) i dont really know how to adapt a fade filter (white mask, slightly blue transparent to show you are really underwater) so that it only affects the submerging player, not everyone. As far as i know, it's JASS only, and I know this works, because I've seen it in a map called Water Wars - but as i said, im a newb. I just want to know what to script in order to achieve this effect (and maybe to end it upon emerging from the ground)
Here's my first trigger:
Code:
A little explanation: It sets the camera field to the underwater zone, so noone can watch the upper and the lower plane the same time. It also makes all items carried by the hero undroppable and sets his movement speed to 50%. It would be great if the trigger would also create a fade filter for the player until his hero "emerges" from the sea.
And here's the "Emerge" Trigger:
Code:
I hope you can tell me what and where to script my trigger in order to recieve the effect I want.
Greetings, Atarion
Im currently working on a version of BattleShips that allows ships to submerge down to the ground of the sea, offering a second plane to fight. My trigger in GUI works pretty well, but i stumbled across some problems concering fade filters. As a total JASS newbie (yeah, im working on that ) i dont really know how to adapt a fade filter (white mask, slightly blue transparent to show you are really underwater) so that it only affects the submerging player, not everyone. As far as i know, it's JASS only, and I know this works, because I've seen it in a map called Water Wars - but as i said, im a newb. I just want to know what to script in order to achieve this effect (and maybe to end it upon emerging from the ground)
Here's my first trigger:
Code:
JASS:
function Trig_SubmersionDownwards_Actions takes nothing returns nothing
call CameraSetTargetNoiseForPlayer( GetOwningPlayer(GetTriggerUnit()), 10.00, 1.00 )
call SetCameraBoundsToRectForPlayerBJ( GetOwningPlayer(GetTriggerUnit()), gg_rct_Submersion )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call SetItemDroppableBJ( UnitItemInSlotBJ(GetEnteringUnit(), GetForLoopIndexA()), false )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set udg_ShipSpeedSubmersion[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetUnitMoveSpeed(GetTriggerUnit())
call SetUnitMoveSpeed( GetEnteringUnit(), ( GetUnitMoveSpeed(GetTriggerUnit()) / 2.00 ) )
endfunction
//===========================================================================
function InitTrig_SubmersionDownwards takes nothing returns nothing
set gg_trg_SubmersionDownwards = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_SubmersionDownwards, gg_rct_Submersion )
call TriggerAddAction( gg_trg_SubmersionDownwards, function Trig_SubmersionDownwards_Actions )
endfunction
A little explanation: It sets the camera field to the underwater zone, so noone can watch the upper and the lower plane the same time. It also makes all items carried by the hero undroppable and sets his movement speed to 50%. It would be great if the trigger would also create a fade filter for the player until his hero "emerges" from the sea.
And here's the "Emerge" Trigger:
Code:
JASS:
function Trig_SubmersionUpwards_Actions takes nothing returns nothing
call PanCameraToTimedLocForPlayer( GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), 0 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call SetItemDroppableBJ( UnitItemInSlotBJ(GetEnteringUnit(), GetForLoopIndexA()), true )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call SetUnitMoveSpeed( GetEnteringUnit(), udg_ShipSpeedSubmersion[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] )
endfunction
//===========================================================================
function InitTrig_SubmersionUpwards takes nothing returns nothing
set gg_trg_SubmersionUpwards = CreateTrigger( )
call TriggerRegisterLeaveRectSimple( gg_trg_SubmersionUpwards, gg_rct_Submersion )
call TriggerAddAction( gg_trg_SubmersionUpwards, function Trig_SubmersionUpwards_Actions )
endfunction
I hope you can tell me what and where to script my trigger in order to recieve the effect I want.
Greetings, Atarion
Last edited: