this.DeplayUnit won't exist. To access the definitions in the template, you need this.template.DeployUnit. The same for deploycount, although it's best to convert it it a number first. You do that by adding a '+' sign. So +this.template.DeployCount. Btw, AutoDeployUnit, or AutoSpawn would probably be a better name for it. And you also need to replace the {civ} string with the right name (see a bit further in the productionqueue). UI is a mess, sorry for that. Take a look to the gui/session directory. In session.xml, the panels are defined. If you search for "Gate", you should see how the panel to convert a piece of wall to a gate is defined. The panels themselves are filled in unit_commands.js. But you'll probably run into the same problems as mentioned in http://trac.wildfire...com/ticket/2084 (we should really look into getting that part of the UI fixed). To learn more about scripting, take a look at https://developer.mozilla.org. The tutorial maybe isn't the best, but it's a great reference work. And very accurate as we work with spidermonkey. Adding the interfaces makes your component callable by other parts. So components can interact with each other. But this is something specific to thist way of coding, so isn't documented outside 0AD. To call functions of a different component, you should use the interface name. var cmp = Engine.QueryInterface(entityID, IID_InterfaceName) gives you access to the component of a specific entity, so you can use all functions and attributes defined in the component for that entity. For changing the SOD and FOW, you should look to the rangeManager (in source/simulation2). I don't know what the method is, but there should be something to 'visit' a certain tile. If you have more questions, please visit #0ad-dev on Quakenet to get better explanation.