Fandom

Kongregate Wiki

Battalion: Arena/Scripting

< Battalion: Arena

678pages on
this wiki
Add New Page
Talk0 Share

Battalion: Arena's map editor has a scripting feature built in so a player can add custom scripts. Scripts control everything from the dialogue at the beginning and end of the game, to whether or not the map keeps track of morale, to new units being given at various points of the game, to when the game ends (other then all sides except one being defeated).


OverviewEdit

All script are made up of one or more event. Each event has one condition (when it happens) and one or more responses (what happens).

Following is a sample script. It has one event which has one condition and one response. All scripts start with <script> and end with </script>

<script>

<event> 'opening event tag.

<condition type="startGame"> 'opening condition tag

</condition> 'closing condition tag

<response type="disableMorale"> 'opening response tag

<disable value="true"/> 'response variable

</response type> 'closing response tag

</event> 'closing event tag

</script>


FormatEdit

All scripts are in XML format. All tags (<tagnamehere>) need to be in properly nested pairs. Opening tags look like this <tagname>. Closing tags look like </tagname>.

Also, a pair of tags with no tags in between can be expressed like </tagname>.


EventsEdit

Each event should have one condition and at least one response. Events begin with the <event> tag and end with the </event> tag. To make it so that an event fires more than once, change the opening event tag to look like <event repeats="INTEGER">. Where INTEGER is replaced with the number of times the event can fire. Replace "INTEGER" with "infinite" to make the event fire an unlimited number of times.


ConditionsEdit

Conditions follow the following format:

<condition type="conditionName">

</condition>


ResponsesEdit

ErrorsEdit

Here is, as far as I can tell, some errors I’ve encountered in the script editor mean. Error #1085: Your tags (e.g. <event> or </script>) are not in properly nested matched pairs. Error #1090: You haven’t formatted your tags properly. You are probably missing a " < > / or other formatting character.


DebuggingEdit

Often when scripting you get the some of the above errors. The best way to solve these is to use Adobe Dreamweaver, because it has an XML debugger. If you don't have Dreamweaver, you can use substitute like Microsoft XML Notepad, but it´s capacity to debug in correct XML format is weak and don´t work on all times.


Color CodesEdit

The scripting guide is wrong. The order for the colors is actually: Alpha, Red, Green, Blue

Here is how the color codes for the scripts work:

FFAABBCC

FF=Alpha, AA=Red, BB=Green, CC=Blue

Keep the Alpha at FF for the cleanest colors. As alpha goes to 00, the color becomes grey.

Here are some primary colors.

  • Red:FFFF0000
  • Green:FF00FF00
  • Blue:FF0000FF
  • Yellow:FFFFFF00
  • Cyan:FF00FFFF
  • Magenta:FFFF00FF
  • White:FFFFFFFF

To produce half-shades replace FF with 80.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.