PDA

View Full Version : TAB Alpha Release 37



catventure
15-07-2008, 13:19
Hi,

This release introduces the possibility to play Window Media Player audio/video film clips into graphic mode adventures.
This means in addition to static pictures, you can play "cut-scenes" or title/intro/credit clips, videos of game locations, actions, objects, characters, speech to player etc.. to make adventures more "real" and involving and create for a more interactive movie feel and experience!
To keep the download small, I've included a 970k movie... well it is moving text without sound example in the "Graphic_demo.tab" adventure.


15 Jul 2008 (Release 37)
=========
*IMPROVED %lcase% and %ucase% can now be used in conjunction with ALL other text format %tags%
eg: "The following noun in this sentence will start with a capital letter - %ucase%%anyn1%."


*NEW %up% and %/up% text format commands. Set/Unset UPPERCASE text

Example: This sentence has %up%two words%/up% in uppercase.


*NEW 2 new actions for Windows Media Player audio/video movie files (Graphic Display Mode 2 Only):

playmovie1FILENAME$ - play a .wmv video clip in picbox1
playmovie2FIELNAME$ - play a .wmv video clip in picbox2



Movies will be adjusted to fit in TAB graphicboxes. Game will auto-continue when movie ends or if [SPACEBAR] pressed to exit movie clip.
NOTE: Any "Input Timeout" settings are suspended for the duration of the movie.
(Thanks to Michael Hartlef for: "mciVideo.inc")


http://tab.thinbasic.com (3.03mb)

Regards,

catventure

catventure
15-07-2008, 22:05
Hi.

Seems there's a little display problem with TAB and video clips under XP...

The TAB download is currently unavailable whilst it is looked into.

Thanks,
catventure

catventure
16-07-2008, 00:01
Hi,

Need some feedback from any Vista or XP users. TAB download online again.
I've not changed anything. Just need to know if the video clip plays OK in the "graphic_demo" game in TAB Player on your machine.

Thanks in advance for your assistance.

http://tab.thinbasic.com/

Thanks.

catventure

catventure
16-07-2008, 00:22
New version uploaded at 11.20 pm (GMT)

http://tab.thinbasic.com/

Petr has I believe found the problem and it is fixed (fingers crossed!) :)

Thanks Petr, it is a relief that it was nothing too serious.

And amazing that you pinpointed the cause!!

Top credits to you! I shall sleep better tonight.

catventure.

Petr Schreiber
16-07-2008, 00:26
Hehe,

it was pure luck to find out why, hope it will work for all ;D


Thanks for cooperation,
Petr

kryton9
16-07-2008, 00:29
Cat running on XP, everything seems to work wonderfuly!

I heard music, saw the video and of course the pictures. Looks very exciting, thanks!

catventure
16-07-2008, 00:33
Thanks and welcome again Kent.

Glad it Ok on XP now.

@Petr: Maybe I can get a videoclip of farmer's egg sandwich now! ;D

Best wishes,
Phil (catventure)

Petr Schreiber
16-07-2008, 10:18
@Petr: Maybe I can get a videoclip of farmer's egg sandwich now! ;D


That would be ultimate ... but no CG accepted, only true real life farmer's egg sandwich ;D


Petr

catventure
23-07-2008, 12:23
Hi,

A strange thing happening when playing a video clip into TAB listview box in the "graphic_demo.tab" adventure.

If I click with the mouse in the titlebar or click with mouse inside dialog window a few times the currently playing video freezes at the frame when the click occurred, I get a Windows message "(Program not responding)" in the TAB Player titlebar next to the title text.

I then have to wait until the playing movie closes ie. when it reaches the end of its length; even though I am looking at a freezed frame...

After the movie has closed the TAB Player window returns to normal and I can continue with the app as normal.

I'm using Michael Hartlef's "mciVideo.inc" file with the PlayMovie(%TRUE) function which means the TAB Player adventure dialog window cannot be resized, minimized or maximized while video playing; also means the app will be on "hold" until video closes.

Am using Windows Vista Home Basic.


Below is screenshot of anomaly:

Petr Schreiber
23-07-2008, 18:46
Hi,

would it be possible to upload sources of 39 on your web, there is "only" 38?

For now, I think the problem could be in fact that during the time you play video, program waits in WHILE IsMovieFinished loop.
Make sure there is DOEVENTS in that WHILE loop, to make the loop less tight, like:


WHILE IsMoviePlaying( )
DOEVENTS
IF GETWINDOWKEYSTATE( hwnd, %VK_SPACE ) THEN
SLEEP 150
EXIT WHILE
END IF
WEND



Petr

catventure
23-07-2008, 20:23
Hi Petr,

Thanks.

I had already tried that with the DOEVENTS on before posting. Didn't work. So the code I'm trying now WITHOUT THE LOOP which works for me but still has the problem I described is:



LOCAL hCanvas AS LONG
CONTROL HANDLE hwnd, %id_listview1 TO hCanvas
OpenMovie( hCanvas, filename )
PlaceMovie( 0, 0, 225, 219 )
PlayMovie(%true)
'REM : app on hold while plays movie to end
'GETWINDOWKEYSTATE( hwnd, %VK_SPACE )
'==========================
'WHILE IsMoviePlaying( )
' IF GETWINDOWKEYSTATE( hwnd, %VK_SPACE ) THEN
' SLEEP 150
' EXIT WHILE
' END IF
'WEND

