Text based rpg...

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

User avatar
deryni21
Chaos Rift Regular
Chaos Rift Regular
Posts: 124
Joined: Wed Dec 24, 2008 9:55 pm

Re: Text based rpg...

Post 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
Image
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Text based rpg...

Post 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...
Image
andrew
Chaos Rift Regular
Chaos Rift Regular
Posts: 121
Joined: Mon Dec 08, 2008 2:12 pm

Re: Text based rpg...

Post 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.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Text based rpg...

Post 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 :)
Image
andrew
Chaos Rift Regular
Chaos Rift Regular
Posts: 121
Joined: Mon Dec 08, 2008 2:12 pm

Re: Text based rpg...

Post 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. ;)
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Text based rpg...

Post 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!
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Text based rpg...

Post 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... :|
Image
User avatar
rolland
Chaos Rift Regular
Chaos Rift Regular
Posts: 127
Joined: Fri Dec 21, 2007 2:27 pm
Current Project: Starting an Android app soon
Favorite Gaming Platforms: PS1, N64
Programming Language of Choice: C++
Location: Michigan, US

Re: Text based rpg...

Post 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...
I'll write a signature once I get some creativity and inspiration...
Post Reply