123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|445|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Blitz 2D and 3D Printing

Sun, 22 Aug 2010, 08:09
BGDDisco
My latest game has a lot of rules, and I thought it would be a nice idea to write a txt file in notepad for players to print out so they could read them while playing. Then I thought it would be nice if the intro to the game offered a 'Print Rules' option.
I remember trying to use the BlitzPrinter DLL years ago, with limited success.
The guy who wrote it no longer has the code and has no intentions of reviving it.

Would it be possible to print out a hardcopy using ExecFile(notepad.exe /p MyGameRules.txt)?
I have tried a few experiments with no success, although Notepad did open. Nothing printed however.
I am aware too that Notepad.exe is located in different places depending on what OS you use, so wrote a function that checks for Window_NT before trying to ExecFile.
I wondered if the text file had to be in the same directory as Notepad.exe and tried copying the file there using Blitz's CopyFile command, no go there either.

Any Ideas?

-=-=-
God gave Man a brain...and a penis...but only enough blood to run one at a time!
Sun, 22 Aug 2010, 09:37
Jayenkai
You could always hunt for a small "print the file" exe online somewhere.. There's bound to be something, right?!

Or otherwise, make a nice "rules.pdf" and shove it in the root folder of the game. Folk'll read it if they need to. .. probably... maybe...
...
?

-=-=-
''Load, Next List!''
Sun, 22 Aug 2010, 10:06
CodersRule
In Blitz3D, you can write SystemProperty("windowsdir") to get the /WINDOWS/ or /Windows/ dir, then get notepad.exe from there.

I know that it's possible to print text using Visual Basic, and it's really easy. You could try to create an app to print a file.

Sun, 22 Aug 2010, 10:23
JL235
You should also be able to print from VBScript, and Windows comes bundles with a VBScript interpreter. So you can just call and run the script from your B3D app.
Sun, 22 Aug 2010, 13:53
BGDDisco
Had a look for other exe files that just send direct to printer, but not finding much that's free.
Not got any experience with VBScript, did have a look at it long long ago, but didn't look for long. I'm an old-school 8-bit guy, who's games rarely even use the mouse.
Thanks for the advice though, I'm sure I'll figure something out - even if it is just a footnote on the intro page advising them to print out the rules.

-=-=-
God gave Man a brain...and a penis...but only enough blood to run one at a time!
Sun, 22 Aug 2010, 18:00
bram32
Have you tried using OpenFile("lpt1:")?
Sun, 22 Aug 2010, 21:24
Stealth
I would be really annoyed if a game tried to activate my printer and print something. Why not just include in game tips?

-=-=-
Quit posting and try Google.
Sun, 22 Aug 2010, 21:32
JL235
It's quite unconventional, but for the right game I could see this as a really cool idea (note only for the right type of game IMHO). It kinda reminds me of how old school games used to have massive manuals and tonnes of extra bits of paper. I miss those.

Just make sure it's got a "are you sure" included after people hit print (to avoid accidents) and try and state how many pages it'll print!
Mon, 23 Aug 2010, 03:36
Afr0
It kinda reminds me of how old school games used to have massive manuals and tonnes of extra bits of paper. I miss those.


For once I agree with you. I remember the original 'The Sims' came with a 300 page manual. Those were the days!

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Mon, 23 Aug 2010, 06:48
BGDDisco
Yea, no worries guys, I was only looking at about 2 pages of raw text. Mostly just a list of game controls, rather than rules.
Reminiscing a bit myself - who remembers the ZX Flight Simulator? With almost every rubber/membrane key on the board used to fly the plane.

-=-=-
God gave Man a brain...and a penis...but only enough blood to run one at a time!
Mon, 23 Aug 2010, 09:07
Jayenkai
Ah, the good old days....


-=-=-
''Load, Next List!''
Wed, 25 Aug 2010, 08:36
Andy_A
Why not make the instructions in the form of an HTML file? Even if you don't know HTML you can type up the instructions in Word or Open Office doc and save as a web page.

Then the user just clicks on the help button/menu item and your program opens up the HTML in the person's browser. Once the HTML is opened the user can use the browser's "Print Preview" to see how many pages will be printed and also allow them to print "selected pages" (e.g. pages 2,4,7...).
Tue, 31 Aug 2010, 09:39
Teasy

Blitz: ExecFile, or UserLib.decl
Blitz: " = Chr(34)

List of key Windows locations (if needed):
- %windir%
- %windir%\System
- %windir%\System32
Blitz: GetEnv("windir")

Background information:
- Print files from batch files
- RunDLL
- Legacy OS check
- ClassExec