Soldado
Barra de Salud : 
Mensajes : 64
Reputación : 0 Monedas de oro : 164 Monedas de Platino : 0 
Inventario :  
 | (#) Tema: Como importar un libreria o como se llame XD Mar Jul 01, 2014 2:31 pm | |
| Buenas tengo un problema estoy tratando de poner un sistema en mi mapa el cual necesita unos codigos en Jass en el codigo de guion en el cual ya tengo algunos codigos y no se como pasarlo si lo paso a si no mas me tira errores , asi que seguramentese pasan en un orden el codigo tiene globales y mas cosas se los dejo - Código:
-
//TESH.scrollpos=-1 http://TESH.alwaysfold=0 library TPC initializer Init
globals // How often the camera is adjusted. Every 0.15 seconds is plenty fast enough private constant real Period = 0.15
// General camera options private constant real CameraHeight = 300.0 private constant real CameraAngle = 345 private constant real CameraDistance = 600
// Arrow keys can be used to rotate and zoom private constant boolean AllowArrowKeys = true // Escape resets the camera to "general camera options" private constant boolean AllowEscape = true
// Wan't to be able to turn it on or off? private constant string Command = "-camera" private constant boolean AllowCommand = true
// Optionally stops the camera if the current camera unit dies private constant boolean RemoveOnDeath = true
// Rotation is either free... private constant boolean AllowFreeRotation = false // ... or limited to +/- this: private constant real CameraMaxRotate = 90
// You can change this... but should just leave them private constant real CameraMaxDistance = 1200 private constant real CameraMinDistance = 150
// DON'T touch anything here private group CameraUnits = CreateGroup() private group CameraUnits_start = CreateGroup() private real array Rotate private real array Distance private real array Angle private boolean array DoLeft private boolean array DoRight private boolean array DoDown private boolean array DoUp endglobals
private function CameraRemovePlayer_function takes nothing returns nothing if GetOwningPlayer(GetEnumUnit()) == bj_forceRandomCurrentPick then call GroupRemoveUnit(CameraUnits_start, GetEnumUnit()) call GroupRemoveUnit(CameraUnits, GetEnumUnit()) endif endfunction
function TPCRemovePlayer takes player p returns nothing set bj_forceRandomCurrentPick = p call ForGroup(CameraUnits, function CameraRemovePlayer_function) call ForGroup(CameraUnits_start, function CameraRemovePlayer_function) if GetLocalPlayer() == p then call ResetToGameCamera(1.5) endif endfunction
function TPCAdd takes unit u returns nothing local player p = GetOwningPlayer(u) local integer i = GetPlayerId(p) call TPCRemovePlayer(p) set Rotate[i] = 0 set Angle[i] = CameraAngle set Distance[i] = CameraDistance call GroupAddUnit(CameraUnits_start, u) call GroupAddUnit(CameraUnits, u) set p = null endfunction
function TPCRemove takes unit u returns nothing call GroupRemoveUnit(CameraUnits_start, u) call GroupRemoveUnit(CameraUnits, u) if GetLocalPlayer() == GetOwningPlayer(u) then call ResetToGameCamera(1.5) endif endfunction
function TPCRemoveAll takes nothing returns nothing call GroupClear(CameraUnits) call GroupClear(CameraUnits_start) endfunction
private function Death takes nothing returns nothing if IsUnitInGroup(GetTriggerUnit(), CameraUnits_start) or IsUnitInGroup(GetTriggerUnit(), CameraUnits) then call TPCRemove(GetTriggerUnit()) endif endfunction
private function Movement takes nothing returns nothing local unit u = GetEnumUnit() local location l = GetUnitLoc(u) if GetLocalPlayer() == GetOwningPlayer(u) then call PanCameraToTimed(GetUnitX(u), GetUnitY(u), Period) call SetCameraField(CAMERA_FIELD_ROTATION, GetUnitFacing(u) + Rotate[GetPlayerId(GetOwningPlayer(u))], Period) call SetCameraField(CAMERA_FIELD_ZOFFSET, GetCameraField(CAMERA_FIELD_ZOFFSET) + GetLocationZ(l) + CameraHeight - GetCameraEyePositionZ(), Period) call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, Angle[GetPlayerId(GetOwningPlayer(u))], Period) call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, Distance[GetPlayerId(GetOwningPlayer(u))], Period) endif call RemoveLocation(l) set u = null set l = null endfunction
private function Actions takes nothing returns nothing call ForGroup(CameraUnits, function Movement) endfunction
private function usesCamera takes nothing returns nothing if GetOwningPlayer(GetEnumUnit()) == GetTriggerPlayer() then set bj_isUnitGroupDeadResult = false endif endfunction
private function CameraOn takes nothing returns nothing local integer i = GetPlayerId(GetTriggerPlayer()) if GetOwningPlayer(GetEnumUnit()) == GetTriggerPlayer() then set Rotate[i] = 0 set Angle[i] = CameraAngle set Distance[i] = CameraDistance call GroupAddUnit(CameraUnits, GetEnumUnit()) endif endfunction
private function CameraOff takes nothing returns nothing if GetOwningPlayer(GetEnumUnit()) == GetTriggerPlayer() then call GroupRemoveUnit(CameraUnits, GetEnumUnit()) endif endfunction
private function ChatActions takes nothing returns nothing set bj_isUnitGroupDeadResult = true call ForGroup(CameraUnits, function usesCamera) if bj_isUnitGroupDeadResult then call ForGroup(CameraUnits_start, function CameraOn) else call ForGroup(CameraUnits, function CameraOff) if GetLocalPlayer() == GetTriggerPlayer() then call ResetToGameCamera(1.5) endif endif endfunction
private function KeyLeft takes nothing returns nothing set DoLeft[GetPlayerId(GetTriggerPlayer())] = not DoLeft[GetPlayerId(GetTriggerPlayer())] endfunction private function KeyRight takes nothing returns nothing set DoRight[GetPlayerId(GetTriggerPlayer())] = not DoRight[GetPlayerId(GetTriggerPlayer())] endfunction private function KeyDown takes nothing returns nothing set DoDown[GetPlayerId(GetTriggerPlayer())] = not DoDown[GetPlayerId(GetTriggerPlayer())] endfunction private function KeyUp takes nothing returns nothing set DoUp[GetPlayerId(GetTriggerPlayer())] = not DoUp[GetPlayerId(GetTriggerPlayer())] endfunction
private function DoKeys takes nothing returns nothing local integer i = 0 loop if DoLeft[i] then if AllowFreeRotation or Rotate[i] < CameraMaxRotate then set Rotate[i] = Rotate[i] + 8 if Rotate[i] > 360 then set Rotate[i] = Rotate[i] - 360 endif endif endif if DoRight[i] then if AllowFreeRotation or Rotate[i] > -CameraMaxRotate then set Rotate[i] = Rotate[i] - 8 if Rotate[i] < -360 then set Rotate[i] = Rotate[i] + 360 endif endif endif if DoDown[i] then if Distance[i] < CameraMaxDistance then set Distance[i] = Distance[i] + 25 set Angle[i] = Angle[i] + 0.35 endif endif if DoUp[i] then if Distance[i] > CameraMinDistance then set Distance[i] = Distance[i] - 25 set Angle[i] = Angle[i] - 0.35 endif endif set i = i + 1 exitwhen i >= 12 endloop endfunction
private function Escape takes nothing returns nothing local integer i = GetPlayerId(GetTriggerPlayer()) set Rotate[i] = 0 set Angle[i] = CameraAngle set Distance[i] = CameraDistance endfunction
private function Init takes nothing returns nothing local integer i local trigger t = CreateTrigger() local trigger t1 = CreateTrigger() local trigger t2 = CreateTrigger() local trigger t3 = CreateTrigger() local trigger t4 = CreateTrigger() local timer m local player p call TriggerRegisterTimerEventPeriodic(t, Period) call TriggerAddAction(t, function Actions) if AllowCommand then set t = CreateTrigger() call TriggerAddAction(t, function ChatActions) set i = 0 loop call TriggerRegisterPlayerChatEvent(t, Player(i), Command, true) set i = i + 1 exitwhen i >= 12 endloop endif if RemoveOnDeath then set t = CreateTrigger() call TriggerAddAction(t, function Death) set i = 0 loop call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_DEATH, null) set i = i + 1 exitwhen i >= 12 endloop endif call TriggerAddAction(t1, function KeyLeft) call TriggerAddAction(t2, function KeyRight) call TriggerAddAction(t3, function KeyDown) call TriggerAddAction(t4, function KeyUp) set i = 0 loop set Rotate[i] = 0 set Distance[i] = CameraDistance set Angle[i] = CameraAngle set DoLeft[i] = false set DoRight[i] = false set DoDown[i] = false set DoUp[i] = false set p = Player(i) if AllowArrowKeys then call TriggerRegisterPlayerEvent(t1, p, EVENT_PLAYER_ARROW_LEFT_DOWN) call TriggerRegisterPlayerEvent(t1, p, EVENT_PLAYER_ARROW_LEFT_UP)
call TriggerRegisterPlayerEvent(t2, p, EVENT_PLAYER_ARROW_RIGHT_DOWN) call TriggerRegisterPlayerEvent(t2, p, EVENT_PLAYER_ARROW_RIGHT_UP)
call TriggerRegisterPlayerEvent(t3, p, EVENT_PLAYER_ARROW_DOWN_DOWN) call TriggerRegisterPlayerEvent(t3, p, EVENT_PLAYER_ARROW_DOWN_UP)
call TriggerRegisterPlayerEvent(t4, p, EVENT_PLAYER_ARROW_UP_DOWN) call TriggerRegisterPlayerEvent(t4, p, EVENT_PLAYER_ARROW_UP_UP) endif set i = i + 1 exitwhen i >= 12 endloop set m = CreateTimer() call TimerStart(m, 0.05, true, function DoKeys) set m = null
if AllowEscape then set t = CreateTrigger() call TriggerAddAction(t, function Escape) set i = 0 loop call TriggerRegisterPlayerEvent(t, Player(i), EVENT_PLAYER_END_CINEMATIC) set i = i + 1 exitwhen i >= 12 endloop endif
set t = null set t1 = null set t2 = null set t3 = null set t4 = null set p = null endfunction
endlibrary
No se si hay etiqueta Jass. Saludos :S Progreso con la beta de mi mapa RPG: %10Fecha estimada del lansamiento de la beta: 4 De octubre del 2014. |
|


