Board logo

標題: LUA 问题 [打印本頁]

作者: Layang    時間: 2013-3-1 01:19     標題: LUA 问题

This is Battle Npc script portion
-----------------------------------------------------------
--設置NPC方向
        Char.SetData(_MeIndex, %對像_方向%, %下%);
------------------------------------------------------------
I do not understand This source
If XXXX.arg  設置NPC方向 = dir=?
Lua -> ???????????
I try find LNS It's failed.
Please tell me the direction of the LUA
作者: agent0800    時間: 2013-3-1 21:42

reference http://lab.welovesa.com/viewthread.php?tid=2384&highlight=
作者: Layang    時間: 2013-3-2 01:20

Then
---------------------------------------------------
     if i >= 4 then
                i = i - 4;
        else
                i = i + 4;        
        end
        Char.SetData(_MeIndex, %對像_方向%,i);
--------------------------------------------------
i = 4 -+ 4 ?
I understand but
I do not understand - i = i-4; , i=i+4;
作者: agent0800    時間: 2013-3-2 09:23

[attach]371[/attach]

↑ NPC direction table

if player direction is 5
-----------------------------------------------------
     if i >= 4 then    // 5 >= 4 .. 5 - 4 = 1  --  "i" is get from player direction

                i = i - 4;
        else
                i = i + 4;        
        end
        Char.SetData(_MeIndex, %對像_方向%,i);  // NPC will set the direction 1
-----------------------------------------------------
if you want to set the NPC direction , reference "NPC direction table"
作者: Layang    時間: 2013-3-2 11:25

GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOD




歡迎光臨 We Love SA 石器時代研討中心 (http://lab.welovesa.com/) Powered by Discuz! 6.0.0