You are on page 1of 12

The Protectors mod

-NIS files explained-


1. Basics
Nis files are scripts that control a dialog scene event in a scenario. To make a nis file act at a
certain time, go to the events section in the game’s editor and add a ‘Scene event’ event or a
‘Scene + show hidden’ event.

In the appropriate ‘Effects’ tab, simply type in the name of your nis file. DO NOT FORGET TO PUT THE
SUFFIX OF THE FILE (.NIS) or the game will not read it. Note that your nis file will be detected only if it is
in the Scenario folder of your game.

Next I will explain the contents of the nis file. They can be edited using any text editor, but make sure
you save it with the ‘.nis’ suffix (and not ‘.txt’ or ‘.doc’). Here are the basic rules and observations:

1. Everything in the file is CaSe SeNsItIvE. Refer to the picture provided at the end of this
document to see a sample/template.

2. All nis files must have the <NIS> tag at the beginning of the file, and closed at the end of
it (</NIS>).

3. If it is a dialog (and not a monolog of your hero), then we first must define the characters
that participate in the discussion using the ‘Character’ tag. All attributes are obligatory.

4. All unit detecting tags (Move, Patrol, Message, Owner, etc.) have these optional
attributes: id, owner, ishero. Some also have the charname attribute (as seen in picture
at the end of the document). Also keep in mind that side one is owner=”0”, side two is
owner=”1”, side three is owner=”2” and so on. Neutral is owner=”16”.

5. Tags which also require targets (Attack & Guard) have these optional attributes: targetid,
targetowner, targetishero.

6. Attack and move tags have the additional attributes “speed” and “d”. The first one sets the
speed of the ordered unit (defaulted if not mentioned), the second says that the unit should
ignore everything else that is happening and accomplish its mission at all cost
(direct/desperate).

7. Conditions can be placed on any tags except the Character and NIS ones. All of them can be
interconnected with the ‘not’, ‘and’, ‘or’ operators. Refer to the Conditions section below for
more information.

8. The x,y coordinates can be found by placing a event on a map and look at its Condition Position.
When using the Terrain tag, it is sufficient to choose a spot on the tile you wish to modify; it is
not necessary to aim at the top left corner of the tile.

9. Units and buildings names are found in the System.xcr file. An example would be the Iceguard
(case sensitive and always singular). If detecting the unit/building is not based on its name
(ishero for instance) then type in ‘ANY’. DO NOT LEAVE the spot empty or the game will crash.

10. Location codes can be found in any Campaign.xcr file.

11. Portrait numbers can be found in the Heroes.xcr file.

12. Weather intensity numbers are as follows: 0-Dayfine; 1-Dayrain; 2-Nightfine; 3-Nightrain; 4-
Dayheavyrain; 5- Nightheavyrain
13. Videos’ resolution MUST be 640x480 and .bik format. Use the RAD video tools (freeware) to do
the conversion. http://www.radgametools.com/bnkdown.htm

14. Putting the apostrophe symbol in a dialog is done by typing ‘&apos;’. Other symbols are
&gt; (greater than or ‘>’) &lt; &qt;(quotes) &name; (hero name) &day; (current day) and
&year; (current year). Placing the actual symbols in the nis file and not their code might
result in a crash.

15. Flags are set on by default when using the <Flag> command. To turn it off use the
attribute off.

16. When adding units or buildings of owners that do not exist (have left the game or never
joined), the default side will be used (neutral).

17. Any action may have an optional attribute called “stage”. This is used by the Stage
command to recognize the place where it needs to jump to.

18. Attitude list is as it appears in game (i.e. 0 – coward, 1 – stand ground, 2 – defensive, 3 –
aggressive, 4 – rampant, 5 – scout, etc.). The guard attitudes can be replaced with the
Guard command.

19. The <Perk> command always adds a value to the hero’s existing perk. Total negative
values are the left side effects (max -5), positive the right side (max +5).

