Z
Zorbho
Guest
Hi, i am really new with all this, i been trying to do that any player can type -far -near -med and it change the zoom for my friend old map, i been reading all over this forum, and i cant find this, my friend gave me a unprotected map which has this option, i been watching the triggers pattern even if i dont know nothin about it,i tried to put thoses in his map , the 2 map im dealing with are verry similar structured, since they are the same game with a few difference. Here are the line i tried to past and what it did:
as in the version that has the zoomn, there is those:
function Trig_CameraView_Near_Actions takes nothing returns nothing
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,1650.,1.)
endfunction
function Trig_CameraView_Medium_Actions takes nothing returns nothing
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,2250.,1.)
endfunction
function Trig_CameraView_Far_Actions takes nothing returns nothing
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,3000.,1.)
endfunction
this was in the upper part of the trigger editor
the other part that i found interesting was under the function called main2 where there is a long list of line that begin by call, i found.
set udg_trigger502=CreateTrigger()
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(2),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(3),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(4),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(5),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(6),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(7),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(8),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(9),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(10),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(11),"-Near",true)
call TriggerAddAction(udg_trigger502,function Trig_CameraView_Near_Actions)
set udg_trigger503=CreateTrigger()
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(2),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(3),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(4),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(5),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(6),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(7),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(8),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(9),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(10),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(11),"-Medium",true)
call TriggerAddAction(udg_trigger503,function Trig_CameraView_Medium_Actions)
set udg_trigger504=CreateTrigger()
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(2),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(3),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(4),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(5),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(6),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(7),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(8),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(9),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(10),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(11),"-Far",true)
call TriggerAddAction(udg_trigger504,function Trig_CameraView_Far_Actions)
the only error i get while saving is on the second part and its :: expect a variable name. It do that for the 3 line that look like set udg_trigger502=CreateTrigger()
and on all the other line of the bottom part i get the error expected a name.
I begin to understand a little the structure even if i dont know nothin about prog. Maybe someone can see my mistake or guide me. (i renamed 502-503-504) since the number that was doing this in the version that has the zoom was already used on the map i want to add it. Thx to listen to me!
as in the version that has the zoomn, there is those:
function Trig_CameraView_Near_Actions takes nothing returns nothing
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,1650.,1.)
endfunction
function Trig_CameraView_Medium_Actions takes nothing returns nothing
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,2250.,1.)
endfunction
function Trig_CameraView_Far_Actions takes nothing returns nothing
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,3000.,1.)
endfunction
this was in the upper part of the trigger editor
the other part that i found interesting was under the function called main2 where there is a long list of line that begin by call, i found.
set udg_trigger502=CreateTrigger()
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(2),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(3),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(4),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(5),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(6),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(7),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(8),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(9),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(10),"-Near",true)
call TriggerRegisterPlayerChatEvent(udg_trigger502,Player(11),"-Near",true)
call TriggerAddAction(udg_trigger502,function Trig_CameraView_Near_Actions)
set udg_trigger503=CreateTrigger()
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(2),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(3),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(4),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(5),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(6),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(7),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(8),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(9),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(10),"-Medium",true)
call TriggerRegisterPlayerChatEvent(udg_trigger503,Player(11),"-Medium",true)
call TriggerAddAction(udg_trigger503,function Trig_CameraView_Medium_Actions)
set udg_trigger504=CreateTrigger()
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(2),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(3),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(4),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(5),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(6),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(7),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(8),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(9),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(10),"-Far",true)
call TriggerRegisterPlayerChatEvent(udg_trigger504,Player(11),"-Far",true)
call TriggerAddAction(udg_trigger504,function Trig_CameraView_Far_Actions)
the only error i get while saving is on the second part and its :: expect a variable name. It do that for the 3 line that look like set udg_trigger502=CreateTrigger()
and on all the other line of the bottom part i get the error expected a name.
I begin to understand a little the structure even if i dont know nothin about prog. Maybe someone can see my mistake or guide me. (i renamed 502-503-504) since the number that was doing this in the version that has the zoom was already used on the map i want to add it. Thx to listen to me!