Barra de Salud : 
Mensajes : 978
Reputación : 113 Monedas de oro : 1247 Monedas de Platino : 0 
Inventario :  
 | (#) Tema: Re: Como importar un libreria o como se llame XD Mar Jul 01, 2014 5:22 pm | |
| Tienes que tener el NewGenPack, te vas a hiveworkshop y lo descargas para que te pueda funcionar la libreria |
|


Barra de Salud : 
Mensajes : 3548
Reputación : 680 Monedas de oro : 11090 Monedas de Platino : 0 
Inventario :  
 | (#) Tema: Re: Como importar un libreria o como se llame XD Mar Jul 01, 2014 8:29 pm | |
| Puedes descargar el NewGen Pack desde el foro también.
Y sí, existe código para jass |
|
Soldado
Barra de Salud : 
Mensajes : 64
Reputación : 0 Monedas de oro : 164 Monedas de Platino : 0 
Inventario :  
 | (#) Tema: Re: Como importar un libreria o como se llame XD Mar Jul 01, 2014 11:42 pm | |
| Si ya esta media hora luego de que postie me dijieron como y me lo descarge me olvide de avisar que estaba solucionado , Gracias igualmente! Progreso con la beta de mi mapa RPG: %10Fecha estimada del lansamiento de la beta: 4 De octubre del 2014. |
|
 | (#) Tema: Re: Como importar un libreria o como se llame XD  | |
| |
|