- Joined
- Jul 10, 2009
- Messages
- 534
Hi folks,
I'm trying to access war3map.lua by code, i.e. loading particular lines or the whole thing into a string var during runtime.
My main goal is to achieve a better error handling. The main error handling funcs "pcall" and "xpcall" return error messages like "war3map.lua:7325: attempt to call a nil variable", but they don't give a hint on which line of code in which function sub-call has caused that error.
I know, I might extract war3map.lua with an MPQ-editor and manually open it, but I would really prefer to have the causing line printed, because it makes debugging so much quicker.
Is there any way to load the file content into a string?
My dream would be to have a function allowing me to do
.
Some threads on hive mention ways of loading external data (although war3map.lua is not really external) by using the
Example Thread: Am I doing this codeless loading wrong?
Any advice is welcome!
Thanks in advance and best regards
Eikonium
I'm trying to access war3map.lua by code, i.e. loading particular lines or the whole thing into a string var during runtime.
My main goal is to achieve a better error handling. The main error handling funcs "pcall" and "xpcall" return error messages like "war3map.lua:7325: attempt to call a nil variable", but they don't give a hint on which line of code in which function sub-call has caused that error.
I know, I might extract war3map.lua with an MPQ-editor and manually open it, but I would really prefer to have the causing line printed, because it makes debugging so much quicker.
Is there any way to load the file content into a string?
My dream would be to have a function allowing me to do
local s = GetWar3mapLua()
Some threads on hive mention ways of loading external data (although war3map.lua is not really external) by using the
Preloader()
and Preload()
natives and exploiting BlzGetAbilityTooltip()
, but I neither understand how that method works nor how to achieve my goal with it.Example Thread: Am I doing this codeless loading wrong?
Any advice is welcome!
Thanks in advance and best regards
Eikonium