20. Comments are done with the <!--- comment ---> command. These have no effect to the
game whatsoever.

2. Actions
Below is a template of a nis file with all the commands or actions. Everything in RED is
mandatory, green is optional.

WARNING! Do not copy-paste as the ” symbol differs from one text-editing application to
another and the command will be simply be ignored by the game. I recommend using Notepad.
<NIS>

<Character id="1" portrait="6" color=”2” side=”2”>Ellador</Character>

<Message stage=”the beginning” character="1" owner=”0” ishero id=”123” name=”Robert”>Choose a number,


ye&apos; douche.</Message>

<SideMessage owner=”0” type=”1” colour=”1” time=”10”>This is a non-intrusive text, like the perk changed
text.</SideMessage>

<Choice character="0" >

<a>One </a>

<b>I choose two.</b>

<c condition=”evil” hidden>I appear as an option only if you are evil.</c>

<d>Lucky four!</d>

<e>Bonus five. </e>

<f condition=”crowns500”>You need 500 crowns to select me. </f>

</Choice>

<Choice2 character="0" random >

<a>yes </a>

<b>no.</b>

</Choice2>

<Message character="1" condition="no1 and no11">You have chosen number one and said yes.</Message>

<Message character="1" condition="no1 and no12">You have chosen number one and said no.</Message>

<Message character="1" condition="no1 and evil">You have chosen number one, your evilness.</Message>

<Message character="1" condition="no1 and not evil">You have chosen number one.</Message>

<Message character="1" condition="no2">You have chosen number two.</Message>

<Message character="1" condition="no3 and bonus2">You have chosen number three and have bonus 2.</Message>

<Message character="1" condition="no4">You have chosen number four.</Message>

<Message character="1" condition="not no6">You did not choose number six by the way.</Message>

<Move x="123" y="123" owner=”0” ishero id=”123” speed=”4” d>Name or ANY</Move>

<Attack target="VictimName or ANY" owner=”0” ishero id=”123” targetowner=”0” targetishero targetid=”123”


speed=”4” d >MurdererName or ANY</Attack>

<Kill owner=”0” ishero id=”123” >Name or ANY</Kill>


<Screen x="123" y="123" xisopt yisopt xisbav yisbav xiscoordx yiscoordy ></Screen>

<Video>videoname.bik</Video>

<Owner towner="0" to="1" id=”123” >Name or ANY</Owner>

<Pause/>

<AddFeature x="123" y="123" xisopt yisopt xisbav yisbav xiscoordx yiscoordy >name</AddFeature>

<RemoveFeature x="123" y="123" xisopt yisopt xisbav yisbav xiscoordx yiscoordy ></RemoveFeature>

<AddPFX x="123" y="123" xisopt yisopt xisbav yisbav xiscoordx yiscoordy >numbercode</AddPFX>

<RemovePFX x="123" y="123" xisopt yisopt xisbav yisbav xiscoordx yiscoordy ></RemovePFX>

<PlayWAV>Bing.wav</PlayWAV>

<Music>ExtraGorgon.mp3</Music>

<Terrain x="123" y="123" xisopt yisopt xisbav yisbav xiscoordx yiscoordy >terraincode</Terrain>

<Patrol x="123" y="123" owner=”0” ishero id=”123” xisopt yisopt xisbav yisbav xiscoordx yiscoordy >Name or
ANY</Patrol>

<Guard target="bossName or ANY" owner=”0” ishero id=”123” targetowner=”0” targetishero


targetid=”123”>guardianName or ANY</Guard>

<RemoveUnit owner=”0” ishero id=”123” >Name or ANY</RemoveUnit>

<Screento owner=”0” ishero id=”123” >Name or ANY</Screento>

<AddUnit x="123" y="123" charname="charactername" xp="123" owner=”0” ishero id=”123” number="10"


numberisopt xpisopt xisopt yisopt xisbav yisbav xiscoordx yiscoordy >name</AddUnit>

