I’ve decided that I would like to write a very basic combat extension for I7 that I wish to use for a short game that I have an idea for.
The extension will be based on simple die rolls for a handful of stats like initiative (to determine who attacks first), dexterity (to determine how accurate a strike is e.g. A miss or a critical hit etc.
As a novice I7 author, what would be a good place to start in terms of implimenting this? I figure I should start by implementing the most basic stats first and gradually add things one at a time.
I’ve looked into Kerkerkruip’s source code a bit but its pretty enormous and far more in depth that I wish to implement in my game idea.
Has anyone here had much luck creating or editing an existing extension to serve as a simple dice based combat system for a game using I7.
At the most basic level I would like to have the following flow of combat as the basic building blocks from which to build upon:
- Player encounters and enemy.
-both roll for initiative.
-highest roll begins combat. - Player/Enemy rolls for damage (random number between 1 and max damage)
- Receiving character rolls for defence (random number between 1 and max defence)
- Damage roll minus defence roll = Damage inflicted.
With the limited knowledge I have of inform, my guess is I will first need to create definitions for each of the variables such as Damage, Defence, Hit Points, Damage inflicted etc. then create ‘if’ statements to allow the definitions to have meaning?
I have been referencing ‘Lanista 2’ from: 7.5. Combat and Death, however have been having some trouble trying to get the code thats written as an example to work in a fresh I7 project. After removing all commented sections I continuosly get errors regarding improper use of colons and indentations etc. I was hoping to find a very simple, short example of some combat based code to experiment with so I could use it as a base to then build something that I can use for my own game that fits my own purposes.
I apologise for the meandering form that this post has become, I do realise that combat within text based games is extremely uncommon and is probably not the best thing for a beginner to start with, however I have become quite fixated on the idea of creating a simple and engaging combat system for a text based game.
Any advice, references, example code etc. would be really really appreciated and helpful as I currently feel like I’ve done as much searching as I can to still only find a handful of games and I think some fresh eyes might help point me in the right direction.
Thanks!
P.S. I’m not sure if I should be writing this as an extension or simply within the source code to begin with? My guess is that once I have a working and viable source code I can trim out the relevant sections as my ‘combat extension’?