HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Revival Shyshtems

06-02-2009, 11:21 AM#1
Sunwarrior25
Ok, I'm trying to figure out why this is reviving the hero properly, but not showing/hiding the timer and fog as it's supposed to:
Trigger:
Collapse SetupForces
Events
Conditions
Collapse Actions
-------- ... --------
-------- Red: Players --------
Set PlayerHero[0] = Wisp 0092 <gen>
Set Player[0] = Player 4 (Purple)
Player Group - Add Player[0] to TeamGroup[0]
Set PlayerHero[1] = Wisp 0094 <gen>
Set Player[1] = Player 5 (Yellow)
Player Group - Add Player[1] to TeamGroup[0]
Set PlayerHero[2] = Wisp 0090 <gen>
Set Player[2] = Player 6 (Orange)
Player Group - Add Player[2] to TeamGroup[0]
Set PlayerHero[3] = Wisp 0093 <gen>
Set Player[3] = Player 8 (Pink)
Player Group - Add Player[3] to TeamGroup[0]
-------- ... --------
-------- Blue: Players --------
Set PlayerHero[4] = Wisp 0027 <gen>
Set Player[4] = Player 3 (Teal)
Player Group - Add Player[4] to TeamGroup[1]
Set PlayerHero[5] = Wisp 0012 <gen>
Set Player[5] = Player 9 (Gray)
Player Group - Add Player[5] to TeamGroup[1]
Set PlayerHero[6] = Wisp 0086 <gen>
Set Player[6] = Player 10 (Light Blue)
Player Group - Add Player[6] to TeamGroup[1]
Set PlayerHero[7] = Wisp 0085 <gen>
Set Player[7] = Player 12 (Brown)
Player Group - Add Player[7] to TeamGroup[1]
-------- Set Blue Team to Blue --------
Player - Change color of Player 3 (Teal) to Blue, Changing color of existing units
Player - Change color of Player 9 (Gray) to Blue, Changing color of existing units
Player - Change color of Player 10 (Light Blue) to Blue, Changing color of existing units
Player - Change color of Player 12 (Brown) to Blue, Changing color of existing units
-------- ... --------
Collapse HeroDeath Norm
Collapse Events
Unit - A unit Dies
Conditions
Collapse Actions
Collapse For each (Integer A) from 0 to 7, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Dying unit) Equal to PlayerHero[(Integer A)]
Collapse Then - Actions
Countdown Timer - Start TimerDeath[(Integer A)] as a One-shot timer that will expire in (10.00 + (2.00 x (Real((Hero level of PlayerHero[(Integer A)]))))) seconds
Countdown Timer - Create a timer window for TimerDeath[(Integer A)] with title Dead:
Set WindowDeath[(Integer A)] = (Last created timer window)
Countdown Timer - Show WindowDeath[(Integer A)] for Player[(Integer A)]
Cinematic - Fade out over 5.00 seconds using texture White Mask and color (50.00%, 50.00%, 50.00%) with 50.00% transparency
Else - Actions
Collapse HeroRevive Norm
Collapse Events
Time - TimerDeath[0] expires
Time - TimerDeath[1] expires
Time - TimerDeath[2] expires
Time - TimerDeath[3] expires
Time - TimerDeath[4] expires
Time - TimerDeath[5] expires
Time - TimerDeath[6] expires
Time - TimerDeath[7] expires
Conditions
Collapse Actions
Collapse For each (Integer A) from 0 to 3, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((PlayerHero[(Integer A)] is dead) Equal to True) and ((Remaining time for TimerDeath[(Integer A)]) Less than or equal to 0.00)
Collapse Then - Actions
Countdown Timer - Hide WindowDeath[(Integer A)]
Countdown Timer - Destroy WindowDeath[(Integer A)]
Cinematic - Fade in over 2.00 seconds using texture White Mask and color (50.00%, 50.00%, 50.00%) with 50.00% transparency
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of Resurrection Shrine (Control Point) 0068 <gen>) Equal to Player 1 (Red)
Collapse Then - Actions
Hero - Instantly revive PlayerHero[(Integer A)] at (Position of Resurrection Shrine (Control Point) 0068 <gen>), Show revival graphics
Camera - Pan camera for Player[(Integer A)] to (Position of Resurrection Shrine (Control Point) 0068 <gen>) over 0.00 seconds
Collapse Else - Actions
Hero - Instantly revive PlayerHero[(Integer A)] at (Position of Resurrection Shrine (Control Point) 0021 <gen>), Show revival graphics
Camera - Pan camera for Player[(Integer A)] to (Position of Resurrection Shrine (Control Point) 0021 <gen>) over 0.00 seconds
Else - Actions
Collapse For each (Integer A) from 4 to 7, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((PlayerHero[(Integer A)] is dead) Equal to True) and ((Remaining time for TimerDeath[(Integer A)]) Less than or equal to 0.00)
Collapse Then - Actions
Countdown Timer - Hide WindowDeath[(Integer A)]
Countdown Timer - Destroy WindowDeath[(Integer A)]
Cinematic - Fade in over 2.00 seconds using texture White Mask and color (50.00%, 50.00%, 50.00%) with 50.00% transparency
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of Resurrection Shrine (Control Point) 0068 <gen>) Equal to Player 2 (Blue)
Collapse Then - Actions
Hero - Instantly revive PlayerHero[(Integer A)] at (Position of Resurrection Shrine (Control Point) 0068 <gen>), Show revival graphics
Camera - Pan camera for Player[(Integer A)] to (Position of Resurrection Shrine (Control Point) 0068 <gen>) over 0.00 seconds
Collapse Else - Actions
Hero - Instantly revive PlayerHero[(Integer A)] at (Position of Resurrection Shrine (Control Point) 0020 <gen>), Show revival graphics
Camera - Pan camera for Player[(Integer A)] to (Position of Resurrection Shrine (Control Point) 0020 <gen>) over 0.00 seconds
Else - Actions

