PDA

View Full Version : New text adventure



catventure
08-05-2020, 11:28
Hello,

"Even The Devil Must Die" by Mark Hancox (c)2003 Interactive fiction retrogame is ready for playtesting.

This is an offline, parser-based text adventure and runs on Windows XP and above. (English language)
2020 Conversion with "Thinbasic Adventure Builder" by catventure May 2020.

ITo check out and try or playtest here is a download link: http://tab.thinbasic.com/etdmd_test.zip (7mb - includes 3 music mp3's)

**Special Note: When starting the program(s) it's possible that some virus checkers may produce a "false-positive" warning. You may need to tell your antivirus software to create an 'exception' for the game app(s) in order to allow it to run**

Happy Isolation and lockdown,
catventure.

10213

catventure
10-05-2020, 11:19
Posted minor update today:
To check out and try or playtest here is a download link: http://tab.thinbasic.com/etdmd_test.zip (7mb - includes 3 music mp3's)

Regards,
catventure.

matthew
11-05-2020, 23:54
Nice game, I played it for about 10 minutes tonight. The music adds a lot of atmosphere to the game, I see it was created by Eric Matyas. I'd listened to some of his music before, he used to post on another forum I used to use.

catventure
12-05-2020, 20:08
Hi Matthew,
Thanks for taking the time to try it out.

Regards,
catventure.

Petr Schreiber
15-05-2020, 07:21
Hi Phil,

I promoted this on thinBasic facebook page:
https://www.facebook.com/groups/thinbasic

Very moody, thank you!


Petr

catventure
17-06-2020, 12:52
Please can someone check this small graphic demo adventure game to see if it runs on their Windows system Ok and if the game gfx load and are sized in the graphicboxes properly (centered).
I need to know if the graphics show up as in the below image and if the short video appears in the middle graphicbox when you have typed your first input command into the lower textbox eg: type in "east" (without quotes)
You can exit the video with the <ESC> key or just wait for it to end.


Thanks a lot.
catventure.
Link to demo: http://tab.thinbasic.com/Gfx_Adv_Demo.zip


**Special Note: When starting the program(s) it's possible that some virus checkers may produce a "false-positive" warning. You may need to tell your antivirus software to create an 'exception' for the game app(s) in order to allow it to run**

10219

DirectuX
17-06-2020, 16:07
Hi Catventure!

centre picture is deformed when resizing the window.
centre picture is truncated at right side when video is playing ( text not fully shown ).
window behaves modal and I feel it very annoying.

voilą

catventure
17-06-2020, 22:00
Thanks DirectuX,

Although the video works OK on Windows Vista, my tester has reported same thing. I think it to do with the placement code for the movie I used...
I used the mcivideo.INC file by Michael Hartlef which uses the winmm.dll and I think have my width and height parameters wrong somehow as the movie should be positioned centrally on the graphicbox canvas.
I used the code:

PlaceMovie( 0, 0, twidth*2, theight*2 )

to position the movie, but although works on Vista fine, don't think the co-ordinates right to centrally position movie and size it to fit in the box correctly.
Been really bugging me a while - Maybe Michael can help fathom it or put me on right track?
I am hobby coder not pro.

Regards,
catventure.

DirectuX
17-06-2020, 22:09
I think have my width and height parameters wrong somehow as the movie should be positioned centrally on the graphicbox canvas.
I used the code:

PlaceMovie( 0, 0, twidth*2, theight*2 )

to position the movie, but although works on Vista fine, don't think the co-ordinates right to centrally position movie and size it to fit in the box correctly.
Been really bugging me a while

Difficult if you haven't the right environment to test.
Maybe an idea : downsize the video placement for start then gradually increase up to good then display parameters values then includes them into code.
Have you a definition for twidth or theight ? Is it window-based placement or something ?

Edit: I've just looked at your video file : it isn't square but you try to display it in a square place. Maybe it comes from that, the video if height fitted rather than width fitted in your display. Try a square video or try setting fit-width or try setting square ratio or allow more room for video (320x240)

catventure
18-06-2020, 13:43
Hi,


On Vista I can play different size vids in my program and youtube vids for instance as long as they converted in .wmv format for the mcivideo.INC commands to work.
And they are positioned and sized correctly by my below bits of code.


Here is the part of the code that loads and plays the videos that I made:




'Plays movie in listview control
'========================
'========================


