Adding RPG stat elements
isomeras
01 Sept 2011, 10:03Hi.
I've taken a peek at some of the games and seen that it's possible to add health, statuses, etc to the game.
How is this possible?
What I want to do is:
Add health
Add attack/defence/other types of stats that affect damage taken
Enemies with attack strengths going through a range. Like one enemy can hit 12-14 of [element] damage. The numbers can be increase or decreased according to equipped items and whatnot.
Equip items that affect stats.
Levels that increase maxhealth and stats.
Items that restore health
As stated, if they ARE possible, how are they possible? I'd love to have some help here. Thanks.
I need to point out that, for some reason, I'm often unable to take in brief instructions. I need to be walked through it rather than having "do this and this" thrown at me.
I've taken a peek at some of the games and seen that it's possible to add health, statuses, etc to the game.
How is this possible?
What I want to do is:
Add health
Add attack/defence/other types of stats that affect damage taken
Enemies with attack strengths going through a range. Like one enemy can hit 12-14 of [element] damage. The numbers can be increase or decreased according to equipped items and whatnot.
Equip items that affect stats.
Levels that increase maxhealth and stats.
Items that restore health
As stated, if they ARE possible, how are they possible? I'd love to have some help here. Thanks.
I need to point out that, for some reason, I'm often unable to take in brief instructions. I need to be walked through it rather than having "do this and this" thrown at me.
Alex
01 Sept 2011, 10:25These are called "status attributes" and they are covered in the Tutorial on the "Using timers and turn scripts" section.
Basically, any stat like "health" is going to be an attribute of the "player" object. So, click the "player" object and add an attribute called "health" - make it an Integer.
Next, add "health" to the "Status attributes" list at the top of the "Attributes" tab.
That's all there is to it - there's more info in the tutorial if you want to customise the text that is displayed.
Basically, any stat like "health" is going to be an attribute of the "player" object. So, click the "player" object and add an attribute called "health" - make it an Integer.
Next, add "health" to the "Status attributes" list at the top of the "Attributes" tab.
That's all there is to it - there's more info in the tutorial if you want to customise the text that is displayed.
isomeras
01 Sept 2011, 10:26Thank you very much, Alex. In all reality I've only gotten halfway through the intermediate stuff and I figured I knew enough to make a decent game with help from the forums.
So yeah. Thanks. Those tutorials are really well written.
I'll get right on it and post up here if there's ever something that doesn't quite supply what I need.
So yeah. Thanks. Those tutorials are really well written.

Alex
01 Sept 2011, 10:44Cool, yes, please let me know if there's anything in the tutorials that could be explained better - they're pretty new so they haven't been thoroughly "road tested" yet!
isomeras
01 Sept 2011, 18:20Okay, I've taken a look at the tutorial (and used your health thing) and see nothing working. The tutorial doesn't give me what I want in the stat elements and the health thing...Well, without anything to deduct health, I can't see if it works. I have, however, managed to get the Heath to display.
Please could you give me a detailed explanation of what to do? For now, just set damage/healing numbers for each action (and a single set health and max health) will do. I'll do status effects much later, when I feel the game can be developed further than what I know.
EDIT: I wouldn't mind having weapons and armour causing variables, however. This seems easy (I picture many If and Switch commands). And implementing the turn function, perhaps weapon/armour durability.
EDIT2: It wouldn't hurt to have any little monsters you find have health too...
Please could you give me a detailed explanation of what to do? For now, just set damage/healing numbers for each action (and a single set health and max health) will do. I'll do status effects much later, when I feel the game can be developed further than what I know.
EDIT: I wouldn't mind having weapons and armour causing variables, however. This seems easy (I picture many If and Switch commands). And implementing the turn function, perhaps weapon/armour durability.
EDIT2: It wouldn't hurt to have any little monsters you find have health too...
Alex
02 Sept 2011, 08:24It's the same principle as the turn counter in the tutorial. Whenever something in the game happens where you want to change health, add a script command to change the value of the player's "health" attribute.
For example, if eating an apple adds 10 the health score, add an "eat" verb to an "apple" object. Make it run a script: Choose "Set variable or attribute", enter variable name "player.health", enter expression "player.health+10"

I think it would be nice to have a health library eventually, as this could definitely be made a little easier.
For example, if eating an apple adds 10 the health score, add an "eat" verb to an "apple" object. Make it run a script: Choose "Set variable or attribute", enter variable name "player.health", enter expression "player.health+10"

