#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0

    Creating A Game In C. Basic Save Question


    So, me and a friend of mine want to create a reaaaally basic Text Adventure in C.

    The plan is simple, there will be a whole lot of text, dialogues, etc and the player will have to make decisions that will determine the route of the story. We wont have any visuals and it will pretty much look like a PnP RPG, maybe without the luck factor dices provide.

    My first question is if there is a way to have the program save the player's progression. If so, what libraries do I need to use and what commands.

    Im not sure if what im asking for is achievable, but thanks in advance.
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,740
    Rep Power
    1959
    Try take a look at c write and read text file
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0
    I only get results for C#, not C... Is there a way to make a small program that will track down the progress of main and be able continue the main from where it ended last time if I execute it?
  6. #4
  7. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,740
    Rep Power
    1959
    As I see it, it will be better to save the information to a file.
    Try have a look at these pages:
    http://www.go4expert.com/forums/showthread.php?t=2977
    http://forum.codecall.net/topic/51524-reading-and-writing-files-in-c/#axzz28udlPTSE
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0
    YES! This is what I was looking for. Ill search deeply into the matter.

    Now, I also need a way to roll a dice. I prefer to discover the way by myself but Im fully unaware of possible commands that will give randomized numbers as results. Is there a way to program a roll of a dice in C?

    Thanks, once again, in advance.

IMN logo majestic logo threadwatch logo seochat tools logo