IF INSTR( checkact, "playmovie2" ) = 1 AND displaymode = 2 THEN
Local filename As String
filename = APP_SourcePath + gfxfolder + Mid$( checkact, 11 )
IF FILE_EXISTS( filename ) = %FALSE THEN
MSGBOX hwnd, filename + " does not exist.", %MB_ICONERROR OR %MB_OK, "TAB Warning"
EXIT FUNCTION
ELSE

Local hCanvas As Long

Control Handle hwnd, %id_listview2 To hCanvas

Local twidth, theight As Long




Dialog Get Size hcanvas To twidth, theight

MENU SET STATE hpopup1, BYCMD %ID_OPEN, %MF_DISABLED OR %mf_grayed
MENU SET STATE hpopup1, BYCMD %ID_NEWGAME, %MF_DISABLED OR %mf_grayed
MENU SET STATE hpopup1, BYCMD %ID_SAVEGAME, %MF_DISABLED OR %mf_grayed
MENU SET STATE hpopup1, BYCMD %ID_LOADGAME, %MF_DISABLED OR %mf_grayed
MENU SET STATE hpopup1, BYCMD %transcript, %MF_DISABLED OR %mf_grayed
MENU Set State hpopup1, ByCMD %transcriptoff,%MF_DISABLED Or %MF_GRAYED
MENU Set State hpopup1, ByCMD %id_exitgame, %MF_DISABLED Or %MF_GRAYED


OpenMovie( hCanvas, filename )
PlayMovie( )
PlaceMovie( 0, 0, twidth*2, theight*2 )

movieon = 1
Dialog Disable hwnd

Do
Control Set Focus hwnd,%id_richedit4
IF GETWINDOWKEYSTATE( hwnd, %vk_escape ) THEN
videoescapekey
EXIT DO
END IF
If IsMoviePlaying( ) = %FALSE And movieon > 0 Then
videoescapekey




END IF
LOOP UNTIL movieon = 0
EXIT FUNCTION
END IF
END IF
'==========================



Following alternative code also will work fine on my system:




' Tried using label control INSTEAD and also with label control on top of listview control as below




'Plays movie in LABEL control overlaid over listbox control
'==============================================
'===============================================




IF INSTR( checkact, "playmovie2" ) = 1 AND displaymode = 2 THEN
Local filename As String
filename = APP_SourcePath + gfxfolder + Mid$( checkact, 11 )
IF FILE_EXISTS( filename ) = %FALSE THEN
MSGBOX hwnd, filename + " does not exist.", %MB_ICONERROR OR %MB_OK, "TAB Warning"
EXIT FUNCTION
ELSE

Local hCanvas As Long


Control Handle hwnd, %id_listview2 To hCanvas

Local twidth, theight, xloc, yloc As Long

Dialog Get Size hcanvas To twidth, theight

Dialog Get Loc hcanvas To xloc, yloc

Control Add Label, hwnd, %ID_textview, "", xloc, yloc, twidth, theight, %SS_BITMAP
'
Control Handle hwnd, %id_textview To hCanvas

MENU SET STATE hpopup1, BYCMD %ID_OPEN, %MF_DISABLED OR %mf_grayed
MENU SET STATE hpopup1, BYCMD %ID_NEWGAME, %MF_DISABLED OR %mf_grayed
MENU SET STATE hpopup1, BYCMD %ID_SAVEGAME, %MF_DISABLED OR %mf_grayed
MENU SET STATE hpopup1, BYCMD %ID_LOADGAME, %MF_DISABLED OR %mf_grayed
MENU SET STATE hpopup1, BYCMD %transcript, %MF_DISABLED OR %mf_grayed
MENU Set State hpopup1, ByCMD %transcriptoff,%MF_DISABLED Or %MF_GRAYED
MENU Set State hpopup1, ByCMD %id_exitgame, %MF_DISABLED Or %MF_GRAYED


OpenMovie( hCanvas, filename )
PlayMovie( )
PlaceMovie( 0, 0, twidth*2, theight*2 )

movieon = 1