CloseMovie( )



This way it stops user from min/maxing or resizing the window without extra code.
Apart from that the rest of code in Version 39 is the same as 38, Petr.

ErosOlmi
24-07-2008, 00:10
A while/wend like that will stop script blocking messages handling. Internal thinBasic engine will store all fired messages (up to 500) but your script is not handling it because execution is inside while/wend.

Try another strategy for example just after getmessage(...). If animation is still running just ignore the message and respond only at SPACE pressing.

Eros

catventure
24-07-2008, 07:38
Hi Eros,

Yes that works splendidly! :)

I put this after GetMessages...



'==========================
IF IsMoviePlaying() THEN

IF GETWINDOWKEYSTATE( hwnd, %VK_SPACE )<> 0 THEN
CloseMovie( )
movieon=0
END IF
END IF

IF IsMoviePlaying()=%false and movieon=1 then
closemovie()
movieon=0
END IF

'==========================


And adjusted code for playing movie. Good.

Petr, Eros way is better as sizing, dragging, min/maxing window while movie plays works as it should do without any strange unwanted behaviour. No need for extra code to turn off sizing, maximizing code.

Thanks for all help.

Tonight I will see if I can get the movie to loop/repeat!

Best wishes,
catventure.

Petr Schreiber
24-07-2008, 10:33
Hi,

yes, Eros has better solution :)
MCI allows movie repeat, I modified the function in MCIVideo.inc so PlayMovie can have second parameter specifying whether to repeat or not video.

This allows to use TRUE/FALSE flag for repetition. With this mod it caused problems as IsMoviePlaying returned end after first play of looping video. Use attached mciVideo, which handles this situation.


Petr

Michael Hartlef
24-07-2008, 10:51
Hi,

yes, Eros has better solution :)
MCI allows movie repeat, I modified the function in MCIVideo.inc so PlayMovie can have second parameter specifying whether to repeat or not video.

This allows to use TRUE/FALSE flag for repetition. With this mod it caused problems as IsMoviePlaying returned end after first play of looping video. Use attached mciVideo, which handles this situation.


Petr


Thanks Petr. :)

catventure
24-07-2008, 20:58
Hi Psch,

Hey, thanks for that revised "mciVideo.inc" with the new loop video parameter.

Just what I was looking for!

Anyhow I can tell you it worked great using "playMovie(%false,%true)"

A couple of other things I did to ensure no problems during gameplay of the adventure was to disable some of the TAB Player menu items; and also disable the input textbox so no further commands could be typed in while movie was playing.

I will incorporate the improvements into next release.

Thank you so much everybody for your assistance.

catventure.

ErosOlmi
25-07-2008, 00:45
What about some ... karma points ;D

catventure
25-07-2008, 10:28
What about some ... karma points


Oh.. alright then..

Tell you what, I will give you and Petr an extra bonus karma point for being so good in class today.
(That's my equivalent to a gold star!) :D

catventure

Petr Schreiber
25-07-2008, 11:41
What about some ... karma points ;D


;D That is dirty, Eros ;D


Petr

ErosOlmi
25-07-2008, 22:21
;D ;D

kryton9
26-07-2008, 09:09
mciVideo.inc, where is this besides the zip that Petr provided?
I didn't know we could do video in thinbasic yet.

Does this mean we can use video in textures?

catventure
26-07-2008, 10:38
Hi Kent,

http://community.thinbasic.com/index.php?topic=751.0

It's an example with TBGL Petr posted. - but uses old mciVideo.inc

catventure.

Petr Schreiber
26-07-2008, 10:54
Hi Kent,

video in texture ... if you are skilled then sure, but there is no easy way yet, and to be honest, bones, animation and image formats support have now higher priority.

Mike did fantastic job on MCI video inside TBGL window, but MS does not recommends such a hacks ( OpenGL/Direct3D combined with something else in one window ) since they released Vista.
You can make video play in dialog control, that is ok and considered safe - Catventures TAB has it implemented.


Petr

kryton9
26-07-2008, 22:03
I will tinker with it as in DarkBasicPro, they use it and it works fine or did till perhaps Vista, but since I don't have any Vista machines, not sure if it would work or not.
I know your plate is full Petr, but add this one to the list please, even if at the end for now :)

catventure
27-07-2008, 20:08
Here's update of a work in progress graphic game being made using TAB

http://uk.youtube.com/watch?v=MZAa_Dzfm_0

It will also feature video clips - although it's just static photos for now.

catventure.

Petr Schreiber
27-07-2008, 20:15
Hi,

thanks for the info, I read about this project on TAB forum.
It seems like ambitious project, I keep my fingers crossed!


Petr

ErosOlmi
27-07-2008, 20:25
Wow catventure :o
Things are getting complex over there.

I hope to give you much more power in next thinBasic release.
If UI callbacks will work as expected I'm sure you scripts can get great advantages from this.

Ciao
Eros

Michael Hartlef
31-07-2008, 21:37
Cool. It is great to see that the effort of converting this file wasn't for nothing. :)

kryton9
01-08-2008, 05:40
Mile that was a valuable conversion that I forgot about. I see when I looked through old posts I saw it, but it slipped out of my memory banks.

It is something I always like to have video playback, it adds so much to what we can do in games. Thanks again for the work!