EDIT before posting: now that I look at it, the fog isn't supposed to show for everybody

EDIT (after posting): I guess it helps if I put in the setup trigger. It's in there before the other two.
06-02-2009, 11:57 AM#2
0zyx0
Saying it is not doing what it is supposed to do isn't very helpful. What does it do instead?
06-02-2009, 01:23 PM#3
Sunwarrior25
Ok, the fog fade-in/out I easily figured out, but the timer... Somehow, the timer is displayed for everybody, instead of the owner of the dying hero. (Also, how do I get the cinematic fade thingy to only show for one player?)
06-02-2009, 02:00 PM#4
Fireeye
Quote:
Originally Posted by Sunwarrior25
Ok, the fog fade-in/out I easily figured out, but the timer... Somehow, the timer is displayed for everybody, instead of the owner of the dying hero. (Also, how do I get the cinematic fade thingy to only show for one player?)

The problem of the timer shown to everybody propably lies in the usage of Player(0) in GUI, due it's range is 1-16 in GUI, but 0-15 in JASS.

Hidden information:
Collapse JASS:
function ConvertedPlayer takes integer convertedPlayerId returns player
    return Player(convertedPlayerId - 1)
endfunction


About showing a cinematic fade to only 1 player, you HAVE to use JASS.
It's not really makeable in GUI.
It would look in this direction...
Pseudo code

Collapse JASS:
function whatever takes nothing returns nothing
    local string s = ""
    if GetOwningPlayer(GetTriggerUnit()) == GetLocalPlayer() then
        set s = "ReplaceableTextures\\CameraMasks\\White_mask.blp"
    endif
    call CinematicFadeBJ(...)
endfunction

06-02-2009, 04:14 PM#5
Sunwarrior25
Meh, put the part of the setup trigger where I set those things up there. It really uses 1 instead of 0? Huh. Too used to Java.
Quote:
About showing a cinematic fade to only 1 player, you HAVE to use JASS.
It's not really makeable in GUI.
It would look in this direction...
So, do I just convert both of the rez triggers to custom script? And then what?
06-02-2009, 06:11 PM#6
Fireeye
Then you set the string for the fade filter at the initial stage to "" (empty string) and for the wanted player, in this case the owner of hero n, equal to the wanted filter.
If you have translated it, it'll look like this..
Collapse JASS:
function whatever takes nothing returns nothing
    //some code
    call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0, 0, 0, 0 ) //This is the important line
    //some more code
endfunction
Then you change it this way
Collapse JASS:
function whatever takes nothing returns nothing
    local string s = ""
    //some code
    if GetLocalPlayer() == GetOwningPlayer(udg_PlayerHero[ARRAY_SLOT])) then //too lazy to look in the WE for Loop Integer A, but you know what i mean with ARRAY_SLOT
        set s = "ReplaceableTextures\\CameraMasks\\White_mask.blp"
    endif
    call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 2, s, 0, 0, 0, 0 )
    //some more code

I hope i didn't made any stupid mistake, kinda sleepy atm.
06-03-2009, 12:02 AM#7
Sunwarrior25
Alright, I did it to the map. Can't really test it in multiplayer though.

EDIT: Mr. Peppers seems to have found (and fixed) an issue with the methods above. I'll just go ahead and +Coffee-Mocha you guys anyway :p