<AddBuilding x="123" y="123" charname="charactername" owner=”0” ishero id=”123” xisopt yisopt xisbav yisbav
xiscoordx yiscoordy >name</AddBuilding>

<Weather>Intensitynumber</Weather>

<Stage>the beginning<Stage>

<Setvar global=”1” name=”variablename”>4</Setvar>

<Addvar global=”1” name=”variablename “>4</Addvar>

<Setopt index=”1” showno=”Variable 1:” abs >21</Setopt>

<Addopt index=”1” showno=”Variable 1:” >7</Addopt>

<Multiplyopt index=”1” showno=”Variable 1:” >10</Multiplyopt>

<Divideopt index=”1” showno=”Variable 1:” >10</Divideopt>

<Setbav index=”1” showno=”Variable 1:” abs >21</Setbav>

<Addbav index=”1” showno=”Variable 1:” >7</Addbav>


<Multiplybav index=”1” showno=”Variable 1:” >10</Multiplybav>

<Dividebav index=”1” showno=”Variable 1:” >10</Dividebav>

<Setdopt index1=”1” index2=”3” showno=”Variable row1col3 :” shownoline=”1” >1</Setdopt>

<Adddopt index1=”1” index2=”3” showno=”Variable row1col3 :” shownoline=”1” >7</Adddopt>

<Multiplydopt index1=”1” index2=”3” showno=”Variable row1col3 :” shownoline=”1” >10</Multiplydopt>

<Dividedopt index1=”1” index2=”3” showno=”Variable row1col3 :” shownoline=”1” >10</Dividedopt>

<AddCompanion xp=”123” code=”AUAX” >CharacterName</AddCompanion>

<RemoveCompanion>CharacterName</RemoveCompanion>

<Crowns owner=”0”>300</Crowns>

<Item>itemnumber</Item>

<Diplomacy side="13" modification="10" max="25" min=”-25” />

<Journal important video=”intro.bik” >Today I have learned how to use a NIS file.</Journal>

<Bonus>bonusnumber</Bonus>

<CrossVar id="0">1</CrossVar>

<PassTime>numberofdays</PassTime>

<Flag id="0" off condition=”flag12on and flag2off” />

<Relocate>LOC_BARTONIA</Relocate>

<Attitude owner=”0” ishero id=”123 attitude=”2”>Name or ANY</Attitude>

<SetAffliction owner=”0” ishero id=”123” type=”6”>Name or ANY</SetAffliction>

<ProduceHero>Sidenumber</ProduceHero>

<Setcon type="opt" index="1" isopt valueisopt >3</Setcon>

<!--- if opt 1 equals 3 then setcon condition will be true --->

<Message character="1" condition="setcon">Optional variable 1 is indeed 3. Hurray!</Message>

<Message character="1" condition="not setcon">Opt variablae 1 is not 3. Booo.</Message>

<!--- works like an ‘else’ --->

<Showdopt xstart="6" ystart="7" xend="8" yend="10" yendisopt xendisopt ystartisopt xstartisopt/>

<ResetGame/>

<GameSpeed>1</GameSpeed>

<Perk id="perknumber" owner=”0” >numbervalue</Perk>


<SetStartLocation x=”123” y=”123” owner=”0” xisopt yisopt xisbav yisbav xiscoordx yiscoordy />

<Damage x=”123” y=”123” radius=”5” owner=”0” xisopt yisopt xisbav yisbav >damageammount</Damage>

<Act>act_code</Act><!--- act file must be in the current location --->

<UncoverHiddenMap x=”123” y=”123” radius=”5” xisopt yisopt xisbav yisbav xiscoordx yiscoordy />

<Team owner="1" >teamnumber</Team>

<ChangeAI owner="1" >ailevelnumber</ChangeAI>

<Research owner="0" >idcode</Research>

<LocOwner id="LOC_SUNDEREDISLE">racenumber</LocOwner>

