10

» WarCraft 3 / WASD утыкание юнита

call SetUnitPositionSmooth(myUnit, newX, newY)
куда вписывать?
10

» WarCraft 3 / WASD утыкание юнита

function SetUnitPositionSmooth takes unit source, real x, real y returns nothing
    local real last_x = GetUnitX(source)
    local real last_y = GetUnitY(source)
    local boolean bx
    local boolean by

    call SetUnitPosition(source, x, y)

    if (RAbsBJ(GetUnitX(source) - x) > 0.5) or (RAbsBJ(GetUnitY(source) - y) > 0.5) then
        
        call SetUnitPosition(source, x, last_y)
        set bx = RAbsBJ(GetUnitX(source) - x) <= 0.5
        call SetUnitPosition(source, last_x, y)
        set by = RAbsBJ(GetUnitY(source) - y) <= 0.5
        
        if bx then
            call SetUnitPosition(source, x, last_y)
        elseif by then
            call SetUnitPosition(source, last_x, y)
        else
            call SetUnitPosition(source, last_x, last_y)
        endif

    endif
endfunction
и как правильно использовать?

"source" я как понял это юнит?
10

» WarCraft 3 / Простенький фрейм локально.

Думаю да

Вообще странно локально у каждого игрока отдельно можно стандартные фреймы двигать а вот свои не понятно как отображать.
10

» WarCraft 3 / Простенький фрейм локально.

МрачныйВорон, Создание TOC я туда не вставлял как я указал выше работает у всех игроков.
 set Key = 0.30
    set Key2 = 0.40
    
    
    call BlzLoadTOCFile("war3mapImported\\tocs2.toc")
    
    if GetLocalPlayer() == p then
    
    set KeyboxD = BlzCreateSimpleFrame("KeyboxS", gameUIB, 0)
    call BlzFrameSetAbsPoint(KeyboxD, FRAMEPOINT_CENTER, Key2, Key)
    
    endif
Делаю вот так и все....
10

» WarCraft 3 / Простенький фрейм локально.

Вот так все работает.
library TotorOn
globals
 private framehandle KeyboxD
 private real Key 
 private real Key2 
endglobals
private function Trig_TutorialkeyOn_Actions takes nothing returns nothing
    local player p = GetOwningPlayer(GetTriggerUnit())
    
   local framehandle gameUIB = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
    
    call DisplayTextToForce( GetPlayersAll(), "112211" )
   
    
    
     
     
     
    set Key = 0.30
    set Key2 = 0.40
    
    
    call BlzLoadTOCFile("war3mapImported\\tocs2.toc")
    set KeyboxD = BlzCreateSimpleFrame("KeyboxS", gameUIB, 0)
    
    call BlzFrameSetAbsPoint(KeyboxD, FRAMEPOINT_CENTER, Key2, Key)
    


    set p = null
    set gameUIB = null
    



endfunction

//===========================================================================
function InitTrig_TutorialkeyOn takes nothing returns nothing
    set gg_trg_TutorialkeyOn = CreateTrigger(  )
    
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TutorialkeyOn,Player(0),OSKEY_P,0,true)
    
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TutorialkeyOn,Player(1),OSKEY_P,0,true)
    
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TutorialkeyOn,Player(2),OSKEY_P,0,true)
    
    call BlzTriggerRegisterPlayerKeyEvent(gg_trg_TutorialkeyOn,Player(3),OSKEY_P,0,true)
    call TriggerAddAction( gg_trg_TutorialkeyOn, function Trig_TutorialkeyOn_Actions )
endfunction

endlibrary
10

» WarCraft 3 / Простенький фрейм локально.

МрачныйВорон, Когда добавляю "if GetLocalPlayer() == p then" вставлю туда фреймы они перестают показываться.
10

» WarCraft 3 / Аутизм и ставки на спорт!

Тоесть модель турели опубликовать нельзя а эту хрень можно.... странно админы работают
10

» WarCraft 3 / Турель из Team Fortress Classic

В чем проблема опубликовать? Что мне написать? Ттх этой турели???
10

» Мир безумного / Российский монитор Бештау

Это как с москвичом купили в китае JAC собрали в рашке получился москвич.
10

» WarCraft 3 / Утечка

NatriY, то что он работает вообще странно, но ошибка нашлась к счастью.
10

» WarCraft 3 / Local unit

function Trig_ShootTest_Actions takes nothing returns nothing


local unit marine = gg_unit_H000_0003
local unit Target = gg_unit_n000_0005
local real xMarine = GetUnitX(marine)
local real yMarine = GetUnitY(marine)
local real xTarget = GetUnitX(Target)
local real yTarget = GetUnitY(Target)
local real angle = bj_RADTODEG * Atan2(yTarget - yMarine, xTarget - xMarine) + GetRandomReal(-12.00, 12.00)
local unit Dummy = CreateUnit(GetOwningPlayer(marine), 'n001', xMarine, yMarine, angle)

local real maxDis = 1200
local real Damege = 50
local real Aoe = 90
local real Speed = 2000

