• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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