Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Animation "video" Taking off the screen

Author
Message
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 17th Dec 2011 06:52 Edited at: 18th Dec 2011 07:33
Sorry to ask for what seems to be such a simple question, but I can't find the answer anywhere.

My Menu's background is a animation in .wmv format, and when I stop the animation it stays on the screen. cls doesn't work. The only way I've been able to make it disappear is by deleting it.

Only problem is I need to reload and it seems that deleting and loading it multiple times causes lots of problems.

Any help is much obliged, thanks!


PROBLEM: animation stays on screen unless deleted

WORKAROUND: stop the animation, repositioned it with place animation #,0,0,0,0. Then when you want it again reposition it back to desired size, then loop/play again.

PROBLEM: animation doesn't play at all

WORKAROUND: Make sure that your "load animation" number is different than all of your other media files

The fastfood zombie killer
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 17th Dec 2011 12:52
Hmm... will look into it shortly... as this will be useful to me too

Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 17th Dec 2011 15:39
Awesome, thanks

The fastfood zombie killer
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 17th Dec 2011 17:52 Edited at: 17th Dec 2011 17:52
ok... was going to tell you to look at the 3DVideo folder in DBProjects... but here goes

I am going to refer to the Hands on Dark basic Pro Vol.1 here a little... you should buy the PDF editions theyre cheap and extremely handy!!

OK for one... I do not think DBPro handles .WMV natively so that might be your first port of call only just realised that looking back at your post... so change it to .AVI ...

and I quote

Quote: "DarkBASIC Pro has a set of commands for loading and playing video files. These
commands allow video file formats such as MPEG, AVI and Quicktime to be played
as part of your program. Strangely enough, these same instructions can be used for
playing certain types of sound-only files as well. We’ll discuss this at the end of the
chapter."


... REF Page 436 [or PDF page number 464 not the page number urm nvm ] Hands On Dark Basic Pro Vol.1

I hope Alistair does not mind me quoting ... so I say again BUY THE PDF's

anyhoo... I do not want to have any trouble because of quoting the book... so I will just say look more into the command

Quote: "LOAD ANIMATION"


and

Quote: "PLAY ANIMATION"


I hate to not fully answer this, as I have learnt it through the books... so perhaps this is one of the best plugs ever?

Hope you can find something on the forums regarding the command... but I did not find much

so... you could either buy the book... or find out if Alistair Stewart is OK with someone quoting a whole section lol... the PDF's are pretty cheap eitherway... but I hope LOAD ANIMATION is a good enough lead... unless thats how your already playing the animation?

Actually what code are you using?


EDIT

Typo... in Basic

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 17th Dec 2011 18:37
Quote: "I found a work around, but surely there is a better way than this. I stopped the animation, repositioned it to 0,0,0,0. Then when I want it again I reposition it back to full screen, then loop again."


I think that is the only way you can do it I'm afraid...

TheComet

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 17th Dec 2011 18:57
perhaps load the animation into a memblock? should that not reduce the memory issue?
[I am still under experimented with memblocks so forgive me]

EricB
13
Years of Service
User Offline
Joined: 3rd Nov 2011
Location:
Posted: 17th Dec 2011 21:46
While I don't know the code you are using or why the animation needs to "stop" I'd suggest that you look at either command listed below:

loop animation or

play animation to image

Using loop animation there is no need for the animation to stop, or by playing the animation to a image you can paste the image elsewhere thus eliminating the need to stop and move the animation.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Dec 2011 23:41 Edited at: 17th Dec 2011 23:44
In DBC there is code to play an animation from a bitmap and copy the bitmap or get and paste the images to the viewable area on the screen. Probably similar to what EricB was referencing with play animation to image:



You can then, of course, stop the animation and clear the screen as you need.

Enjoy your day.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Dec 2011 23:54 Edited at: 18th Dec 2011 02:56
if you're using a full-screen menu, play the animation to an image and look at the texture backdrop command. ie:



if the menu isn't full-screen, ignore texture backdrop and paste the image (that the animation plays to) to the desired location on-screen.

there are other ways to accomplish what you want (including showing/hiding/pasting sprites that use the animation image similarly) but this should help lead you in what i think is the right direction.

good luck!

edit: just re-read original post where
Quote: "...I reposition it back to full screen"

so the above should help

bah! i transposed the aw and ah variables there. fixed it now. (plus added image i wanna try for new av )

Virtual Nomad @ California, USA . DBPro V7.5
AMD Phenom™ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit

Attachments

Login to view attachments
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 18th Dec 2011 01:06 Edited at: 18th Dec 2011 03:14
Thanks for all of the awesome feedback guys. Wake up and look at the board, 1 comment, go to work, come back and then all of this!!!

@MrValentine: I am using load/loop/play commands. The only thing I don't quite understand is the variable for bitmap. I had the book, but then I let someone borrow it, then it disappeared...And I have no experience with memblocks, shame on me
Edit: my only problem with file types is that when I recorded it in AVI the file was about 1.5 gb, whereas when I put it in windows video maker and exported it it was about 12mb.

Edit: the index says the file type should be one supported by the os, such as ...etc.. I think maybe wma isn't the problem


@EricB: The reason why I need it to stop is because I don't want it eating up my cpu when it isn't being used. The reason why I loop it is because it is the background for my main menu.


@Latch/Virtual Nomad: I'll definitely have to experiment with the bitmaps and sprites, but applying a texture to the backdrop with a image that has been set for a animation sounds genius!!!


