-
Notifications
You must be signed in to change notification settings - Fork 10
lua how to debug
mtanksl edited this page Sep 17, 2023
·
3 revisions
- Download ZeroBrane Studio IDE.
- Launch the IDE.
- Click
Menu > Edit > Preferences > Settings: User
. - Add a line with
editor.autoactivate = true
. - Relaunch the IDE.
- Click
Menu > Project > Start Debugger Server
. - Click
Menu > Project > Project Directory > Start Debugger Server > Choose...
and select\mtanksl.OpenTibia.GameData\data\
. - Open
\plugins\npcs\lib.lua
in the project window, for example. - Insert the function
debugger.start()
inside the functionnpchandler:onsay(npc, player, message)
, for example. - Add breakpoints.
- Run the server.
- Talk to some NPC.
- The breakpoint will be hit, press F10 to step into, Shift + F10 to step over, Ctrl + F10 to step out and F5 to continue debugging.
- Now go have some fun!