D. Custom MonstersTo make your game unique, you will probably want at least a few custom monsters, so let us go through how to do that.
The Combat TabCreate an object as normal in the appropriate room, for instance, a lizardman. Go to the
Combat tab, and select "Monster". Suddenly there is a huge form to fill in. Sorry, but RPG combat is complicated, and most of it does need to be filled in!
I am going to set my lizardman to be of the "Beast" type, and give him an armour of 1, as his scaled skin gives some protection.
Most of the rest is self-explanatory if you are familiar with RPGs hopefully, but some are less obvious:
Ticking "Attack as group" will have this monster attack if any other monster in the room is attacked, while "Attack on sight" will have him attack as soon as the player enters the room (otherwise it will only attack if attacked). If the creature has no physical form, such as a ghost, then tick "Non-corporeal". You might want to tick "No corpse on death" too.
By default, monsters are "Constrained" to the one room. You can set them to "Free" and they will chase after the player if she goes to another room (but not if she teleports). If set to "Forgetful", the monster is stuck in this room, and will forget that the player attacked it if she leaves the room.
The Description TabNow go to the
Description tab. In the first box, put in a description of the monster (what you would normally put in the "Look" box on the Setup tab). The rest is all optional.
My lizard man attacks by biting, so the description when attacking I will change to:
% bites at you
You need to word this carefully, as text will be added to the end to indicate the result.
The revealed description and lore description can be used if your player can learn True Sight and Lore spells. Lore gets added to the basic text, the revealed description will replace it.
The description on death is useful for monsters that die in bizarre ways, such as dissolving away.
The Attributes TabFor special effects, you can add scripts to the monster on the
Attributes tab. These are the scripts you can add:
ondeath will run when the monster dies
onweaponhit will run when the monster is hit by a weapon
onsuccessfulattack will run when the monster has damaged the player
onfailedattack will run when the monster has failed to damage the player
onanyattack will run when the monster has failed to damage the player
You are pretty much on your own here; it depends what you want to happen.
Multi-attack MonstersSay I want my lizardman to be attack with his claws as well as his teeth, or perhaps he is a shaman and can cast various spells. To set this up, go back to the
Combat tab, and set him to be a "Multi-attack monster". You then need to add each attack as a separate object inside him.
Right click the monster, and select
Add Object. Give the attack a name and in the drop down box, select the monster, then click
Okay (if you forget to set the parent, you can just drag the attack on top of the monster).
Go to the
Combat tab of the new attack, and set it to be a "Monster attack". Fill in the form as before.
You can add as many attacks as you like, and each turn one will be selected at random (if you do not want it to be random, you can edit the "selectattack" script on the monster as you like).
The following scripts can be added to an attack:
onsuccessfulattack will run when the monster has damaged the player
onfailedattack will run when the monster has failed to damage the player
onanyattack will run when the monster has failed to damage the player
To have an attack only ever happen once, you could set the "onanyattack" script to move the attack somewhere else. Or use the "onsuccessfulattack" if you want it to keep trying until successful. You could also use those scripts to move other attacks to the monster. By swapping attacks in and out you can construct a complex pattern of attacks.
Guarding an exitA monster can be set to be "guarding" one or more exits. Each guarded exit must be locked, and the name of the exit must include the string "guard" (so you can have locked exits too; just do not have "guard" in the name of the exit). When the monster dies, the exits will be automatically unlocked. It is good idea to change the "Print message when locked" string to something like "That way is block by a monster". You can have several monsters guarding one room (like the frostguard and ice wyrm in the demo). Do not have the monster free to follow the player.
Note that if you have an Unlock spell, code it to not unlock exits with "guard" in the name.
If you want some generic or cloned monsters to be guarding an exit, use the SetGuards function, which will set every monster in the room to be guarding. Remember to do it after you place the monsters, so for example like this:
CreateFromPrototypeLevel (kobold, 8, this)
CreateFromPrototypeLevel (kobold, 8, this)
CreateFromPrototypeLevel (kobold_shaman, 8, this)
CreateFromPrototype (dark_pixie, this)
SetGuards (this)