• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Easy camera change

Status
Not open for further replies.
Level 5
Joined
Jun 21, 2011
Messages
119
Hello.
I'm new in vJASS, JASS etc...
I found a nice camera system to my map and now i need to make this trigger for all players, not red only. Someone can help me or change this code for all players not red only?

JASS:
function Trig_CameraForced_Actions takes nothing returns nothing
    local camerasetup c = GetCurrentCameraSetup()
    local player p = GetTriggerPlayer()
    local real Dist = CameraSetupGetField(c, CAMERA_FIELD_TARGET_DISTANCE ) + 200
    
    if (GetLocalPlayer() == p) then
       
        call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, Dist, 0.10)
        call SetCameraField(CAMERA_FIELD_FARZ, 5000., 0.10)
    endif
    
    set p = null
    set c = null
    set Dist = 0.00
endfunction

function InitTrig_CameraForced takes nothing returns nothing
    set gg_trg_CameraForced = CreateTrigger(  )
    call TriggerRegisterPlayerEvent(gg_trg_CameraForced, Player(0), EVENT_PLAYER_END_CINEMATIC)
    call TriggerAddAction( gg_trg_CameraForced, function Trig_CameraForced_Actions )
    set gg_trg_CameraForced = null
endfunction
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
JASS:
function InitTrig_CameraForced takes nothing returns nothing
    local integer i = 0
    set gg_trg_CameraForced = CreateTrigger(  )
    loop
        call TriggerRegisterPlayerEvent(gg_trg_CameraForced, Player(i), EVENT_PLAYER_END_CINEMATIC)
    exitwhen i == 15
    set i = i+1
    endloop
    call TriggerAddAction( gg_trg_CameraForced, function Trig_CameraForced_Actions )
    set gg_trg_CameraForced = null
endfunction
 
Status
Not open for further replies.
Top