Dialog Disable hwnd
CONTROL DISABLE hwnd, %id_textbox2
DO
IF GETWINDOWKEYSTATE( hwnd, %vk_escape ) THEN
videoescapekey
EXIT DO
END IF
IF IsMoviePlaying( ) = %false AND movieon > 0 THEN
closemovie( )
movieon = 0
dialog enable hwnd
MENU SET STATE hpopup1, BYCMD %ID_OPEN, %MF_ENABLED
MENU SET STATE hpopup1, BYCMD %ID_NEWGAME, %MF_ENABLED
MENU SET STATE hpopup1, BYCMD %ID_SAVEGAME, %MF_ENABLED
MENU SET STATE hpopup1, BYCMD %ID_LOADGAME, %MF_ENABLED
MENU SET STATE hpopup1, BYCMD %transcript, %MF_ENABLED
MENU Set State hpopup1, ByCMD %transcriptoff, %MF_ENABLED
MENU Set State hpopup1, ByCMD %id_exitgame, %MF_ENABLED
CONTROL KILL hwnd, %id_textview
CONTROL ENABLE hwnd, %id_textbox2
GETWINDOWKEYSTATE( hwnd, - 1 )
CONTROL SET TEXT hwnd, %id_textbox2, ""
CONTROL SET FOCUS hwnd, %id_textbox2
END IF
LOOP UNTIL movieon = 0
EXIT FUNCTION
END IF
END IF
'==========================



For some reason that I can't figure this code is not displaying the video in the centre box at the correct size in the demo I posted for some people!!
I messaged Michael Hartlef from twitter to see if could help throw some light on it.
There is something I am not understanding correctly probably.

Here is picture of video running perfectly in lower box on mine:
10220


Regards,
catventure.

catventure
18-06-2020, 17:05
Here is example showing a video playing of "The Hobbit" text adventure game solution in TAB.
It's autoresized to fit in the lower graphicbox using code above.
https://www.youtube.com/watch?v=-CtvpkOoBQM

Regards,
catventure.

Petr Schreiber
18-06-2020, 21:08
Hi Phil,

is this text game inside text game? Or is it video, what is played? :eek:


Petr

catventure
18-06-2020, 21:39
Hi Petr - LOL! Yes it is a youtube video playing only. I converted it to a .wmv format and put in the graphics directory. :)

But I wanted to show that my code I listed from the previous reply works on Windows Vista - but for some reason the videos don't size properly on other windows! I don't know why. I know you had a hand in updating the mcivideo.INC some time ago. Have you any idea yourself? Thanks.
Can you cast an eye over the code I posted and detect if I did something wrong when calling the video routines for placing and sizing the video?

catventure (Phil)

****My thought now is that of course it requires the "winmm.dll" to be present in the users system32 folder! If is not there well the include file cannot access. Petr, would the mcivideo.INC still in fact work on windows 7 or 10?
I want my program to work on all windows from XP onwards that why I am still using older version of thinbasic to keep compatibility with XP.

catventure
21-06-2020, 17:47
Today, I updated the gfx demo. This time showing the vertical graphicboxes.
Video will play after the first input command is entered in the lower input textbox. eg: "look" (without quotes)


If anyone wants to try here it is at same link:
http://tab.thinbasic.com/Gfx_Adv_Demo.zip


**Special Note: When starting the program(s) it's possible that some virus checkers may produce a "false-positive" warning. You may need to tell your antivirus software to create an 'exception' for the game app(s) in order to allow it to run**


Please let me know if the picture displays Ok and if the video plays and is positioned and sized correctly in the lower graphicbox and what system you are running it on. Thanks again for your cooperation..


Regards,
catventure

DirectuX
21-06-2020, 18:25
Hi Catventure !

10222


The video is still cropped.
The window is still modal.
I can't take a screenshot while video is playing.

catventure
22-06-2020, 11:52
Hi directuX,

Thanks for your report about the video not positioned/sized correctly - much appreciated!

First thing I notice is that the image in the lower graphicbox is not showing correctly - so I investigate that today.

Yes - I did a dialog disable to stop player using mouse on window or moving window or accessing menues while a video is playing which might have cause display problems... After it stops either by video ending or user pressing <ESC> key then the Dialog Window is enabled again to await player input.
Thank you for testing - It seems the titlebar text is displayed centrally on your 'theme' while on mine it is left aligned.

Regards,
catventure.

DirectuX
22-06-2020, 16:15
Yes - I did a dialog disable to stop player using mouse on window or moving window or accessing menues while a video is playing which might have cause display problems...

I can understand your window becoming non-interactive. I feel it bad being trapped. Can't you disable T.A.B. interactiveness only; leaving Alt-TAB possible ?

