View Single Post
  #20  
Unread 12-06-2006, 01:39 PM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

Ok some working pratices that may help others.

Working with UIBuilder
1) ALWAYS keep separate development, test and production directories. The Dev directory is for making code changes. The test directory is for in-game testing of unpublished code. The production directory holds your most recently published files.

2) Avoid opening the test directory in UIBuilder, and NEVER save if you do. Saving from UIBuilder will copy every file from the default directory to the opened directory, weather changes were made or not. UIBuilder also likes to correct malformed XML that, although technically improper, works fine and was done intentionally. For example, it likes to promote code from included files with multiple root nodes to the parent file.

3) Use UIBuilder to modify files in the dev directory. Save from UIBuilder then from Windows, manually copy any files you meant to change over to your test directory. Anything else changed by UIBuilder should be left in the dev directory.

4) Launch EQ2 with the test directory as your UI. If more tweaks are needed, repeate step 3.

5) Once all your testing is done and your tweaked file(s) work as intended, replace your dev directory with a copy of your test directory. This ensures the next time you go to tweak a different file, you're working with tested code and not some later version modified by UIBuilder.

6) When its ready to be published, make sure any old production directories have been archived. Copy any files required by the mod from your test directory to an empty production directory. Check it in-game to ensure you didn't miss a file. ZIP the varified production directory and upload it to this site.

Working with text editors
Some changes are more eisily done with a text editor, but most editors will corrupt the file encoding used by UIBuilder, converting it to some other encoding when the file is opened. Saving the file with the converted encoding then confuses UIBuilder into doing some rather nasty character conversions that get progressively worse each time the file is edited with UIBuilder. Notepad is known to reliably preserve the file encoding but is a poor editor. To work around these problems and still take advantage of a feature ritch text editor, follow these guidelines.

1) Open the dev file to be edited in Notepad. Select all, and copy.

2) Open your robust text editor and paste the code into a new doc. Make any desired edits. Although opening the xml directly into the robust editor isn't a problem, accidental saves could be. Its best not to open eq2 xmls in any text editor except Notepad.

3) Once your edits are done, select everything after the first "<Page " tag, including the very last bit of code. Copy and switch back to Notepad.

4) With the original file open in Notepad, select everything after the opening "<Page " and paste the code from your robust editor. DON'T paste over the code bits before the opening tag, that's the file encoding string and it contains special characters that most editors display as boxes but may not display at all. Starting your replacements after the opening "<Page " characters ensures you aren't replacing anything invisible.

Note: If you do accidentally hose the file encoding, you can duplicate any default eq2 xml file in Windows, rename it, and paste in new code as described above to restore a working version.

5) Save the file, then copy it from your dev directory to your test directory.

Note: If you're the only one working with the code and are only using a text editor to make changes, you can tweak directly to the test directory but be sure to copy the changes back to your dev directory befor working with another file.

UIBuilder dos and don'ts
UIBuilder does have a "Run" mode for testing scripts. Using this feature can save you tons of time logging in and out of game, but there are some hazards to be aware of.

1) ALWAYS save any changes BEFORE using the "Run" mode. Stopping run mode does not revert the windows to their state prior to hitting "Run", so any changes made to the windows by the executed script will still be there after run.

2) NEVER save after using "Run" mode. Doing so will often result in windows saved in a state altered by scripts that might prevent them from working as intended.

3) AVOID togelling atributes that might trigger a script event. Even when not in "Run" mode, toggeling visibility will execute the OnShow/OnHide script for that object. Likewise for Activated, Enabled, Set, etc. If you need to work on a hidden window that does have an OnShow script, use Notepad to set it to Visible="true" then reload your set. After making your changes and saving, be sure to use Notepad to restore the original visibility.

4) After using "Run" mode and/or fideling with event triggers, make sure Run has been stopped then reload your file set without saving.

5) If a window is obscured by other windows, its generally better to move it to the top of the stack order rather than hiding everything above it. This will only change the parent file (MinHud for example) which you can restore from the test directory after your changes are saved. There are buttons above the object tree for changing the stack order, one of which moves the selected object to the top, another moves to bottom.

Here are a few old reference links concerning now common eq2 scripting methods and working with UIBuilder...

Opening custom windows and slash commands
Duplicating Inventory which resulted in the many ammo and bag strip mods. Also contributed to many of the Start button mods.
Slash command lsit which resulted in the first Performance setter by Kosmos
Dependancies
Memory Management
UIBuilder alignment
Dummy objects for sizing
Traversing Branches enableds stuff like Examine names pipped to Market, Prices piped to Market, etc.
Conditionals
Dropdowns and Datasources
String concatination

I've always wanted to write a guide to EQ2 modding, but just don't have the time
Reply With Quote