Toribash
Pretty close, it's #include "file.c"

That will include the file in the same directory with the name file.c. You use <file> if it's a standard library in your class path.

There's a lot of other stuff like header files and make files, but I wouldn't bother learning that kind of stuff until later on when you have a lot of source files :P
<Faint> the rules have been stated quite clearly 3 times now from high staff
I see xP

Got any idea how I should go about switching the maps? I can probably switch maps, but I'm just worrying about the whole translating the player position.

One idea I have is simply added a * to the map like I did with the first one, and when I have walked onto the stairs x = spawn position y = spawn position.
So whatever the x and y coords for the stair case in that place would be I guess, but the problem with that is it makes it so I can't reuse the stair case :L
You can reuse it, just detect when a player MOVES ONTO the stairs. map[next_y][next_x] will be * until the player moves away right? And then they move away the * will be replaced with the stair marker, so all you have to do is wait for map[next_y][next_x] == stairs.
<Faint> the rules have been stated quite clearly 3 times now from high staff
I see, I'm getting fed up.
Not with you of course.
But this dilemma. Same problem as before, it can't convert char[20][40] to char(*)[80] and I've no clue as how to make them compatible.. ffs :/
-----
My sad attempt to fix it, ended up getting an incompatible error again.
Seriously getting ready to give up.

Code

Last edited by souldevilj; Feb 16, 2014 at 05:04 AM. Reason: <24 hour edit/bump
Oh, I see why :P

On line 77 you can't do
case '!': // Stairs
currentMap = map2;
currentHeight = map2height;

You can't do that assignment because they are different types, you need to call loadmap2()!

On line 156 is similar, you need to call loadmap2(). Those functions will copy the data from map1 or map2 across to the current map, so you don't need to use direct assignments.


Sorry I think I explained it badly
<Faint> the rules have been stated quite clearly 3 times now from high staff
I understand exactly what you mean! :')
However I don't understand why the computer itself won't allow direct assignments to grab the data from the map2 things and place them into the currentMap variables :o

Ah well, back to fixing
Seems I've actually gotten a cramp in my right hand from all this coding I've been staying up doing xD
-----
I corrected it but I got the same error followed by a new error, functions cannot call other functions?

Errors are fun



Was guessing that was the case, seems the order you have your functions in matter a lot :o

Ah well, onto the next error! just this one I cannot fix myself >.<

:c



Again :c
Last edited by souldevilj; Feb 16, 2014 at 09:59 PM. Reason: <24 hour edit/bump
Direct assignment is not possible (in c) because arrays are staticly typed, so char[1] is a different type to char[2]. In other languages it's possible, different languages are different. It's just how they decided to make c.

Yeah the compiler goes top down, so always put functions ahead of the function that calls them. Alternately you can use something called 'function prototyping', it sounds fancy but it's pretty simple; http://en.wikipedia.org/wiki/Function_prototype
Now you are getting to the stage that maybe you will need to learn about header files :P
http://en.wikipedia.org/wiki/Header_file

That error is because you have "currentMap = map1;", which is invalid because they are different types. Just remove that line since you are already calling loadmap1, so map1 will be loaded in to currentmap anyway.
<Faint> the rules have been stated quite clearly 3 times now from high staff
Thanks! I seriously appreciate every response you give me, I'm trying to absorb all of your knowledge like a sponge ^^

Something super awesome happened, and by super awesome I mean it's bad but at least there are no more errors.
It looks like it's just displaying my map now in a singular vertical line xD

I'm going to look into this function prototyping and header files and see if I can get the basis of those down :')

Thanks again, I really really appreciate it :')
I see why that error exists :P

It's from this function
c code:
void displayMap()
{
for(int a=0; a<currentHeight; a++)
for(int b=0; b<currentWidth; b++)
cout << currentMap[a][b] << endl;

}


Try spot it, here is solution :P

<Faint> the rules have been stated quite clearly 3 times now from high staff
Argh how did I not see that!?

I stuck it on the end of that line because I thought since it was still inside the loop it wouldn't matter as much. Then when I read it now it makes so much sense.
Gah, I'm going to fix this as soon as I'm done with my studies :')

Thanks a lot
Maybe I'll actually get onto making the "game" soon XD
-----
I'm not too bothered by it, but now I've got it up and running.
Whenever I move the whole screen flickers to load the next map and you can only walk at a slower speed instead of it being fast and loading so fast it doesn't really 'flicker'
Oh well- guess much can't be done about that when I'm trying to make a game in the cmd module.

Guess I just gotta fix this 2nd map now

edit: I'm going to try fix it myself, but when I load the 2nd map in via just changing the starting map it looks like this and movement doesn't work properly :'P

If I load the map by using the stairs then same affect minus the ability to move at all xP

But since there is no difference in the code, my guess is it's the way it's trying to change the width and height, it isn't doing it correctly :L yet again.. maybe it is and it's something else since it still has this deformed look when I load it from the start. I'll let you know how it goes xP
Last edited by souldevilj; Feb 17, 2014 at 02:19 PM. Reason: <24 hour edit/bump