catventure
22-06-2020, 17:39
I changed the listview setbackimage in my program from

ListView_SetBkImage hwnd, %ID_LISTVIEW1, szfile, %LVBKIF_SOURCE_URL, 50, 50

to

ListView_SetBkImage hwnd, %ID_LISTVIEW1, szfile, %LVBKIF_SOURCE_URL, 0, 0

so it now places images using X, Y values of 0,0 (top left co-ords of the control)

That might make a difference...

In regard to the video placement, I realise that my dialog is created with dialog units and not pixels. That is why I had to double the twidth and theight vars to get it to show right on mine eg:

OpenMovie( hCanvas, filename )
PlayMovie( )
PlaceMovie( 0, 0, twidth*2, theight*2 )
movieon = 1
Dialog Disable hwnd

so it might be something to do with that. On other systems with different display/resolution it might cause the anomaly.
Is there a way to find out the pixel equivalent of the dialog units for a listview control, I wonder?

catventure.

catventure
23-06-2020, 16:02
Made another test demo to try

http://tab.thinbasic.com/Gfx_Adv_Demo.zip

As before can someone please check the images appear Ok in both graphicboxes and also that the Video plays and is sized and placed properly in lower graphicbox after 1 turn of the game.

Thank you for your cooperation.

caventure.

@directuX - left the Dialog Window enabled in this one. Hope it helps. :)

10224

- shows video playing in lower box OK...

The author of the mciVideo.INC, Michael Hartlef, messsaged me to say he is happy the routines work on Win 10 and suspects the position/size problem is due to not having the right metrics for the height and width variables of the listview control for the "placemovie" function.

catventure
27-06-2020, 08:26
After the recent coding changes I made my tester reports that graphics are now displaying properly in the last "Gfx_Adv_Demo" update. That is good.
Still remains the problem of finding the correct formula for sizing/placing the video into the listview control with the "PlaceMovie" function of the mciVideo.INC routine by Michael and Petr.

PlaceMovie( 0, 0, twidth*2, theight*2 )

This seems works fine on Vista - but not for other Windows!

Listview control is on a dialog units window. twidth and theight hold pixels values. 0,0 are x,y coords for top left of control.

User reports that videos display "too big" to fit into control and same if try to play the video over the the whole of the window too.

Will work more on finding solution and report back.

**updated demo to try: http://tab.thinbasic.com/Gfx_Adv_Demo.zip
Video resized to 300x266

catventure.

catventure
02-07-2020, 18:34
OK - Today, I updated the TAB gfx demo once again.

This time I converted the dialog window and its controls to PIXELS. This **SHOULD** solve the display problems that were happening when it was dialog units on different OS.

A short video should play in the centre graphicbox after the first input command is entered in the lower input textbox. eg: "look" (without quotes)


If anyone wants to try here it is at same link:
http://tab.thinbasic.com/Gfx_Adv_Demo.zip

Click on "Gfx_Adv_Demo.exe" and it should run. A small window will appear. Click "Start Adventure" button (or press RETURN) and the Main Game Window will appear with gfx and text along with some background music. Type stuff in the lower textbox

**Special Note: When starting the program(s) it's possible that some virus checkers may produce a "false-positive" warning. You may need to tell your antivirus software to create an 'exception' for the game app(s) in order to allow it to run**

There are no viruses in the TAB programs and I have scanned the files.

Please let me know if the 3 horizontal pictures displays Ok and if the video plays and is positioned and sized correctly in the middle graphicbox and what system you are running it on. Thanks again for your cooperation.

I really would appreciate if you could take a few minutes to test/try it if you can - as I need the feedback about this issue.

Should look like image below.

Regards,
catventure

10227

catventure
05-07-2020, 12:07
Success!

The change to coding the Player program to using dialog pixels instead of dialog units has worked.
The mciVideo routine does work after all - as Michael Hartlef reported to me
No problems with gfx or video now. It is solved.

My tester also reports it working correctly.
I am confident it will work on all windows from XP onwards.

Just wish I had coded it that way in the first place.

Thank you to anyone that tried or still wants to try the "Gfx_Adv_Demo" program.
I will leave the link working for a few more days in case anybody does.
I'm happy it is solved and can now move on... :)

Soon I will release the new versions of the TAB text/graphic adventure builder.

Kind regards,
catventure/Phil.