<CreateEvent ctype="2" cowner="0" flags=”0” cx="10" cy="10" radius="5" cnumber=”1” ctarget=”1”


cname=”Peasant” effect="5" ownertype="3" ownerdata="0" x="15" y="15" number="3" numberisopt type=”1” location="1"
time=”30” shots=”1” loopcount=”1” xiscoordx yiscoordy xisopt yisopt xisbav yisbav cxiscoordx cyiscoordy cxisopt cyisopt
cxisbav cyisbav timeisopt timeisbav >Peasant</CreateEvent>

<CastSpell owner=”0” ishero id=”123” level=”4”>spellindex</CastSpell>

<AddItem x="15" y="15" xisopt yisopt xisbav yisbav type=”0” index=”-8” >A random cursed item</AddItem>

<RemoveItem index=”251” slot=”9” owner=”3” />

<SetCurse slot=”1” owner=”2”>-2</SetCurse>

<Playlist>TPCOST.ini</Playlist>

<Resources owner="0" gold crystal >numbervalue</Resources>

<Find owner=”0” ishero id=”123” number=”2” >Name or ANY</Find>

<SetObjective id="codename" type=”0” number=”10” numberisopt numberisbav>text</SetObjective>

<ClearObjective id="codename" />

<GetCoords owner=”0” ishero id=”123” >Name or ANY</GetCoords>

<ShareVision owner1="1" owner2="4" >0 or 1</ShareVision>

<ShareTeams owner1="1" owner2="4" >0 or 1</ShareTeams>

<ChangeChar id="1" portrait="6" color=”2” side=”2”>Ellador</ChangeChar>

<AddXP xp="123" owner=”0” ishero id=”123”>Name or ANY</AddXP>

<ResetMovePath/>

</NIS>

