• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Troubles with GetConvertedPlayerId, ect...

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2008
Messages
243
  • NewGame
    • Events
      • Player - Player 1 (Red) types a chat message containing -new as An exact match
      • Player - Player 2 (Blue) types a chat message containing -new as An exact match
      • Player - Player 3 (Teal) types a chat message containing -new as An exact match
      • Player - Player 4 (Purple) types a chat message containing -new as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -new as An exact match
      • Player - Player 6 (Orange) types a chat message containing -new as An exact match
      • Player - Player 7 (Green) types a chat message containing -new as An exact match
      • Player - Player 8 (Pink) types a chat message containing -new as An exact match
      • Player - Player 9 (Gray) types a chat message containing -new as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -new as An exact match
    • Conditions
      • NewGame[(Player number of (Triggering player))] Equal to False
    • Actions
      • Cinematic - Clear the screen of text messages for (Player group((Triggering player)))
      • Set NewGame[(Player number of (Triggering player))] = True
      • Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: |cffffcc66This map ...
      • Wait 5.00 seconds
      • Cinematic - Clear the screen of text messages for (Player group((Triggering player)))
      • Visibility - Create an initially Enabled visibility modifier for (Triggering player) emitting Visibility across Region 294 <gen>
      • Camera - Apply 1 Pala Cam <gen> for (Triggering player) over 0.00 seconds
      • Custom script: if ?
      • Cinematic - Fade in over 2.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Custom script: endif
      • Cinematic - Turn subtitle display override On
      • Game - Display to (Player group((Triggering player))) for 300.00 seconds the text: |cffffcc66Paladin|r...
      • Cinematic - Enable user control for (Player group((Triggering player)))
      • Selection - Select Paladin 0063 <gen> for (Triggering player)
      • Player Group - Add (Triggering player) to ViewingPaladin
      • Player Group - Add (Triggering player) to LeftRightCommands
      • Player Group - Remove (Player((Player number of (Triggering player)))) from ViewingNothing
A previous trigger fades the screen to black for all players. Basically, when a player triggers this I want the triggering players screen to fade in.
I've tried
JASS:
Custom script:   if GetLocalPlayer() == GetTriggerPlayer() then
which just disconnected other players, since
JASS:
GetLocalPlayer
doesn't react well to wait timers, so I know I have to use
JASS:
GetConvertedPlayerId(GetTriggerPlayer())
, or just
JASS:
GetPlayerID(GetTriggerPlayer())
, but these both seem like something that should be put in the braces. (me not remembering whether the braces are functions or... what-not)
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
It's not the way you set up the GetLocalPlayer() if statement, it's what you put between the if and endif.

I dunno how GUI reacts with getlocalplayer() ifs. But I imagine that cinematic code is not meant to be put between the if and endif. Try converting to custom script and making sure.

JASS:
function CinematicFadeBJ takes integer fadetype, real duration, string tex, real red, real green, real blue, real trans returns nothing
    if (fadetype == bj_CINEFADETYPE_FADEOUT) then
        // Fade out to the requested color.
        call AbortCinematicFadeBJ()
        call CinematicFadeCommonBJ(red, green, blue, duration, tex, 100, trans)
    elseif (fadetype == bj_CINEFADETYPE_FADEIN) then
        // Fade in from the requested color.
        call AbortCinematicFadeBJ()
        call CinematicFadeCommonBJ(red, green, blue, duration, tex, trans, 100)
        call FinishCinematicFadeAfterBJ(duration)
    elseif (fadetype == bj_CINEFADETYPE_FADEOUTIN) then
        // Fade out to the requested color, and then fade back in from it.
        if (duration > 0) then
            call AbortCinematicFadeBJ()
            call CinematicFadeCommonBJ(red, green, blue, duration * 0.5, tex, 100, trans)
            call ContinueCinematicFadeAfterBJ(duration * 0.5, red, green, blue, trans, tex)
            call FinishCinematicFadeAfterBJ(duration)
        endif
    else
        // Unrecognized fadetype - ignore the request.
    endif
endfunction

This is what the function you're looking at does. All that red text does even more thing in it's own catagory. You need something that runs natives, not BJs, I would assume. You'd have to simplify that code and then use it. That, m yfriend, is more than I'd want to handle :X

Luckily all you need is the stuff after Fade In. So you'd have to find a way to use and simplify Abort Cinematic for local code.

FinishCinematicFadeAfterBJ would be the other you'd simplify.

They use timers, and timers should not be in net code unless you want desync.

Anyways, you'll find to find another way to do this for players. Lose this method.
 
Level 7
Joined
Dec 8, 2008
Messages
243
Sorry to revive this thread, but I've still not found a fix to this. I'm trying to avoid using more than single lines of custom script.
I know the
  • Cinematic - Fade in over 2.00 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
as a trigger works fine for what I'm after.
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
The ( ) braces are the parameters, or the bits of information, a function takes to do it's job.

The problem is in the if statement you need to be comparing two things, and the only thing you can compare is GetLocalPlayer(), which isolates camera and screen work for a single player on battlenet.

The function you're using seems to do this stuff for ALL players. I'm not a cinematics expert. You may want to ask in the appropriate forums:

http://www.hiveworkshop.com/forums/cinematics-268/
 
Status
Not open for further replies.
Top