to compile go to visual studio command prompt and type in cd C:\users\"yourusername"\desktop into it and save the game in desktop and type in cl /EHsc adventuregame.cpp
Someone pls respond... I'm working in visual studio and every time i debug (compile and run) it it only shows for a second. I tried system("pause"); and it doesn't work! Please help!
Add cin.get(); after your code (in main.cpp) just before "return 0;" if you have that, otherwise, at the end, before "}". The system will expect an input from the user.
@bunny12391 and also, I never told anyone to learn their shit. You and 13Macintosh did. And I was referring to command like 13igMacintosh said, not c++
Yeah i've followed this tutorial, and everytime i open the game up, it closes out on me, then when i use DevC++ it stays open, but the game crashes everytime i make a option, what am i doing wrong here?
lol printf, good on you lad - I know that printf isn't standard, but it's better for text adventures (from experience, it doesn't tend to put random lines in places.)
@13igMacintosh c++ is a programming language no mater how you chose to show it wether its on an ide or notepad its the same thing. learn YOUR shit ma brotha
Hello everybody! I want to make my own text-adventure but there is one problem.. Can I give the parts of my adventure names and can I use a command like "if x then goto", that would be very important in my text adventure! Please help me!
well here a zombies game based text :) so much funn
in this games you do not play alone but you play with you friends.. you can create a teams with your friends and play together!.. just search 'die2nite' and press the first one and when you register there is a sponsor box.. please write 'zullord' in the box... :)
@13igMacintosh I know my shit, I'm learning c++ with my friend. Notepad however, is easier than c++ and does the same thing. I was offering a simpler alternative, not asking for a smartass reply.
@epicnerd905 like i said before c++ is a programming language it exactly the same no mater what your using. and if you were just making a simple seggestion you probably shouldnt be telling people to learn there shit
If you like Bootleggers your going to love Mafia Secrets, you here about everyone claiming old school on bl, well be old school on MS. The game just in the early stages and just being released just a few days ago, this is were its at, wanna be the most powerful on a game, and have the advantage of being there from the start then check us out @ mafiasecrets . com
Help! please someone, after i do the response at 4:45 it says 0 succeeded and 1 failed and says fatal error C1075: end of file found before the left brace '{' in the output box but there is nothing before it, if someone can help me out i would appreciate it '-'
@Heboidme cin.get(); is a good way to do it but if you have used "cin >> blablabla" anywhere in your code that wont work so you can do system("pause")
for people who are sad about the auto close problem in their hello-world programs you have to put system("PAUSE"); at the end of the program before return0 ( it only works on widows). Oh and this is a great tutorial i always come back to get info from it for more complex programs i build, hope minds edge makes more tutorials
hay instead of compiling it all the time you can also click build solution and it will just say if u have an error so u dont have to run the program every time
SO. Say I dont have a program like that. If I made this is Notepad how would I go about testing to see if it worked? (Would the program Eclipse work?)
@conker2020 Java and C++ is diffrent yet similar, similar due to some of the refrence keys and way you type stuff, but if your writing in java to make a text based game this isn't the tutorial ur really looking for
@conker2020 Like i said its similar but diffrent in some aspects, and this isnt my video, i just can code better then this, i was looking for more advance way to make a game and this was not what i was looking for lol, but it helps out a bit
I also had the problem with the command window closing as soon as I executed the program after compiling it, despite having no errors. However, I found that if you press CTRL+F5, it should run no problem :)
im am using 2010 ver and when i try to open it it closes arffter 0.5 seconds what is happing? im use windows 7 plz help i have looked every where with no solution...
Is there a way to make different branches? Say, if a character tells someone they love you, or doesn't, can it still continue throughout the whole game, depending on what they chose?
I like it but it really doesn't explain how to do it...for example you just pasted in the intro..i have no idea how to add that stuff in or how to make my text box stay up.
@TheScam117 There's actually a different way a different way of doing this and possibly simpler if you haven't worked with c++ very much. I've been experimenting. PM me if u want a bit of a tutorial. You'll have to bear with me though, I'm still just learning myself lol
@ThatLPerGuy That is because the console application has ended, so it closes. I do not know why the authors application pauses after it ends. He probably has that set somewhere in the Visual Studio IDE. You can do this manually by placing this just before the final return(0);
system("pause");
Or you could have it read for a keystroke by doing another scanf.
@joeshmoe66 well actually, i read somewhere about this problem and they said debugging it by using alt f5 or ctrl f5 (it's morning i cant remember) and it debugs it in a way and it didnt close. i think that's what the author did
@ThatLPerGuy Ok, makes sense. However, when you make the exe file and execute it, you will not get the benefit of that automatic pause. You will still probably want to program in some sort of pause.
@ThatLPerGuy At the end of the program try typing Cin.get instead of return 0; because that doesnt show the work and just closes, but after the if else then function then put the return 0; in respectful places
to compile go to visual studio command prompt and type in cd C:\users\"yourusername"\desktop into it and save the game in desktop and type in cl /EHsc adventuregame.cpp
Blueparrot911 3 days ago
also everytime i debug it says there's 1 fail.
JustinCase25XXV 1 week ago
i can't find where to compile and run....
JustinCase25XXV 1 week ago
Mindsedge why dont you use do while loop for ignoring other options?
for example if you type 1, 2 ,3 you "advance" however if you click everything else it reloads.
do {
your menu or story code
}while (opt != 1 && opt != 2 && opt !=3);
1DarkMasK1 1 week ago
@1DarkMasK1
sorry type not click lol.
1DarkMasK1 1 week ago
Someone pls respond... I'm working in visual studio and every time i debug (compile and run) it it only shows for a second. I tried system("pause"); and it doesn't work! Please help!
MrLegendaryStream 1 week ago
@MrLegendaryStream
Add cin.get(); after your code (in main.cpp) just before "return 0;" if you have that, otherwise, at the end, before "}". The system will expect an input from the user.
Hope this helps!
sharkyjulz 1 week ago
@sharkyjulz i did this and i get an error because "Error identifier "cin" is unidentified. what can i do?
MCHGExclusive 1 week ago
need help... i got the text down but everytime i try somthing it fails. if i press enter it just closes the window...
DeaththeKid357 1 week ago
How do you compile and run it?
HDshrapnel 1 month ago
@bunny12391 and also, I never told anyone to learn their shit. You and 13Macintosh did. And I was referring to command like 13igMacintosh said, not c++
epicnerd905 1 month ago
@bunny12391 please make informed statements. Someone told me to learn MY shit. Am I expected to sit back and take their crap?
epicnerd905 1 month ago
@bunny12391 someone told ME to learn MY shit. I was only saying that to THEM.
epicnerd905 1 month ago
Yeah i've followed this tutorial, and everytime i open the game up, it closes out on me, then when i use DevC++ it stays open, but the game crashes everytime i make a option, what am i doing wrong here?
Hatred2Soul 1 month ago in playlist Favorite videos
@Hatred2Soul I had the same problem in DEV C++ you need this at the end, visual studio does it automatically!
system("PAUSE");
return EXIT_SUCCESS;
CHADCURTISS1 1 month ago
@CHADCURTISS1 That's the problem too, i actually do have that at the end, and it still gives problems :S
Hatred2Soul 1 month ago
Comment removed
CHADCURTISS1 1 month ago
can i parse this to take more than 2 worm commands?
thefirstREALaxlyon 1 month ago
can this be used in DEV C++?
thefirstREALaxlyon 1 month ago
lol printf, good on you lad - I know that printf isn't standard, but it's better for text adventures (from experience, it doesn't tend to put random lines in places.)
OntDinRS 1 month ago
@13igMacintosh c++ is a programming language no mater how you chose to show it wether its on an ide or notepad its the same thing. learn YOUR shit ma brotha
bunny12391 1 month ago
@bunny12391 trudat!
TraceguyRune 1 month ago
and please send me a link to it
mryomantoo 2 months ago
what program?
mryomantoo 2 months ago
@mryomantoo visual studio
BatCoil 1 month ago
Whoa! You sure use a lot of non standard C++. I made my first text advanture during summer and I have no idea what these commands are.
Nikotiini69 2 months ago
I have one more question! how can i describe it? with the
int Choice
...
scanf( "%d", &Choice )
i can only make
if( Choice == [Number] )
but i want to make something like
if( Choice == [Word] )
how can i do it? hope, you understood what i mean
SkullClaymer 2 months ago
Hello everybody! I want to make my own text-adventure but there is one problem.. Can I give the parts of my adventure names and can I use a command like "if x then goto", that would be very important in my text adventure! Please help me!
SkullClaymer 2 months ago
Could you give me the link for that wallpaper pls
ILuvCE 2 months ago
project is out of date?
TheTrain2000 2 months ago
This has been flagged as spam show
well here a zombies game based text :) so much funn
in this games you do not play alone but you play with you friends.. you can create a teams with your friends and play together!.. just search 'die2nite' and press the first one and when you register there is a sponsor box.. please write 'zullord' in the box... :)
zullord5867 3 months ago
Choice is not defined
chrispytoes 3 months ago
@13igMacintosh I know my shit, I'm learning c++ with my friend. Notepad however, is easier than c++ and does the same thing. I was offering a simpler alternative, not asking for a smartass reply.
epicnerd905 3 months ago
@epicnerd905 like i said before c++ is a programming language it exactly the same no mater what your using. and if you were just making a simple seggestion you probably shouldnt be telling people to learn there shit
bunny12391 1 month ago
If you like Bootleggers your going to love Mafia Secrets, you here about everyone claiming old school on bl, well be old school on MS. The game just in the early stages and just being released just a few days ago, this is were its at, wanna be the most powerful on a game, and have the advantage of being there from the start then check us out @ mafiasecrets . com
Gamezzbook 3 months ago
Dude, just use notepad.
epicnerd905 3 months ago
@epicnerd905
lol
ben1996123 3 months ago
@epicnerd905 ...
mixinghoney 1 month ago
printf is not c++ standard... use cout
Darkhenne 3 months ago 11
I'm sorry, but this is just terrible.
alecnotalex 4 months ago
guess it's pretty much same thing if I use dev c++ right?
Samuli385 4 months ago
God never use printf.. It's very old and is used in C. ALWAYS use cout unless there is no other possible way.
kong288 5 months ago
Whenever I try to put in a choice and click enter, it closes the console window :(
I have no errors what so ever when I compile, what am I doing wrong?
Chrisxantixemox 5 months ago
@Chrisxantixemox Sorry if this reply is a little late. Its because the system uses enter as a way to close the window.
To fix it add
system("PAUSE");
Before the 'return 0;' at the end of the code :)
MrPhantomBadger 3 months ago
@MrPhantomBadger Yeah, figured it out by now :P but thanks anyways!
Chrisxantixemox 3 months ago
Help! please someone, after i do the response at 4:45 it says 0 succeeded and 1 failed and says fatal error C1075: end of file found before the left brace '{' in the output box but there is nothing before it, if someone can help me out i would appreciate it '-'
adsfsfads 5 months ago
no file called _TCHAR
Sacharias1 6 months ago
Can you give us source code of that game? I really need to check something out!
penguenishy 6 months ago
Um, isn't cout << "Insert text here" beter than printf?
ziodice 6 months ago
Thank you so much ive been trying to make a game like this but i didnt know you have to use this ==
Dmrgamez 6 months ago
is this a good tutorial if you just started with c++?
bollepoes 6 months ago
right now when i just put pause it shows the text for 1 second then dissapeares how can i make it stay????????????!!!!!!!!!
Heboidme 6 months ago
@Heboidme Try cin.get(); at the end, then it will wait for you to type before it ends it.
kilburn79 6 months ago
@Heboidme cin.get(); is a good way to do it but if you have used "cin >> blablabla" anywhere in your code that wont work so you can do system("pause")
(however that one wont work if you use CodeBlocks
chasflob 6 months ago
when i put the system("pause"); it showsan error of
" 1 IntelliSense: identifier "system is undefined
what to do?
Heboidme 6 months ago
@Heboidme
Do you use windows? Or other operating system?
pufixas 5 months ago
if it apeas and dissapperss put to equals for the codes
kow961 7 months ago
My console appears and disappears. It does not stay open :(!!!
TheDeLeG3nD 7 months ago
@TheDeLeG3nD Put at the end:
system("pause");
return = 0;
CPM1220 7 months ago
@TheDeLeG3nD Or whenever you want the game to pause
CPM1220 7 months ago
why the fuck you are using printf() for C++ tutorial?
pufixas 7 months ago
Printf(); ? Have you not heard of cout?
ILikePizza555 8 months ago
for people who are sad about the auto close problem in their hello-world programs you have to put system("PAUSE"); at the end of the program before return0 ( it only works on widows). Oh and this is a great tutorial i always come back to get info from it for more complex programs i build, hope minds edge makes more tutorials
spiceweasel09 8 months ago
@spiceweasel09 try _getch
HouseHoldAnimator 2 months ago
nice tutorial it is very good explained and i understand it well
JakobRobert00 8 months ago
why do you use printf() and not cout << ?
i always found cout << when i watched something about c++
i thought printf() was C
JakobRobert00 8 months ago
It auto closes (as the top comment says) on my as well :(:(
pudinthemushroomhead 8 months ago
....ok great vid but thats not c++
dont u use cout << "whatever u want to say here" << endl;
some thing like that...were does this printf come from
littlex6 8 months ago
Meh, many ways to do it. I use cout << :P
kong288 8 months ago
@littlex6 it and alternative choice you can use i use cout as well though
chillipepper117 8 months ago
hay instead of compiling it all the time you can also click build solution and it will just say if u have an error so u dont have to run the program every time
chillipepper117 8 months ago
: Commit Suicide
Commit Suicide with what?
>Commit Suicide with Polar bear!
Nightmare0987654321 9 months ago
use, cout << " ";
and #include "stdafx.h"
pufixas 10 months ago
SO. Say I dont have a program like that. If I made this is Notepad how would I go about testing to see if it worked? (Would the program Eclipse work?)
NAFeva 10 months ago
<3
LittleManLion 10 months ago
one thing happends when i press 1 and another thing happend when i press 2
brorlund 11 months ago
but if i want another "answer" for Choice number two, so there will be diffrent things that happends when i press 1 or 2???
brorlund 11 months ago
why is he using printf when you could use cout or std::cout? unless it's completely in C and not C++
DeXtrozeSoftware 11 months ago
use void to shorten up your code guys!
iryourdj 11 months ago
if it just opens and cloes, if you printf("whatever"); . Before return 0; put getchar();
themincraftkid 1 year ago
Comment removed
TheEpicBlasian 1 year ago
to compile = ctrl + f7
to run it = ctrl + f5
segath1 1 year ago
I has paused at 6:18
1PlayerD 1 year ago
how do u complile the instructions?
junior1984able 1 year ago
If you guys are having the problem were the program runs and then closes with out showing you the results simply type in Cin.get at the last part
infamousstuff 1 year ago
Will this work with Visual Studio C++ Express?
MrPointyTeeth 1 year ago
mafia-vendetta . com
Dezzle666 1 year ago
How do I make the program restart instead of ending?
WaddleJrJr 1 year ago
thankyou for this vid i defenently learnt somin. :D
GameNicNacs 1 year ago
Is it the game process when coding in Java? Cause right now im in java trying to make a text adventure game.
conker2020 1 year ago
@conker2020 Java and C++ is diffrent yet similar, similar due to some of the refrence keys and way you type stuff, but if your writing in java to make a text based game this isn't the tutorial ur really looking for
infamousstuff 1 year ago
@infamousstuff well this tutorial really helped alot i basically took what you had in C++ and applied it all to java
conker2020 1 year ago
@conker2020 Like i said its similar but diffrent in some aspects, and this isnt my video, i just can code better then this, i was looking for more advance way to make a game and this was not what i was looking for lol, but it helps out a bit
infamousstuff 1 year ago
I also had the problem with the command window closing as soon as I executed the program after compiling it, despite having no errors. However, I found that if you press CTRL+F5, it should run no problem :)
BaranoJosei 1 year ago
This helped a lot! :D
1PlayerD 1 year ago
@TheUnknown0924 no download it its free.
Flow7000 1 year ago
@TheUnknown0924 you would need a c++ compiler (google) but visual studio is free!
signofdevil666 1 year ago
@TheUnknown0924 lol you can get microsoft visual c++ express 100% free. just google it
iamjoseph951 1 year ago
im am using 2010 ver and when i try to open it it closes arffter 0.5 seconds what is happing? im use windows 7 plz help i have looked every where with no solution...
jamtheman1017 1 year ago
@TheUnknown0924 just download it. It's free.
themasturbator777 1 year ago
if only this was c#, that'd be amazing.
dbkdstryem 1 year ago
Is there a way to make different branches? Say, if a character tells someone they love you, or doesn't, can it still continue throughout the whole game, depending on what they chose?
Mouse979 1 year ago
when you debug or play this game all the writing will be their from the choice before so would cls work to clear line space?
Ashleywv3 1 year ago
Where's part two?
ArnisNewbie 1 year ago
Where's part 2?
ArnisNewbie 1 year ago
This has been flagged as spam show
Best online Text-Based games bit(.)ly/boVa9a register now...
zalFG 1 year ago
Best online Text-Based games bit(.)ly/boVa9a register now...
zalFG 1 year ago
Could you please make another Video explaining how to give the user choices and stuff.
TheScam117 1 year ago
I like it but it really doesn't explain how to do it...for example you just pasted in the intro..i have no idea how to add that stuff in or how to make my text box stay up.
TheScam117 1 year ago
@TheScam117 There's actually a different way a different way of doing this and possibly simpler if you haven't worked with c++ very much. I've been experimenting. PM me if u want a bit of a tutorial. You'll have to bear with me though, I'm still just learning myself lol
DigiParadise 1 year ago
Where's part 2? I subscribed to your channel so that I could finish my own game, but can't find part 2 of this video. Thanks.
ArnisNewbie 1 year ago
is this easy to make if have completely no knowledge about c++ ?
MangakaAndPivotMan 1 year ago
does it works on visual c++ too?
brasileirorusso 1 year ago
i tried printf( "hi" ); but it auto closes :(
ThatLPerGuy 1 year ago 21
@ThatLPerGuy That is because the console application has ended, so it closes. I do not know why the authors application pauses after it ends. He probably has that set somewhere in the Visual Studio IDE. You can do this manually by placing this just before the final return(0);
system("pause");
Or you could have it read for a keystroke by doing another scanf.
joeshmoe66 1 year ago
@joeshmoe66 well actually, i read somewhere about this problem and they said debugging it by using alt f5 or ctrl f5 (it's morning i cant remember) and it debugs it in a way and it didnt close. i think that's what the author did
ThatLPerGuy 1 year ago
@ThatLPerGuy Ok, makes sense. However, when you make the exe file and execute it, you will not get the benefit of that automatic pause. You will still probably want to program in some sort of pause.
joeshmoe66 1 year ago
@ThatLPerGuy mine does that too...
brasileirorusso 1 year ago
@ThatLPerGuy Type:
system ("PAUSE");
after the printf.
pokemonmegaman 1 year ago
@ThatLPerGuy I think he made a mistake. Cout >> "" outputs text. The command printf is used in C. Hoped this helped. :)
ambi3nttech 1 year ago
@ThatLPerGuy
printf( "hi" );
return 0;
ImTheBatchMan 1 year ago
@ThatLPerGuy try to do cin.get
infamousstuff 1 year ago
@ThatLPerGuy At the end of the program try typing Cin.get instead of return 0; because that doesnt show the work and just closes, but after the if else then function then put the return 0; in respectful places
infamousstuff 1 year ago
@ThatLPerGuy XD put " getchar();" at the very end, 2 if you need to
hylianfreak 1 year ago
@ThatLPerGuy use this cin.clear();
cin.ignore(255, '\n');
cin.get();
SGTfrogmanxbox 10 months ago
@ThatLPerGuy That's not C++. To print "Hi" in C++ you need to do: cout << "hi" << endl;
SlateHayes 8 months ago
@ThatLPerGuy you have to put cin.get(); at the end so that the program waits for the user to press a key before quitting the program
JakobRobert00 8 months ago
@ThatLPerGuy IT runs. It just runs so fast, you cannot see it. Try adding System("pause");
to your program
EliteChurro 5 months ago
@ThatLPerGuy
Ctrl + F5
That should bring the window back up
skwylar 5 months ago
thanks man, this really made my knowlegde of C++ quadrouple :D
bigfanowarriors 1 year ago
wow cool tutorial
branden958 2 years ago
And whatever choice i make ends up with the text i wrote for the fourth choice... Annoying
biljetten63 2 years ago
Hi, can you paste in the code snippet that is giving you trouble? I will look at it.
MindsEdge2006 2 years ago
This has been flagged as spam show
Hi, I've solved the problem now :) Thanks anyway, though :) Great video!
biljetten63 2 years ago
My program stops as soon as i choose what to do... How do I make it continue?
biljetten63 2 years ago
Comment removed
biljetten63 2 years ago
Thank you so much,
best tutorial out there!
pppmw 2 years ago 3
Thanks for the kinds words!
MindsEdge2006 2 years ago
@MindsEdge2006 You'r awesome thank you :D
Psychonik3 11 months ago