3. Conditions
Below is a list of conditions. All of them can be applied within any action tag and can be related
to each other with and, or, not. Conditions marked with black are applicable to any .nis file, the
ones with blue are for campaign only (when dialogue happens on the world map) and the ones
with green for scenarios only (when dialogue happens on the battle map).

 RACE (knight, dwarf, undead, barbarian, minotaur, orc, highelf, woodelf, darkelf, fey,
darkdwarf, daemon, empire, ssrathi, swarm, plaguelord)

 LEADING RACE (lknight, ldwarf, lundead, lbarbarian, lminotaur, lorc, lhighelf,


lwoodelf, ldarkelf, lfey, ldarkdwarf, ldaemon, lempire, lssrathi, lswarm, lplaguelord)

 CLASS (warrior, chieftain, ranger, deathknight, dragonslayer, daemonslayer, thief,


assassin, bard, merchant, priest, tinker, paladin, healer, druid, runemaster, shaman,
elementalist, defiler, archmage, necromancer, pyromancer, summoner, alchemist,
illusionist, icemage, lichelord, sage)

 FLAG (flag0on, flag0off, flag1on, flag1off, …, flag15on, flag15off)

 MISC (evil, good, mortal, immortal, wizard, warrior, priest, thief, rogue)

 CHOICE (no1, no2, no3, no4, no5, no6, no11, no12, no13, no14. no15, no16)

 CROWNS (crowns0000, crowns0001 …, crowns9999)

 CROWNSLE (crownsle0000, crownsle0001 …, crownsle9999)

 CROWNSDNO (crownsdno0000, crownsdno0001 …, crownsdno9999)

 LEVEL (level001, level002 …, level999)

 LEVELLE (levelle001, levelle001 …, levelle999)

 LEVELDNO (leveldno001, leveldno002 …, leveldno999)

 RESOURCES (gold0000, metal0001 …, crystal9999)

 RESOURCESLE (metalle0000, stonele0001 …, goldle9999)

 RESOURCESDNO (golddno0000, metaldno0001 …, stonedno9999)

 STR (str000, str001 …, str999)

 STRDNO (strdno000, strdno001 …, strdno999)

 DEX (dex000, dex001 …, dex999)

 DEXDNO (dexdno000, dexdno001 …, dexdno999)

 INT (int000, int001 …, int999)


 INTDNO (intdno000, intdno001 …, intdno999)

 CHA (cha000, cha001 …, cha999)

 CHADNO (chadno000, chadno001 …, chadno999)

 ITEM (item000, item001 …, item999)

 COMPANION (Robert, Setroth, Elana, Kaari, Gront, Kheldon, Paridian, Minos,


Aelfwhine)

 GLOBAL VARIABLE GREATER THAN (var00gt000, var00gt001, …, var99gt999)

 LOCAL VARIABLE GREATER THAN (varl00gt000, varl00gt001, …, varl99gt999)

 GLOBAL VARIABLE GREATER THAN OR EQUAL TO (var00ge000, var00ge001,


…, var99ge999)

 LOCAL VARIABLE GREATER THAN OR EQUAL TO (varl00ge000, varl00ge001,


…, varl99ge999)

 GLOBAL VARIABLE LESS THAN (var00lt000, var00lt001, …, var99lt999)

 LOCAL VARIABLE LESS THAN (varl00lt000, varl00lt001, …, varl99lt999)

 GLOBAL VARIABLE LESS THAN OR EQUAL TO (var00le000, var00le001, …,


var99le999)

 LOCAL VARIABLE LESS THAN OR EQUAL TO (varl00le000, varl00le001, …,


varl99le999)

 GLOBAL VARIABLE EQUAL TO (var00eq000, var00eq001, …, var99eq999)

 LOCAL VARIABLE EQUAL TO (varl00eq000, varl00eq001, …, varl99eq999)

 BATTLE VARIABLE GREATHER THAN(bav00gt000, bav00gt001, …, bav99gt999)

 BATTLE VARIABLE GREATHER THAN OR EQUAL TO (bav00ge000, bav00ge001,


…, bav99ge999)

 BATTLE VARIABLE LESS THAN (bav00lt000, bav00lt001, …, bav99lt999)

 BATTLE VARIABLE LESS THAN OR EQUAL TO (bav00le000, bav00le001, …,


bav99le999)

 BATTLE VARIABLE EQUAL TO (bav00eq000, bav00eq001, …, bav99eq999)


 OPTIONAL VARIABLE GREATHER THAN(opt00gt000, opt00gt001, …, opt99gt999)

 OPTIONAL VARIABLE GREATHER THAN OR EQUAL TO (opt00ge000,


opt00ge001, …, opt99ge999)

 OPTIONAL VARIABLE LESS THAN (opt00lt000, opt00lt001, …, opt99lt999)

 OPTIONAL VARIABLE LESS THAN OR EQUAL TO (opt00le000, opt00le001, …,


opt99le999)

 OPTIONAL VARIABLE EQUAL TO (opt00eq000, opt00eq001, …, opt99eq999)

 OPTIONAL VARIABLE GREATER THAN OPTIONAL VARIABLE (opt00gtopt00,


opt00gtopt01, …, opt99gtopt99)

 OPTIONAL VARIABLE GREATER THAN OR EQUAL TO OPTIONAL VARIABLE


(opt00geopt00, opt00geopt01, …, opt99geopt99)

 OPTIONAL VARIABLE LESS THAN OPTIONAL VARIABLE (opt00ltopt00,


opt00ltopt01, …, opt99ltopt99)

 OPTIONAL VARIABLE LESS THAN OR EQUAL TO OPTIONAL VARIABLE


