-
Notifications
You must be signed in to change notification settings - Fork 11
CombatLib Part 01: Introduction
CombatLib gives the player four attributes that define her:
Intelligence: Used for learning and casting spells
Stamina: Determines the players hit points
Strength: Determines what armour the player can wear and partly her skill at melee
Agility: Determines her defence and partly her skill at melee
Combat is resolved by turns, with each combatant taking their action in a sequence that repeats until resolution.
Combat is resolved by rolling d20, adding the attacker's skill and deducting the tartget's defence. A shield gives a bonus to defence. Various other bonuses may be applicable due to magic or whatever.
On a successful attack, a damage roll is made, the nature of which depends on the weapon. Armour serves to reduce the damage rolls; that is, the armour is deducted from each die roll, so an armour of 2 will reduce 1d12 damage by 2, but 3d4 damage by 6. This means some weapons are better against armoured foes, others against unarmed.
For the player, armour covers specific locations; head, torso, shoulders, arms, hands, legs and feet (the head location counts double and the torso triple). Monsters use a simple armour attribute.
Magic does not require spell points or mana, and once a spell has been learnt it is known for ever (but this can be modified fairly easily). However, only one spell can be active at a time.
There is no consideration of position or orientation. Damage is recorded only in the number of hit points lost. There is no deterioration of armour or weapons. The player can sneak, and if not detected can backstab a foe.
CombatLib is designed for a fantasy world. Combat is melee-based and there is scope for a wide variety of spells. It may not be so suitable for combat involving ranged weapons.
CombatLib can be downloaded here: CombatLib.zip
You will need to right click on "Raw Data", and then select "Save link as...".
Because it is so big, CombatLib is actually a number of files, packaged in a .zip file. To add to your game, you will need to extract all those files into your game folder (your game folder is probably in a folder called "Quest" in your personal documents folder, and will have the same name as your game). You should find nine .xml files plus CombatLib.aslx itself.
You can open all these in a text editor (I recommend Notepad++) to see what they do. If you look inside CombatLib.aslx, you will find that all it does is call in the other nine files, however it will explain what each one does.
Once all the files are there, you can then add CombatLib.aslx to your game as normal.
Save and then reload your game. You should now see for an item that there are three new tabs, Wearable, Descriptions and Combat. If that is the case, you have successfully installed the library.
It is necessary to initialise the combat system when the game starts. Go to the Scripts tab of the game object. The top part is the game.start script. Just add this line (in code view):
CombatInitialise
In part 2 we will add some equipment for the player.