API:Frequently Asked Questions
From TheWarWiki
WAR API Help
How do I extract MYP files?
There is an extractor called EasyMYP that can be used to extract MYP files. You will need to download both EasyMYP (as of the release on 10-2-08, you also need to download the Hash for filenames).
How do I open the debug window?
/debug
or
/script WindowSetShowing("DebugWindow", true)
This is extremely useful. It will show you lua error messages, frame information, all sorts of good stuff.
How do I print something to the chat window?
/script EA_ChatWindow.Print(L"text goes here")
Why do I have to wrap my strings in L""?
Because WAR's system has two types of strings: string and wstring.
string is a bytestring, 1 byte per character, character encoding is ASCII / ANSI. These strings
are use for window names. e.g WindowSetShowing("MyWindowName", true).
wstring is a UCS-2 string, 2 bytes per character. Nearly all WAR functions take wstrings instead of strings, and there is no automatic coersion to/from ASCII / ANSI.
What's the proper way to convert strings to/from wstrings?
StringToWString and WStringToString.
Actually, towstring can be substituted for StringToWString, but tostring can't be substituted for WStringToString, since it will break on non-ASCII characters.
How do I Reload the User Interface?
/reloadui
This is useful if you make changes to your files and want to test without having to close Warhammer and starting it back up.
Why wont my addons window change size when i set a new size value?
War stores settings about your addon in the user/interface/AllCharacters/<addonName>/ModSettings.xml file. This includes the size, position, scaling of your mode, and it appears that you have to exit the game, delete this file and restart, or change the version number in your .mod file for changes to your main window to take effect.