I think it would be nice to have a health library eventually, as this could definitely be made a little easier.
isomeras
02 Sept 2011, 10:21I think I get it. Key word here being -think-. My brain's already formulating how it'll work out.
Yeah. A few moments of reflection afterwards and I seem to have figured out the basics of making enemies slap you. I'm pretty sure that I can add the Health attribute to them as well so I can make the Y.Health-X...
Yeah. That's going to work. Thank you
.
Now the question remains, how do I make it increase inflicted damage when wielding a weapon and lower inflicted damage when armour is involved?
Yeah. A few moments of reflection afterwards and I seem to have figured out the basics of making enemies slap you. I'm pretty sure that I can add the Health attribute to them as well so I can make the Y.Health-X...
Yeah. That's going to work. Thank you
.
Now the question remains, how do I make it increase inflicted damage when wielding a weapon and lower inflicted damage when armour is involved?
The Pixie
02 Sept 2011, 10:23For an opponent's health, I would have a string variable on the player called, say, opponent_health, which is a string, but leave it blank. Then for the status attribute, add opponent_health, and "!" (no quotes). When combat starts and each time the opponent takes damage, set opponent_health like this, perhaps:
player.opponent_health = monster.name + ": " + monster.health + "/" + monster.full_health
If your opponent is an orc with 25 hits, you will see:
Orc: 25/25
When combat is over blank the status:
player.opponent_health = ""
player.opponent_health = monster.name + ": " + monster.health + "/" + monster.full_health
If your opponent is an orc with 25 hits, you will see:
Orc: 25/25
When combat is over blank the status:
player.opponent_health = ""
Alex
02 Sept 2011, 11:10isomeras wrote:Now the question remains, how do I make it increase inflicted damage when wielding a weapon and lower inflicted damage when armour is involved?
There are a couple of ways you could do this:
- you could use an "if". If the player/character has armour, decrease health by a certain amount. Else: decrease health by a larger amount.
- you could have a "damage factor" attribute for the player/character. They start with a damage factor of 1. When the player or character gets armour, change the damage factor to 0.5 or something. Then you just need to multiply the decrease in health by the damage factor, for example
player.health = player.health - (10 * damage factor)
So if the player has no armour, they would lose 10. If the player has armour, they lose 5.
This approach is more flexible as it allows you to have different types of armour offering different levels of protection.
The Pixie
02 Sept 2011, 12:10This is something that I have thought about somewhat. What I would do is have an "equip #object#" command, the player is then using the equipped weapon (so he can carry several, but only fight with one). When a weapon is equipped, the bonus for the weapon is added to the attack.
For armour, for similicity I would have complete costumes, when the player puts on the suit of mithril chainmail, whatever he was previously wearing comes off (as with weapons); he can carry several costumes, but only wear one. When he is attacked, deduct the armour rating from the damage.
If you want to get clever, have different weapons good against different armour. Are you familar with tabletop RPG notation, like 2D6+4 (roll 2 six sided dice and add 4)? Have the armour rating deducted from each die roll, then a sword doing 2d8 is good against armoured foes, while a 4d4+2 is better for unarmoured foes.
I even got as far as a function to determine damage:
I have not got as far as putting this into quest, so there may well be brackets missing, etc. but it might help.
The other idea I had was to let the player and opponent choose to stab, slash or strike their foe, with a bonus or penalty depending on what the foe does (rock, scissors, paper style). Really clever foes will always guess right! But that may be more complicated than you want.
For armour, for similicity I would have complete costumes, when the player puts on the suit of mithril chainmail, whatever he was previously wearing comes off (as with weapons); he can carry several costumes, but only wear one. When he is attacked, deduct the armour rating from the damage.
If you want to get clever, have different weapons good against different armour. Are you familar with tabletop RPG notation, like 2D6+4 (roll 2 six sided dice and add 4)? Have the armour rating deducted from each die roll, then a sword doing 2d8 is good against armoured foes, while a 4d4+2 is better for unarmoured foes.
I even got as far as a function to determine damage:
<function name="RollDamage" parameters="dice, ac" type="integer">
<!--
Given the classic DnD notation, dice are rolled and the result returned.
The input string must conform to a specific pattern; this is not tested for.
The string must be one of these, where x is one or more digits:
xdx
xdx+x
1d6 Roll a normal six-sided die
5d20+5 Roll five twenty sided dice and add 5 to the result.
NB The AC is deducted from every dice roll.
-->
<function parameters="dice,ac" type="integer"><![CDATA[
p1 = Instr(dice, "d")
p2 = Instr(dice, "+")
p3 = LengthOf(dice)
number = ToInt(Mid(dice, 1, p1 - 1))
if (p2 = 0) {
sides = ToInt(Mid(dice, p1 + 1, p3 - p1))
total = 0
}
else {
sides = ToInt(Mid(dice, p1 + 1, p2 - p1 - 1))
total = ToInt(Mid(dice, p2 + 1, p3 - p2))
}
for (i, 1, number) {
total = total + GetRandomInt(1, sides)
}
total = total - ac * number
if (total < 1) {
return 1
}
else {
return (total)
}
]]></function>
I have not got as far as putting this into quest, so there may well be brackets missing, etc. but it might help.
The other idea I had was to let the player and opponent choose to stab, slash or strike their foe, with a bonus or penalty depending on what the foe does (rock, scissors, paper style). Really clever foes will always guess right! But that may be more complicated than you want.
isomeras
02 Sept 2011, 12:40This is all incredibly overwhelming @.@ I think my brain broke. I'm honestly trying to take in what you guys told me.
Is there any way you can dumb it down for me? I like all of the ideas and see that they will work, but...As I said before, I can't do much without having my hand held through it. I need specifics, basically. ^^'
Is there any way you can dumb it down for me? I like all of the ideas and see that they will work, but...As I said before, I can't do much without having my hand held through it. I need specifics, basically. ^^'
Alex
02 Sept 2011, 13:25The simplest thing is in my reply: you could use an "if". If the player/character has armour, decrease health by a certain amount. Else: decrease health by a larger amount.
isomeras
02 Sept 2011, 13:36Alex wrote:The simplest thing is in my reply: you could use an "if". If the player/character has armour, decrease health by a certain amount. Else: decrease health by a larger amount.
Well yeah, but the armour and weapons are completely negligible if I can't figure out how to cause this damage in the first place. My point is that the help I've recieved thus far is a little complicated and I can't make heads nor tails of it.
Here's my problem.
I think it might be the autism talking, that or the fact I'm just an idiot. But everything I see that I don't fully understand usually has to get listed in the format of "This goes here and this goes here to make this work." or else I completely stall.
So yeah. All of this stuff looks good, and I really think the dicerolling bit would be most effective if it isn't too complicated when it comes to said format of explanation, but please could you guys put it down like that for me? I'm sorry if I seem a little unreasonable.
isomeras
06 Sept 2011, 17:18Sorry to sound rude but...Any word on what I previously posted?
Alex
06 Sept 2011, 18:15I don't really understand what you're asking, please ask a specific question! We need more info than "I can't figure it out", we need to know what it is you don't understand, what result you're looking to achieve, and what you've got set up so far, which is why a file attachment always helps.