(opt00leopt00, opt00leopt01, …, opt99leopt99)

 OPTIONAL VARIABLE EQUAL TO OPTIONAL VARIABLE (opt00eqopt00,


opt00eqopt01, …, opt99eqopt99)

 OPTIONAL VARIABLE GREATHER THAN STAT(opt00gtcha, opt00gtstr, …,


opt99gtdex)

 OPTIONAL VARIABLE GREATHER THAN OR EQUAL TO STAT(opt00gestr,


opt00gedex, …, opt99geint)

 OPTIONAL VARIABLE LESS THAN STAT(opt00ltstr, opt00ltdex, …, opt99ltcha)

 OPTIONAL VARIABLE LESS THAN OR EQUAL TO STAT(opt00lestr, opt00ledex,


…, opt99lecha)

 OPTIONAL VARIABLE EQUAL TO STAT(opt00eqstr, opt00eqdex, …, opt99eqcha)

 DOUBLE OPTIONAL VARIABLE EQUAL TO (dopti00i00eq000, opti00i01eq001, …,


opti99i99eq999)

 DOUBLE OPTIONAL VARIABLE GREATER THAN (dopti00i00gt000,


opti00i01gt001, …, opti99i99gt999)
 DOUBLE OPTIONAL VARIABLE GREATER THAN OR EQUAL TO
(dopti00i00ge000, opti00i01ge001, …, opti99i99ge999)

 DOUBLE OPTIONAL VARIABLE LESS THAN (dopti00i00lt000, opti00i01lt001, …,


opti99i99lt999)

 DOUBLE OPTIONAL VARIABLE LESS THAN OR EQUAL TO (dopti00i00le000,


opti00i01le001, …, opti99i99le999)

 SET CONDITION (setcon)

 FOUND (found)

 BONUS (bonus0, bonus1, … , bonus19)

 SPECIAL (melvincleggpayed, melvincleggignored,…)

 CURSED ITEM (cursed)

4. Variables
Variables are a quantity that during a calculation is assumed to vary or be capable of varying in
value. There are four types of variables in The Protectors:

- Global variables: these are applied on the whole world map and defined in the Global.var
files of any campaign.xcr

- Local variables: these are applied only on the current location of your hero on the world
map and are defined in locationname.loc files of any campaign.xcr

- Battle variables: these are applied only for the current battle – once the battle is over the
variables are deleted

- Optional variables: these are applied and defined only within the current dialogue file -
once the conversation is over, the variables are deleted.

5. Modifiers
Modifiers are portions of code that can be introduced at any time during a phrase to represent a
previously calculated value. There are four types of modifiers in The Protectors:

- Global Variables: displays the current global variable value

Eg. <Message> I have advanced this much in the campaign: VAR00</Message>

- Optional Variables: displays the current optional variable value


Eg. <Message> Since we started talking, we know each other OPT00 per cent
better.</Message>

- Random: displays a random number from the range defined with “min” and “max”
attributes

Eg. <Message min=”1” max=”6”>My dice shows RAND</Message>

- Time: display current time in days (considering there are always 365 days in a year)

Eg. <Message>The elves began recording history TIME days ago.</Message>

You can also access current year and current day of the year with DAY and YEAR
modifiers.

Eg. <Message>Today it is the year &year; and we are in day number &day;.</Message>

- Game Time: display elapsed game time in seconds

Eg. <Message>This battle has been going on for &gametime; seconds.</Message>

- Difficulty Number: display a number affected by campaign difficulty (considering the


entered value available on easy)

Eg. <Message>I will take from you DNO-0500 crowns and will give you back only
DNO00500 crowns back.</Message>

Notice that the number must always contain 5 digits/ minus symbol. A negative number
would be increased, but a positive number would be decreased.

- Map Width: display the map’s width in unit squares

Eg. <Message>This map’s size is MAPWIDTH by MAPWIDTH.</Message>

All of them can have the minus symbol to represent its negative (-TIME, -VAR2 etc.). Other
than text display, they also work with the following commands: Setbav, Addbav, Multiplybav,
Dividebav, Setopt, Addopt, Multiplyopt, Divideopt, Setdopt, Adddopt, Multiplydopt,
Dividedopt, PassTime, Crowns and Resources.

6. Questions
If you have any more questions, please contact the modders via http://the-protectors.webs.com

Happy scenario-making!

You might also like