HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Making a picture pop up for a player

05-23-2006, 02:15 PM#1
Soultaker
Hey guys :)

I'm trying to make a picture pop up for an player when I write -send (x). That part works fine, but I can't make the picture pop up.. I was thinking of using some JASS for popping it up for only one player, but I can't make create it at all.

I tried using this tutorial, but I can't get it to work.

Anyone got an idea how to make an image pop up?

- Soultaker

P.S. Included testmap.
Attached Files
File type: w3xMake Image pop up.w3x (159.1 KB)
05-23-2006, 07:02 PM#2
The)TideHunter(
Well, really by "picture" you need to refer to a variable type so we know what we are looking for.
To pop a fadefilter up for only 1 player, you will have to use the function GetLocalPlayer()
Please in future send the trigger instead of the intire map, worldeditor takes time to open and im too lazy to wait for things like that to load.

EDIT: Hmm, nevermind il make the code, here it is: (btw its in jass because it uses GetLocaPlayer())
The code is finished, keep the trigger with the same name and keep the "Who" variable or
this wont work.
Im not sure if this works because im not sure what instances GetLocalPlayer works for.
This should work though:

Collapse JASS:
function Trig_Send_Func004C takes nothing returns boolean
    if ( ( GetPlayerName(GetTriggerPlayer()) == "Soultaker" ) ) then
        return true
    endif
    if ( ( GetPlayerName(GetTriggerPlayer()) == "Soultaker-DK" ) ) then
        return true
    endif
    if ( ( GetPlayerName(GetTriggerPlayer()) == "SOUL" ) ) then
        return true
    endif
    if ( ( GetPlayerName(GetTriggerPlayer()) == ">> SOUL <<" ) ) then
        return true
    endif
    return false
endfunction

function Trig_Send_Conditions takes nothing returns boolean
    if ( not Trig_Send_Func004C() ) then
        return false
    endif
    return true
endfunction

function Trig_Send_Actions takes nothing returns nothing
    set udg_Who = S2I(SubStringBJ(GetEventPlayerChatString(), 7, 8))
    call DisplayTimedTextToForce( GetForceOfPlayer(GetTriggerPlayer()), 3.00, ( "Picture sended succesfully to player " + I2S(udg_Who) ) )
    if(GetLocalPlayer() == Player(udg_Who)) then
        call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 10.00, "fade1.blp", 100.00, 100.00, 100.00, 0 )
    endif
endfunction

//===========================================================================
function InitTrig_Send takes nothing returns nothing
    set gg_trg_Send = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(0), "-send ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(1), "-send ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(2), "-send ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(3), "-send ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(4), "-send ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(5), "-send ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(6), "-send ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(7), "-send ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(8), "-send ", false )
    call TriggerRegisterPlayerChatEvent( gg_trg_Send, Player(9), "-send ", false )
    call TriggerAddCondition( gg_trg_Send, Condition( function Trig_Send_Conditions ) )
    call TriggerAddAction( gg_trg_Send, function Trig_Send_Actions )
endfunction


Just type that code into the trigger, and nothing else
05-23-2006, 08:37 PM#3
Soultaker
Thanks..

Well the reason for not just posting the script, where for you to see if there might be any import errors or other stuff like that. It's a 64 x 64 map with 1 trigger, how long can it take? :P

Now I have the Local Player thing solved, but the fade filter won't work.. It has nothing to do with the triggers, because when I debugged it, I found out.

So, has anyone here used that tutorial and could help me out here? I might just other some picture encoders.

- Soultaker
05-24-2006, 03:03 PM#4
The)TideHunter(
This is really odd, i thought GetLocalPlayer worked for everything, iv just seen the example in a multiboard, that shows for 1 player, i dont see why this shouldent work though