Thread: 1 question (well... 2 to be exact)

  1. #1
    A Banana Yoshi's Avatar
    Join Date
    Oct 2001
    Posts
    859

    1 question (well... 2 to be exact)

    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

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    465
    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.

  3. #3
    Registered User compjinx's Avatar
    Join Date
    Aug 2001
    Posts
    214
    how do I find out how many lines are there with ifstream?
    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.
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  2. Lame question on dialog controls appearance
    By Templario in forum Windows Programming
    Replies: 2
    Last Post: 03-18-2003, 08:22 PM
  3. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  4. Question about linked lists.
    By cheeisme123 in forum C++ Programming
    Replies: 6
    Last Post: 02-25-2003, 01:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM