Bennu Game Development

English Forums => Helpdesk => Topic started by: MisterN on July 25, 2012, 06:29:16 AM

Title: After you chdir(), can you chdir() back?
Post by: MisterN on July 25, 2012, 06:29:16 AM
Its the only way I can load levels, so I am content with it. ALL I NEED is a way to chdir() back a directory and/or to another one. How might I do that because the wiki doesn't say anything, and doing the "c:/" thing wont work for what I have in mind. Thanks
Title: Re:After you chdir(), can you chdir() back?
Post by: Kloppix on July 25, 2012, 06:53:57 AM
In almost every operative system "cd .." will move you up one directory. In Bennu it's chdir("..")

For example if you are in /home/user1/myprogram/ and want to load a file in /home/user1/data it's

chdir("../data");


Title: Re:After you chdir(), can you chdir() back?
Post by: handsource-dyko on July 25, 2012, 01:26:42 PM
It's simply a matter of experimantation. How often do you use the dos prompt? For me it's obvious because of my old age! ;D I have no difficulties with dos or even a commodore 64. I remember the days before windows 95, and I had to use dos, so it's natural for me to know that stuff.  :D   
Title: Re:After you chdir(), can you chdir() back?
Post by: MisterN on July 25, 2012, 08:18:05 PM
Last time I used a dos prompt was to install the duke nukem trilogy on dos box lol
Title: Re:After you chdir(), can you chdir() back?
Post by: SplinterGU on July 26, 2012, 03:01:16 AM
string cd()

return current directory/folder

string cd(string new_dir)

change directory and return if operations was ok.
Title: Re:After you chdir(), can you chdir() back?
Post by: handsource-dyko on July 26, 2012, 12:58:58 PM
Quote from: DoctorN on July 25, 2012, 08:18:05 PM
Last time I used a dos prompt was to install the duke nukem trilogy on dos box lol

I know this is a bit off-topic, but did you have any difficulties with that? I have some experience with dosbox. Luckely you don't have to deal with config.sys and boot floppies. On real dos machines you'd had to make bootdisks for troublesome games. There's a very good launcher for dosbox called ampshell.  http://ampshell.tuxfamily.org/ (http://ampshell.tuxfamily.org/) With this you can create a unique configuration for each game. Very handy if you have a lot of different dos games using the most obscure hardware. So you can create a optimal config for every game.  Lethal weapon and Judge dredd are absolute pain to get working, even on a real dos machine. Some games are very picky or have weird bugs. Back in the day it was common that sound wouldn't work or that a particulair joystick was incompatible with a certain game. One thing microsoft did well with direct x was to standarise things and put an end to horrors of dos. It was both horrendous for gamers and developers because they had to reinvent the wheel everytime. Ohh... nostalgia. :)
Title: Re:After you chdir(), can you chdir() back?
Post by: MisterN on July 26, 2012, 06:26:41 PM
I mounted it and installed it. It took awhile just to mount and install it, but now I just have to drag and drop the .exe files onto dosbox.exe