local string BloodEfect = "Objects/Spawnmodels/Human/HumanBlood/HumanBloodKnight.mdl"

local timer TimerAct = CreateTimer()
local integer id = GetHandleId(TimerAct)
 
    if xMarine == xTarget and yMarine == yMarine then
        set angle = GetUnitFacing(marine)
    endif

call SetUnitX(Dummy, xMarine + 106 * Cos(angle * bj_DEGTORAD))
call SetUnitY(Dummy, yMarine + 106 * Sin(angle * bj_DEGTORAD))

call SaveUnitHandle(Hash, id, StringHash("marine"), marine)
call SaveUnitHandle(Hash, id, StringHash("Target"), Target)


call SaveReal(Hash, id, StringHash("Damege"), Damege)
call SaveReal(Hash, id, StringHash("maxDis"), maxDis)
call SaveReal(Hash, id, StringHash("Aoe"), Aoe)
call SaveReal(Hash, id, StringHash("angle"), angle)
call SaveReal(Hash, id, StringHash("Speed"), Speed * 0.03)
call SaveStr(Hash, id, StringHash("BloodEfect"), BloodEfect)
call SaveReal(Hash, id, StringHash("process"), 0)
call SaveGroupHandle(Hash, id, StringHash("group"), CreateGroup())




call SaveUnitHandle(Hash, id, StringHash("Dummy"), Dummy)
call DisplayTextToForce( GetPlayersAll(), "Shoot" )

call TimerStart(TimerAct, 0.03, true, function Trig_ShootTest_Actions2)
    
    
    call SetUnitAnimation( gg_unit_H000_0003, "attack" )

    call StopSoundBJ( gg_snd_GyrocopterImpactHit1, false )
    call PlaySoundBJ( gg_snd_GyrocopterImpactHit1 )
set marine = null
set Target = null
set Dummy = null
set TimerAct = null
    
endfunction
10

» WarCraft 3 / Остановка локального таймера

Принятый ответ
ImNoobTarenas, понятно я кое что напутал , теперь как остановить стрельбу с помощью таймера остановка вроде срабатывает но не совсем
function Trig_LMB1_Actions takes nothing returns nothing
local timer TimerAct2 = GetExpiredTimer()
local integer BB = GetHandleId(TimerAct2)
local real processs = LoadReal(Hash, BB, StringHash("processs"))


call DisplayTextToForce( GetPlayersAll(), "OFF" )
call PauseTimer(TimerAct2)
call DestroyTimer(TimerAct2)
call SaveReal(Hash, BB, StringHash("processs"), processs)
set TimerAct2 = null

 endfunction

function Trig_ShootTest_Actions3 takes nothing returns nothing
local timer TimerAct = GetExpiredTimer()
local integer id = GetHandleId(TimerAct)
local unit marine = LoadUnitHandle(Hash, id, StringHash("marine"))
local unit Target = LoadUnitHandle(Hash, id, StringHash("Target"))

local unit Dummy = LoadUnitHandle(Hash, id, StringHash("Dummy")) 
local real process = LoadReal(Hash, id, StringHash("process")) + LoadReal(Hash, id, StringHash("Speed"))
local group gACT
local unit u = null

 if process > LoadReal(Hash, id, StringHash("maxDis")) then
 call DestroyGroup(LoadGroupHandle(Hash, id, StringHash("group")))
 call KillUnit(Dummy)
 call FlushChildHashtable(Hash, id)
 call PauseTimer(TimerAct)
 call DestroyTimer(TimerAct)
 
