채팅0

    형님들 몹 맵밖넘어가고 너무가까이와서 몸박자주하는거 수정하고싶은데.. 도움좀주세요!

    조회수 643

    zz_y7.jump_dupe = function(mob)

    local ai = mob.MobAIComponent

    local kb = mob.MobKnockbackComponent

    local rb = mob.MobRigidbodyComponent

    if (not isvalid(rb)) then

    if (isvalid(ai)) then

    -- ai:EnableNextControlTimer(0.1)

    end

    return

    end

    if (not mob.Visible) then

    -- ai:EnableNextControlTimer(0.1)

    return

    end

    local fh = rb.LastFoothold

    if (fh == 0) then

    --log("last foothold is 0")

    -- ai:EnableNextControlTimer(0.1)

    return

    end

    local now = _UtilLogic.ServerElapsedSeconds
    -- if (now < ai.NextActionTime) then
    -- 	-- ai:EnableNextControlTimer(math.max(ai.NextActionTime - now, 0) + 0.1)
    -- 	return
    -- end
    
    local target = _UserService.LocalPlayer
    local nextAction = 0
    local newInputX = nil
    local mobX = mob.TransformComponent.WorldPosition.x
    if (isvalid(target) and ai.LocalUnchaseTick < 7) then
    	if (ai.AttackWasLast) then
    		nextAction = _GlobalRand32:RandomIntegerRange(100, 110) / 1000
    		ai.AttackWasLast = false
    	else
    		nextAction = _GlobalRand32:RandomIntegerRange(100, 110) / 1000
    	end
    	local targetX = target.TransformComponent.WorldPosition.x
    	if math.abs(targetX - mobX) > 6 then
    		if targetX > mobX then
    			-- newInputX = 3
    			newInputX = 2
    		else
    			-- newInputX = -3
    			newInputX = -2
    		end
    	else
    		newInputX = math.max(targetX - mobX + 1.2, -2)
    	end
    else
    	nextAction = (_GlobalRand32:RandomIntegerRange(200, 210) / 1000)
    	newInputX = _UserService.LocalPlayer.TransformComponent.WorldPosition.x - mobX + 1.2
    end
    
    local platforms = mob.CurrentMap.PlatformInfoComponent
    local timelines = {}
    local timelineIndex = 0
    --log("platform left x (fh=%d)", platform.left.x, platform.left.foothold.Id)
    --log("platform right x (fh=%d)", platform.right.x, platform.right.foothold.Id)
    local lastTimeline = 0
    -- local playerFh = _UserService.LocalPlayer.WsUserController.LastFoothold
    -- if (playerFh == 0 or platforms.ZMass[playerFh] ~= ai.LocalStartChaseZMass) then
    -- 	ai.LocalUnchaseTick += 1
    -- 	ai:IncUnTick()
    -- end
    
    local function makeCommand(cmd, value, timeline, nextActionTime)
    	timelines[timelineIndex + 1] = {cmd, value, timeline - lastTimeline, nextActionTime}
    	timelineIndex += 1
    	lastTimeline = timeline
    end
    
    
    local targetX = _UserService.LocalPlayer.TransformComponent.WorldPosition.x
    local targetY = _UserService.LocalPlayer.TransformComponent.WorldPosition.y
    local mobY = mob.TransformComponent.WorldPosition.y
    local gapX = math.abs(mobX - targetX)
    local gapY = math.abs(mobY - targetY)
    if gapX > 3 then
    	makeCommand(_MobActionPartType.Move, newInputX, 0, nextAction)
    	makeCommand(_MobActionPartType.Jump, 1, 0)
    elseif gapY > 1.5 then
    	makeCommand(_MobActionPartType.Move, newInputX, 0, nextAction)
    	makeCommand(_MobActionPartType.Jump, -1, 0)
    elseif gapX < 1.3 and targetX < mobX then
    	makeCommand(_MobActionPartType.Move, 0, 0, nextAction)
    else
    	makeCommand(_MobActionPartType.Move, newInputX, 0, nextAction)
    end
    
    
    kb:SetShoeAttr(0)
    
    if (timelineIndex > 0) then
    	mob.CurrentMap.LifeControllerComponent:RequestControl(mob, timelines, timelineIndex, false)
    end

    end


    여기안에 뭔갈 바꿔야 하는거같은데 맞죠? ㅜㅠ

    1. 전사도 x좌표 수정가능해서 좀 덜붙게할수있으면 덜맞고 사냥되나요? 아니면 그냥 맞으면서 어쩔 수 없이 해야하나요.. 적자가 넘 심해요..

    2. 여기서 어떤 좌표숫자를 건드려야할까요..?

    할줄아는거 없고 맨날 공유된거 쓰는 줍줍이인데,, 리셀은 절대 안하고 혼자 사용하고있습니다..!!


    혹시라도 지나가시다가 도움주실 수 있으신분은 도움주시면 감사하겠습니다!


    cp충전도 해놓아서 1:1채팅도 걸 수 있습니다.!

    댓글7

    회원프로필

    if gapX > 3 then
            makeCommand(_MobActionPartType.Move, newInputX, 0, nextAction)
            makeCommand(_MobActionPartType.Jump, 1, 0)
        elseif gapY > 1.5 then
            makeCommand(_MobActionPartType.Move, newInputX, 0, nextAction)
            makeCommand(_MobActionPartType.Jump, -1, 0)
        elseif gapX < 1.3 and targetX < mobX then
            makeCommand(_MobActionPartType.Move, 0, 0, nextAction)
        else
            makeCommand(_MobActionPartType.Move, newInputX, 0, nextAction)
        end

    이거수정인가요?!

    2024.02.03 09:11
    회원프로필

        elseif gapX < 1.8 and gapX > 1.4 and targetX < mobX then

    2024.02.03 09:46
    회원프로필

    난 법산데
    newInputX = math.max(targetX - mobX + 1.8, -2)
    newInputX = _UserService.LocalPlayer.TransformComponent.WorldPosition.x - mobX + 1.8
    elseif gapX &lt; 1.8 and gapX &gt; 1.4 and targetX &lt; mobX then
    이렇게 3개 바꿈

    2024.02.03 09:27
    회원프로필

    감사해요 형님 이따 저도 해봐야겠아요!

    수정안하는거보단 낫죠?

    2024.02.03 09:33
    회원프로필

    안하는거보단 확실히 나음

    2024.02.03 09:44
    회원프로필

    < > 이거왜 인식못하냐

    2024.02.03 09:44
    회원프로필

    elseif gapX &lt; 1.8 and gapX &gt; 1.4 and targetX &lt; mobX then
    이건 내캐릭 옆에 몹이 일정거리 앞에서 딱 멈추게 할라고 수정햇는데 그래도 와리가리 치긴하더라 ㅠㅠ

    2024.02.03 09:30

      게시글 리스트
      제목작성자작성일조회
      2745002-03599
      2744902-03273
      2744802-03320
      2744702-03644
      2744602-03562
      2744502-03412
      2744402-03255
      2744302-03405
      2744202-03225
      2744102-03257
      2744002-03464
      2743902-03362
      2743802-03568
      2743702-03498
      2743602-03352
      2743502-03235
      2743402-03787
      2743302-03569
      2743202-03236
      2743102-03242
      안내 배너 이미지