Page 2 of 2

Re: Text based rpg...

Posted: Tue Dec 30, 2008 3:41 pm
by deryni21
im working on a sort of a battle system but i want to add a sort of stun like side effect

i'm not terribly new to c++ but i'm still pretty much a total noob

i made stud a boolian variable but im not sure how i would implement that into the attack so something like this was my guess

Code: Select all

if(chance == 3); // chance is a random number between one and ten
           {
                      stun = true;
                       
                      if(stun == true); 
                      {
                              cout << " your enemy is incapable of attacking " 
                              }
                              }
what i am not sure on how to do is to make chance different everytime i use the attack and how to include this into the attack

Re: Text based rpg...

Posted: Tue Dec 30, 2008 4:41 pm
by eatcomics
So what you don't know how to do is change chance once you press attack, couldn't you just make an attack function that is called when you choose to attack, and have chance chosen at the beginning of the function?

as for using it just use another function or have a switch case thing...

Edit: My game is set up into different files for like everything, like battlesystem is one cpp file, while shop is another...

Re: Text based rpg...

Posted: Tue Dec 30, 2008 5:09 pm
by andrew
Which kind of text based rpg did you have in mind?

There's this kind:
Wrath Lands

Or this kind...
Rogue

John Romero made a free text library for C++ to make rogue-like games:
Here is the page for it.

Re: Text based rpg...

Posted: Tue Dec 30, 2008 5:14 pm
by eatcomics
andrew wrote: John Romero made a free text library for C++ to make rogue-like games:
Here is the page for it.
^Nice find andrew :)

Re: Text based rpg...

Posted: Wed Dec 31, 2008 4:53 pm
by andrew
Here's another link: Roguelike Dev FAQ

If your head doesn't explode from reading all that, you should be good to go. ;)

Re: Text based rpg...

Posted: Wed Dec 31, 2008 11:56 pm
by dandymcgee
andrew wrote: If your head doesn't explode from reading all that, you should be good to go. ;)
My Head! :shock2: Seriously though.. that's WAY too much information for one page!

Re: Text based rpg...

Posted: Fri Jan 02, 2009 1:16 am
by eatcomics
I'm still reading it lol, It's actually quite interesting... Although I think I have solved most of the big problems they show...

Edit: My head aches... :|

Re: Text based rpg...

Posted: Sun Jan 04, 2009 5:31 pm
by rolland
andrew wrote:Here's another link: Roguelike Dev FAQ

If your head doesn't explode from reading all that, you should be good to go. ;)
What should I know when first posting to r.g.r.d?

Some places are more newbie-friendly than others. The developers at rec.games.roguelike.development may sometimes show little patience with questions that have been asked many times before. Here are two simple things you can do to ensure that you get off to a good start:

* Do some research before you ask a question. If the answer is available via a search engine, why ask here? If the research does not turn up a satisfactory answer, then by all means ask, and you will be able to ask a better, more focused question as a result of your earlier work. Demonstrate that you have some initiative, and you will get a much more helpful response. As well as searching the web in general, search r.g.r.d.

* Don't ask what the best programming language for a roguelike is, or if a particular language is suitable for roguelike programming. If you want to know why, search r.g.r.d via Google Groups for "best programming language" and you will find many flamewars sparked by that question and its variants. The topic has been done to death, and many developers are tired of it.
Gold for any community/forum and game. If only everyone followed these guidelines...