else

 call SaveReal(Hash, id, StringHash("process"), process)
 call SetUnitX(Dummy, GetUnitX(Dummy) + LoadReal(Hash, id, StringHash("Speed")) * Cos(LoadReal(Hash, id, StringHash("angle")) * bj_DEGTORAD))
 call SetUnitY(Dummy, GetUnitY(Dummy) + LoadReal(Hash, id, StringHash("Speed")) * Sin(LoadReal(Hash, id, StringHash("angle")) * bj_DEGTORAD))
 
 set gACT =CreateGroup()
 call GroupEnumUnitsInRange(gACT, GetUnitX(Dummy),GetUnitY(Dummy), LoadReal(Hash, id, StringHash("Aoe")), null )
 
 loop
 
  set u = FirstOfGroup(gACT)
  exitwhen u == null
  
  if GetWidgetLife(u) > 0.405 and not IsUnitInGroup(u, LoadGroupHandle(Hash, id, StringHash("group"))) then
  
      if IsUnitEnemy(u, GetOwningPlayer(marine)) then
         call UnitDamageTarget(marine, u, LoadReal(Hash, id, StringHash("Damege")), false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
         call DestroyEffect(AddSpecialEffectTarget(LoadStr(Hash, id, StringHash("BloodEfect")), u, "chest"))
         call RemoveUnit(Dummy)
      else
      
      endif
  
  endif
  
  call GroupRemoveUnit(gACT, u)
  
  endloop
  
   call DestroyGroup(gACT)
   
  endif 
set Target = null
set marine = null
set Dummy = null
set TimerAct = null
set gACT = null

endfunction


function Trig_ShootTest2_Actions takes nothing returns nothing
local unit marine = gg_unit_H000_0003
local unit Target = gg_unit_n000_0005
local real xMarine = GetUnitX(marine)
local real yMarine = GetUnitY(marine)
local real xTarget = GetUnitX(Target)
local real yTarget = GetUnitY(Target)
local real angle = bj_RADTODEG * Atan2(yTarget - yMarine, xTarget - xMarine) + GetRandomReal(-6.00, 6.00)
local unit Dummy = CreateUnit(GetOwningPlayer(marine), 'n001', xMarine, yMarine, angle)

local real maxDis = 1200
local real Damege = 50
local real Aoe = 90
local real Speed = 2000

local string BloodEfect = "Objects/Spawnmodels/Human/HumanBlood/HumanBloodKnight.mdl"
local timer TimerAct = CreateTimer()
local integer id = GetHandleId(TimerAct)
local timer TimerAct2 = CreateTimer()
local integer BB = GetHandleId(TimerAct2)
call SaveReal(Hash, BB, StringHash("processs"), 0)
if xMarine == xTarget and yMarine == yMarine then
        set angle = GetUnitFacing(marine)
    endif

call SetUnitX(Dummy, xMarine + 106 * Cos(angle * bj_DEGTORAD))
call SetUnitY(Dummy, yMarine + 106 * Sin(angle * bj_DEGTORAD))

call SaveUnitHandle(Hash, id, StringHash("marine"), marine)
call SaveUnitHandle(Hash, id, StringHash("Target"), Target)
call SaveUnitHandle(Hash, id, StringHash("Dummy"), Dummy)

call SaveReal(Hash, id, StringHash("Damege"), Damege)
call SaveReal(Hash, id, StringHash("maxDis"), maxDis)
call SaveReal(Hash, id, StringHash("Aoe"), Aoe)
call SaveReal(Hash, id, StringHash("angle"), angle)
call SaveReal(Hash, id, StringHash("Speed"), Speed * 0.03)
call SaveStr(Hash, id, StringHash("BloodEfect"), BloodEfect)
call SaveReal(Hash, id, StringHash("process"), 0)
call SaveGroupHandle(Hash, id, StringHash("group"), CreateGroup())


call TimerStart(TimerAct, 0.03, true, function Trig_ShootTest_Actions3)

    call StopSoundBJ( gg_snd_GyrocopterImpactHit1, false )
    call PlaySoundBJ( gg_snd_GyrocopterImpactHit1 )
    
    call SetUnitAnimation( gg_unit_H000_0003, "attack" )

set marine = null
set Target = null
set Dummy = null
set TimerAct = null
set TimerAct2 = null


endfunction

function Trig_LMB21_Actions takes nothing returns nothing
local timer TimerAct2 = CreateTimer()
local integer BB = GetHandleId(TimerAct2)
call SaveReal(Hash, BB, StringHash("processs"), 0)
call DisplayTextToForce( GetPlayersAll(), "ON" )
call TimerStart(TimerAct2, 0.10, true, function Trig_ShootTest2_Actions)
set TimerAct2 = null
endfunction



function Trig_ShootTest2_Conditions takes nothing returns boolean  
     if ( not ( BlzGetTriggerPlayerMouseButton() == MOUSE_BUTTON_TYPE_RIGHT ) ) then
        return false
    endif
    return true
endfunction




//===========================================================================


Таймер не останавливается
function Trig_LMB22_Actions takes nothing returns nothing
local timer TimerAct2 = GetExpiredTimer()
local integer BB = GetHandleId(TimerAct2)



call DisplayTextToForce( GetPlayersAll(), "Off" )
call PauseTimer(TimerAct2)
call DestroyTimer(TimerAct2)

set TimerAct2 = null

 endfunction
 
 
 
 function Trig_LMB21_Actions takes nothing returns nothing
local timer TimerAct2 = CreateTimer()
local integer BB = GetHandleId(TimerAct2)
call SaveReal(Hash, BB, StringHash("processs"), 0)
call DisplayTextToForce( GetPlayersAll(), "On" )
call TimerStart(TimerAct2, 0.10, false, function Trig_LMB21_Actions)
set TimerAct2 = null
endfunction




 function Trig_LMB22_Conditions takes nothing returns boolean  
     if ( not ( BlzGetTriggerPlayerMouseButton() == MOUSE_BUTTON_TYPE_RIGHT ) ) then
        return false
    endif
    return true
endfunction
function Trig_LMB21_Conditions takes nothing returns boolean  
     if ( not ( BlzGetTriggerPlayerMouseButton() == MOUSE_BUTTON_TYPE_RIGHT ) ) then
        return false
    endif
    return true
endfunction

 
 
//===========================================================================
function InitTrig_LMB2 takes nothing returns nothing
    set gg_trg_LMB2 = CreateTrigger(  )
    
    call TriggerAddCondition( gg_trg_LMB2, Condition( function Trig_LMB22_Conditions ) )
    call TriggerAddCondition( gg_trg_LMB2, Condition( function Trig_LMB21_Conditions ) )

endfunction