home » builders » builder's lessons » in file progs

In file programs

In file progs are used when you use the SAME program over many mobiles. We use them on mobs in various cities for citizens to call up guards when they are attacked. If you wish to use in_file_progs discuss them with us soon. Basically the program wanted on all the mobs is saved into a .prg file and stored in a special directory in the area directory of the game. In the mobs information you put in a command that tells the game to use the program in that directory. I will use the example of the Waterdeep Fight Program.

This file is called waterdeepfight.prg, and is stored in its own directory on the game.

>fight_prog 20~
if ISPC($n)
  yell Help! Guards! $N is attacking me on $b!
  yell I am on $b.
  if rand(10)
    mpecho A guard comes rushing to the aid of $I.
    mpmload 8023
    mpforce wyverncompanysoldier mpkill $N
  endif
endif
~
|

To each mobile that should have that program a line is added - >in_file_prog waterdeepfight.prg~ . This line of code calls to ths file when the area file is loaded up into the game.

#8183
priestess tymoramob~
the priestess of Tymora~
A priestess of Tymora is here playing a game of chance.
~
She is very young and very pretty.  She is dressed simply in
a dress that one would find a tavern wench wearing.  She laughs
merrily as she throws the dice.
~
U 50 CLASS_TYMORA RACE_HUMAN SEX_FEMALE POS_STANDING DEITY_TYMORA
ACT_SENTINEL|ACT_REQUEST|ACT_NOSHOVE|ACT_IS_HEALER|ACT_CITIZEN
0
ARMOR_TYPE_BANDED MATERIAL_BRASS
d15+15 1000
13 13 13 18 13 18 13
0 0 0 0 0
LANG_COMMON
LANG_COMMON
RIS_NONE RIS_NONE RIS_NONE
>in_file_prog waterdeepfight.prg~
|

Only one program per infile prog. You cannot combine more than one program. When naming an in file prog, make sure that the area name is included in the name so that it is easy to figure out which area the prog is associated with. There are some progs that are available for all areas.

  • >in_file_prog poop.prg~ - This prog can be put on horses so that they will generate poop. It can only go on horses as it generates horse manure.
  • >in_file_prog horsehair.prg~ - This prog can be put on horses that a PC can pluck a horse hair out of the tail for a spell component.