VOGONS

Common searches


First post, by JasonWanderer

User metadata
Rank Newbie
Rank
Newbie

Good evening (or morning/afternoon depending).

Recently, thanks to being on a nostalgia kick, I've been trying to get together a text-adventure game, created using BATCH, that would be compatible with DOSBOX.

My problem at the moment is that DOSBOX won't accept the "Set /p" command. In order to remedy this, I sought out the Strings 2.5 utility for MS-DOS, but I'm a bit confused on how to proceed.

I launched STRINGS in DOSBOX and typed in the install command, but I'm unsure if anything happended.

How exactly should I go about this process and what exactly needs to be done in order to convert my "Set /p" commands to "STRINGS"?

Do I just trust that everything installed correctly and simply replace my set commands with strings? Is there anything special I need to do in order to install a utility for DosBox?

Additionally, if I were to give this to someone would they need STRINGS 2.5 installed as well in ther version of DosBox?

Lastly, considering we're in 2016, is there an alternative to using STRINGS in order to make a BATCH file with variable input compatible with DosBox?

Thank you in advance,

~ Jason

Reply 1 of 11, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

I don't even know what "STRINGS" is supposed to do.

If you need DOSBox to act more like the original MS-DOS COMMAND.COM, then using 4DOS is usually a good idea. Just start 4DOS.COM and away you go.

Of course, if you want to write text adventures, I hear Inform 7 is fantastic.

Reply 2 of 11, by JasonWanderer

User metadata
Rank Newbie
Rank
Newbie

Honestly, I'm not even sure myself. I was reading up on it and, apparently, it was made as a way of inputting an old BATCH command into DOS (which doesn't really make much sense).

In respect to using 4DOS: Will other uses who launch my file need it as well?

Inform 7 is great, but nothing beats that DOSBOX feeling!

EDIT: Wow, I'm bad at this.

So just extract the 4DOS files and navigate to the executable in DOSBOX?

Reply 5 of 11, by Roger Wilco

User metadata
Rank Newbie
Rank
Newbie

Hello Jason!

I am having a project with lots of Batch stuff going on as well (i continued now after a couple of months),
and I got told by QBix iirc, that set /p didnt work in the old DOS, it came later with some Windows Version.
I guess, thats why it is not supported in Dosbox.

So I tried many other little helpers like ASET, XSET, VARSET and so on (I guess your program STRINGS
is something similar). After A LOT of trying around, I found out some "funny" behaviour in the Dosbox
Shell, concerning Variables, so I switched to 4DOS (and FreeDos) and it worked with both. FreeDos is much faster
with Batch files.

(I ASSUME its "funny", honestly its 25 years ago that I did things like that and I had to learn a lot from scratch).

So you would have to take 4DOS or FREEDOS into your game, run the command.com at start and then go...

edit: the helpers I mentioned are single executable files, you do not need to install anything, just
put the files into your game folder with the .bats and they work. Makes passing the game on to others a lot easier
(if i understood you right, that you would have to install the strings 2.5 program)

edit2: I just checked the programs I tried and strings 2.5 is one of them! You dont need to install it somehow,
just copy it with the game and it works in every DosBox with FD or 4D shell going on.

edit3: just double checked, STRINGS works in normal Dosbox shell as well!

edit4: i tripple checked, and the difference (DB/4D) is as follows: if you start your game directly out of the shell,
it works with the dosbox command.com. But you cannot do things like "setlocal", so the VARS are there
and stay there. BUT if you start your game via a menu, or norton commander, the vars are passed to the top level
shell, not to the actual one. That means, they are basically not there - they appear, when you close the menu
/ norton commander. With 4DOS and FreeDos started at the beginning, this works normally.
Another difference is, that you can't call BAT files in other BAT files, it stops after the first one with dosbox command.com.

A problem might be, that you cant just start FreeDos at the beginning of your batch file, because the batch
stops, after the command.com is loaded.

cheers

Reply 6 of 11, by Roger Wilco

