Custom Viewer: Area Editor

From WiCWiki

Jump to: navigation, search


by the Insane Bastards & A New Hope


Version: 0.4 (2007-12-20)
Download: [1]
Requirements: Custom Viewer 0.6

Visit us on Sourceforge: [2]
SVN: (you have to join us to upload to the svn)

Wanna help developing?

Visit the Sourceforge-Site and join us!

This is an extension for the Custom Viewer.


With the help of the AreaEditor you can place areas in your world and visualize those. Afterwards you can manipulate those and use the areas for other actions, f. ex. creating units.


1. Download "" and put it into the "cust_viewer"-folder 2. Open "" and change the following

2.1 add the following imports somewhere before initViewer is executed:

# from
from cust_viewer.areaeditor import printAreas
from cust_viewer.areaeditor import initializeAreaEditor

2.2 in "initViewer()" add the following at the end:

# AreaEditor

2.3.1 If the following methods don't exist, then create those:

def key_act_NUM_PLUS_hold():
    selectedEntry = myViewer.getSelectedEntry()
def key_act_NUM_MINUS_hold():
    selectedEntry = myViewer.getSelectedEntry()

And in the "update()"-method add those four lines:

# check if user holds num-plus-key
checkHoldingKey(KEY_NUM_PLUS, Action(key_act_NUM_PLUS_hold), 0.4, 0.01)

# check if user holds num-minus-key
checkHoldingKey(KEY_NUM_MINUS, Action(key_act_NUM_MINUS_hold), 0.4, 0.01)

2.3.2 If the methods already existed, then adjust those, so that they execute the "plus" and "minus"-actions

2.4 in "update()" add the following in the printing-part:

# print Areas in World


Navigate as normal. You can manipulate the 3 coordinates of the position and the radius with your num-pads plus- and minus-keys.



addedAreas = Container in which the areas are saved (Dictionary<String,Area>), key is "Area" + number


Version 0.4 (2007-12-20)

  • restructed CustomViewer - needed for compatibility

Version 0.3 (2007-12-17)

  • added ability to load and save areas (thanks to A new Hope)
  • added ability to remove areas (thanks to A new Hope)

Version 0.2 (2007-12-16)

  • official release
Personal tools
User Created Content