|
|
|
|
|
August 15th, 2006, 01:06 PM
|
|
Second Lieutenant
|
|
Join Date: Mar 2005
Location: Seattle, WA
Posts: 417
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Stupid c++
|
August 15th, 2006, 06:14 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
|
|
Re: OT: Stupid c++
Fyron: I read that page, but when I tried it, it didn't seem to work. Thanks, I'll check out that compiler.
AngleWyrm: Thanks, but as I said when I edited the message, I figured it out.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
|
August 15th, 2006, 08:45 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
|
|
Re: OT: Stupid c++
If anyone wants to see where I am, the aptly named Simple Roguelike. Just drop it in a folder and run. Right now it's *very* simple, but as far as I know, everything works.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
|
August 15th, 2006, 10:26 PM
|
|
Second Lieutenant
|
|
Join Date: Mar 2005
Location: Seattle, WA
Posts: 417
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Stupid c++
Nice! I especially like the light radius effect, and field of view.
Found a link for the source code for NetHack v3.42; could have some interesting ways to do stuff in it.
|
August 15th, 2006, 10:36 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
|
|
Re: OT: Stupid c++
Thanks. The currently linked version is my second upload; it has one type of trap. Previous savegames won't work, either.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
|
August 15th, 2006, 11:36 PM
|
|
National Security Advisor
|
|
Join Date: Dec 1999
Posts: 8,806
Thanks: 54
Thanked 33 Times in 31 Posts
|
|
Re: OT: Stupid c++
Nice job!
|
August 16th, 2006, 01:07 AM
|
|
Shrapnel Fanatic
|
|
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
|
|
Re: OT: Stupid c++
Thanks.
Somehow, my pointer item vector is getting messed up between its setup and the function to display it.
The thing is, those are the only two points which have anything to do with items at all.
How is this modifying a vector?!?!
Quote:
void text ( std:ring tstring, int x, int y, short int Colour ) {
COORD Position; Position.X = x; Position.Y = y;
SetConsoleTextAttribute( hOut, Colour );
SetConsoleCursorPosition( hOut, Position );
std::cout << tstring;
};
|
Apparently, inputting too large of a block of characters (Between twenty and thirty) somehow affects the vector. Help, anyone?
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
|
August 16th, 2006, 02:09 AM
|
|
Shrapnel Fanatic
|
|
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
|
|
Re: OT: Stupid c++
Can anybody see a problem with this:
Quote:
void setupItems () {
srand ( time(NULL) );
// NewWeapon.initialize (); NewPotion.initialize ();
// WeaponList.push_back ( NewWeapon ); PotionList.push_back ( NewPotion );
for ( t = 0; t < 40; ++t ) {
t2 = rand () % 2;
if ( t2 = 0 ) {
NewWeapon.initialize (); WeaponList.push_back ( NewWeapon );
WeaponList[WeaponList.size () - 1].initialize ();
ItemList.push_back ( &WeaponList [WeaponList.size () - 1] );
};
if ( t2 = 1 ) {
NewPotion.initialize (); PotionList.push_back ( NewPotion );
PotionList[PotionList.size () - 1].initialize ();
ItemList.push_back ( &PotionList [PotionList.size () - 1] );
};
};
for ( t = 0; t < ItemList.size (); ++t ) {
ItemList[t]->initialize ();
std::cout << t << " " << ItemList [t]->XPos << " " << ItemList [t]->YPos << " " << ItemList[t]->Colour << " ";
};
std::cin >> wait;
};
|
It doesn't seem to work right - It seems like all the slots still reference as the base Item class.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
|
August 16th, 2006, 04:00 AM
|
|
Second Lieutenant
|
|
Join Date: Mar 2005
Location: Seattle, WA
Posts: 417
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: OT: Stupid c++
Bug: if(t2 = 0) // assign zero to t2, return true (successful assignment)
You probably meant: if(t2==0) // test for equality
Happens so often that some compilers even have a warning for it.
|
August 16th, 2006, 04:18 AM
|
|
Shrapnel Fanatic
|
|
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
|
|
Re: OT: Stupid c++
Thanks. We're whacking it into shape on IRC.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|