User metadata
Rank Newbie
Rank
Newbie
Roger Wilco wrote:
edit4: i tripple checked, and the difference (DB/4D) is as follows: if you start your game directly out of the shell, it works w […]
Show full quote

edit4: i tripple checked, and the difference (DB/4D) is as follows: if you start your game directly out of the shell,
it works with the dosbox command.com. [...]
BUT if you start your game via a menu, or norton commander, the vars are passed to the top level
shell, not to the actual one. That means, they are basically not there - but they appear, when you close the menu
/ norton commander. With 4DOS and FreeDos started at the beginning, this works normally.
[...]

cheers

Does anyone have an idea, why this is the case? A point into the right direction would be really kind, I still have to learn
a lot and don't even know, where I should start to search.

thanks

Reply 8 of 11, by Roger Wilco

User metadata
Rank Newbie
Rank
Newbie

Hey Jorpho!

I came across this, because I set up an old school DOS gaming machine for me and my friends, and it is
Menu based, like it used to be in the old days. For the feeling and for easy access.
Everything works very fine, except for launching batch files.
I am just wondering, if this is something, I can fix (without using 4DOS),
or if the architecture of DosBox basically doesn't allow it for some reason.

I wrote this in this thread, because I thought maybe more people are doing it like
this and I guess Jason wants his game to be compatible with different situations.

edit: or I have to make the menu compatible, if possible, but as I mentioned above,
I am missing some basic information...seems like.

edit2: I am trying to achive this on a Linux machine, that boots up straight into
Dosbox Fullscreen, just like a real Dos PC would look. I stopped doing it on
a real Dos PC, because of the problems with memory managers...it basically
should be super easy accessable for everyone that switches it on.

edit3: sorry for off topic

Reply 9 of 11, by zirkoni

User metadata
Rank Member
Rank
Member

Why do you need to use the set /p command anyway? You could use choice and errorlevels instead, it works in DOSBox:

echo 1. Option1
echo 2. Option2
choice /c12
if errorlevel 2 goto option2
if errorlevel 1 goto option1

:option1
...

Choice doesn't support strings but if your menu doesn't have a lot of different options then 0-9 and A-Z might be enough. And you can always make submenus if you run out of characters.

https://youtube.com/@zirkoni42

Reply 10 of 11, by Roger Wilco

User metadata
Rank Newbie
Rank
Newbie

I don't know the exact reason, why the thread starter needs it, but for my project, where I am using the
Strings 2.5 as well, I am trying the following:

- Run a game out of a menu (works in 90% of the cases)
- If the game needs a different setting, I am saving the current setting first:

config -get "cpu cycles">c:\example\cycles.dat

- then change the setting for the game via config -set

And here comes the point:
When the game finishes, I'd like to set Dosbox back to the usual setting.

- How it works with 4DOS/FreeDos:

strings var1= read c:\example\cycles.dat,1
config -set "cpu cycles" %var1%

(I am using .dat files for that, because I wrote batch files to store /restore a couple of
different Dosbox settings, like 5 different "slots" for all settings)

But started from the menu, in normal Dosbox shell, there are no variables, for a reason
I dont understand. And without menu, the whole thing doesnt make much sense 😀

I tested this a lot with FreeDos/4DOS, about 70% of the settings can be adjusted very well, but it freezes when I change
EMS or XMS settings. Thats a bit of a drawback, as some games require these settings to be changed, and
so I try to make it work in normal Dosbox shell (no freezes there)...its kind of an adventure, but if that works some day, its just great.
I would love to get this done without too many changes to Dosbox, so I can pass it on to friends without
being too complicated for them (me, so to speak).

Maybe an impossible task. But let's see.

edit: and thanks for your posting about choice, I can make use of it 😀

Reply 11 of 11, by Roger Wilco

User metadata
Rank Newbie
Rank
Newbie

Just found the solution for that. Nothing is impossible.

I let the menu load in Dosbox shell, and from the menu, if I need variables,
I load the batches via C:\freedos\command /c test.bat

That was too easy.
Dosbox rulez 😀