Pertex
06 Sept 2011, 20:01I think isomeras wants us to tell that he doesn't want to learn scripting, but he allows us in the forum to code his game. So its not a surprise that he doesnt get answers.
The Pixie
06 Sept 2011, 22:14I think perhaps the problem is that Quest is very easy to start using, but also has the complexity to do a huge amount (I say this is a problem; it is also one of the great strengths of the software). You do not need to know anything about coding to create a game just using the GUI, but if you are creating any non-trivial game, you will come to the point where you need to do some coding (and I went though this myself just a few weeks ago, for example, with wearing a item or buying an item).
Ultimately, there will be libraries in place, so this will become less of an issue, but that is not the case now. Perhap, Pertex, you are right, then, that Isomeras is expecting those libraries to be available; however, I am noit sure he is being so unreasonable.
To get a decent user base for Quest 5, we should be trying to encourage its use by people who are writers, but not coders (as well as anyone else, of course). I write this realising that I probably did more to confuse than to help because I did not realise where isomeras was coming from.
As I said, I have thought about a combat system, and it is possible I might get around to writing a library, but it would be October sometime if I do (if anyone else wants to, I have ideas...).
Ultimately, there will be libraries in place, so this will become less of an issue, but that is not the case now. Perhap, Pertex, you are right, then, that Isomeras is expecting those libraries to be available; however, I am noit sure he is being so unreasonable.
To get a decent user base for Quest 5, we should be trying to encourage its use by people who are writers, but not coders (as well as anyone else, of course). I write this realising that I probably did more to confuse than to help because I did not realise where isomeras was coming from.
As I said, I have thought about a combat system, and it is possible I might get around to writing a library, but it would be October sometime if I do (if anyone else wants to, I have ideas...).

Pertex
07 Sept 2011, 06:39Sure, you are right, but writing such a RPG-library will take days or weeks. And even if it is done, you have to know scripting to change this library for running with your game. So without knowledge in scripting you will not able to use such a functionality in your game
I am writing a combat-library at the moment. My problem is the documentation in english.
The Pixie wrote:As I said, I have thought about a combat system, and it is possible I might get around to writing a library, but it would be October sometime if I do (if anyone else wants to, I have ideas...)..
I am writing a combat-library at the moment. My problem is the documentation in english.
The Pixie
07 Sept 2011, 07:05If you want me to proof-read, I would be happy to help.
isomeras
07 Sept 2011, 14:12Yeah, the main issue here is that I am nothing of a coder whatsoever. My true skill lies in the writing.
When/if the library is released, how will you be notifying us of it?
Thank you in advance.
P.S. Sorry for any frustration I may have caused.
When/if the library is released, how will you be notifying us of it?
Thank you in advance.
P.S. Sorry for any frustration I may have caused.