how do you calculate HP from constitution?
how do you calculate mana from intelligence?
show me your way(s).
i'm doing an RPG.
one more:
how do I find out how many lines are there with ifstream?
how do you calculate HP from constitution?
how do you calculate mana from intelligence?
show me your way(s).
i'm doing an RPG.
one more:
how do I find out how many lines are there with ifstream?
Last edited by Yoshi; 01-01-2003 at 02:20 PM.
Yoshi
how you calculate hp and mana is up to your own imagination.
some games have stats directly equal to attributes. such as 50 intelligence gives 50 mana.
others do formulas to decide stats. like, say, mana = 1.5 x int, so 50 int gives 75 mana.
others keep them entirely seperate. for example, a character can get mana + ( int / 2 ) mana per level, and intelligence only gives percent chance to cast spells or something, so if a character starts with a D&D 14 intelligence, they get 7 extra mana per level and have, say 80% chance to cast spells of their own level, and a higher % for every level lower.
its entirely up to you how you want your game to be played, and whether attributes will increase over time like most MMORPGs or stay the same, like D&D.
Is this a serious question? Just wondering. If it is then you simply scane the whole file and count the number of newline characters. Since a newline character is the same as any other character it is the same as finding the number of accurances of any character. Simply go through the whole thing and count the number of newline characters.how do I find out how many lines are there with ifstream?
Of course someone will come along and show how inefficient this is and devise a replacement.
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
Eric Porterfield.