Now that I'm back home I'll try everything out, thanks for the help guys.

The fastfood zombie killer
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 18th Dec 2011 06:48 Edited at: 18th Dec 2011 07:30
So I think there is indeed a error with dbpro. Don't want to speak to soon, but if I'm wrong I'm wrong, but if I'm right I might actually be able to contribute to making the program better by finding it!

So this is what I was doing:


This causes the 2nd animation to appear as a black frozen screen.
If I change the stop/place animation with delete animation then everything works great.

I believe that when I go to "play animation 2" it is still stuck on the 1'st animations stop.


Ok guys... I figured out where I'm going wrong here. The play animation command can play multiple file types loaded, not just files loaded with load animation. One of the files that I loaded after loading the movie file was taking precedence over the animation file. Thanks for all of the help guys.

The fastfood zombie killer
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 18th Dec 2011 23:02 Edited at: 18th Dec 2011 23:13
Quote: "...not just files loaded with load animation."

wait, what?

play animation was "playing" a file that was not loaded via load animation? i know there are some undocumented aspects re: animations (like the ability to play animated .gif files) and that the animation functions within dbpro are less-than stellar, but what kind of file did it "play" and how was it referenced? ie, did you (inadvertantly):


...and have it show/play something?

i'm glad you got it sorted out for what you're doing but you may have opened another can of worms that we should know about (and i may be reading your edit incorrectly, too...)

by the way, what version of dbpro are you using?

add: just saw you've edited your original post to include:
Quote: "WORKAROUND: Make sure that your "load animation" number is different than all of your other media files"

does this mean you had something like:

and, instead of playing the animation, it displayed the image?

Virtual Nomad @ California, USA . DBPro V7.5
AMD Phenom™ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 18th Dec 2011 23:20 Edited at: 18th Dec 2011 23:32
You know, for a while I thought it was something like that and it was working. But at this point I'm about to set my computer on fire....

I ended up commenting out all of my code until I got to the point to where it would play, and then changed it back until it started working again. I have it all the way narrowed down to:




If I comment out sparkys commands it works just fine. The odd thing is that when I decided to start a new dbpro project so I could make everything abstract and down to the point, the same code works!!! WHAT IS GOING ON!!!

Version 1.071

Edit: Just found out that when I make new objects for the loop with different numbers, it works, investigating further...


The fastfood zombie killer
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 18th Dec 2011 23:39 Edited at: 18th Dec 2011 23:43
Quote: "Version 1.071
"

and i thought i was behind...

i've experienced what you're stating here. some code has issues, cut it out, compile and run, put it back in and it works fine. always figured it was an IDE bug (something there/not there that we can't see, somehow). and, if it helps, i don't use sparky's so, since i've had similar experience without it, i wouldn't suspect it specifically. (and, i still use the original IDE, btw)

sounds like you're able to progress again. <shrugs> chalk it up as an anomaly (or some kinda voodoo, if you prefer) and forge ahead


i'm not gonna post on this for a bit; we're communicating via edits, now, but code, as written, isn't doing what you think it is...
> for i - 500 to 537

Virtual Nomad @ California, USA . DBPro V7.5
AMD Phenom™ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 19th Dec 2011 00:00
I meant to say =, I'm still having issues . I, kinda.... called in to work today to try and fix this... not even joking

The fastfood zombie killer
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Dec 2011 02:34
Hi There
@Mychal B
I have load two animation in .wmv both(320*240) and used this piece of code, and don't have any problem .




Cheers.
Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 19th Dec 2011 04:28
It works fine outside of my game. For some reason, even if I put everything in its own little loop so I can make sure that nothing else is interfering with it, it has its problems. I'm currently commenting out to see where the problem is, but where it is leading me makes no sens at all. Unfortunately the game is pretty dang big, and wouldn't be reasonable to upload with all of the source files as well Been working on this non stop to no avail...

The fastfood zombie killer
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Dec 2011 04:30
Sorry to jump back in with a stupid post...

But have you been using error trapping or will this not work here?

Was just a thought...

Mychal B
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 19th Dec 2011 04:54 Edited at: 19th Dec 2011 06:01
I was checking to make sure that the animations were loaded and that they were playing. What I don't understand is how what im doing here can make any difference on the animations:



Sorry for the mass amounts of code, but I'm completely lost as of what I'm doing wrong. For some reason when I comment out some of the clone object commands it works, no idea why... I'm feeling so stupid/frustrated right now


Edit: Ok, I guess I'll never be able to figure out what exactly the problem was. I ended up loading my animations after the code listed above instead of before and now everything works great. Put that in the question box that is never to be opened again

Now my only question is, does having three or four animations loaded into the system while playing the game significantly drain performance? It seems to be running considerably slower.

If it isn't one thing its the other

The fastfood zombie killer
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Jan 2012 02:50 Edited at: 6th Jan 2012 02:52
Looking at a couple of your variable declarations, it seems you may be using reserved keywords as your own variables. For example, you have:

speed as integer

For object animations and sound, speed is part of a keyword group: SET OBEJCT SPEED, SET SOUND SPEED, etc. Now if there are other keywords you have assigned as variables that may be video animation (or not) related, it may be causing problems.

Go through your code and check to make sure you are not declaring variables or types with keyword names. I don't know if it is influencing the troubles you are having, but it's generally a good idea to avoid using keywords as function or variable names.

Enjoy your day.

Login to post a reply

Server time is: 2024-11-22 06:12:01
Your offset time is: 2024-11-22 06:12:01