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.

DarkBASIC Professional Discussion / avi files won't load or run if a given condition is met

Author
Message
Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 26th Jul 2003 18:41
Hi,

I can't get the avi files that I have in my program to load or run.
Am I coding it right ?
Here's the code.
Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 26th Jul 2003 18:44
sorry the dumb thing accidently posted twice

UnseenGhost

Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 26th Jul 2003 19:17 Edited at: 26th Jul 2003 19:18
pro has problems with parseing long if/then lines, I have had them play up a few times, just break it down to this and see if it cures it.



since I use several dialects of basic I stuck the brackets in the conditional statement to ensure it gets parsed as intended, some basic`s have unconventional precedence and DB has a lot of unconventional quirks

Mentor.

ps: make sure the animation IS called p1win.avi and not plwin.avi, there is a difference and the difference between 1 and l in some fonts is zero, takes ages to find that kind of bug since it looks right.

Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 26th Jul 2003 19:34
Ok,

I will try and see how it comes out.

Thanks Mentor

UnseenGhost

UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 26th Jul 2003 20:32
you forgot the endif command!!!!!!!!!!!!!!!!!!

the artist formally known as darkfluff
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 26th Jul 2003 20:45
eek : No, there are TWO ways of using IF:

1.
IF condition THEN command1 : command2 : command3

(this will run all commands until end of line if condition is true - good if only a couple of commands but harder to debug)

2.
IF condition
command1
command2
command3
ELSE
command4
command5
command6
ENDIF

(this will run commands 1-3 if condition is true or 4-6 if false)

The programmer formerly known as sonic
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 26th Jul 2003 21:43
the single line if/then sometimes fails to parse (be understood by the compiler) correctly (I found this out on the twenty line challenge), you can break it down to a command a line and it works for some obscure reason, I like the if/endif and if/else/endif constructions better anyway, easier to read (indentation rules ), so you have four primary ways to do the code.

IF condition THEN commands

IF condition THEN commands ELSE commands

IF condition
commands
ENDIF

IF condition
commands
ELSE
commands
ENDIF

and of course you can also use if/then as commands and nest it few layers deep and realy mess with your head when you try to debug it , cheers.

Mentor.

HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 27th Jul 2003 00:14
The biggest change from any other version of BASIC I've used to DB is that if you do and if/endif block you don't need THEN.

In VB:



In DB:



SW Games - www.freewebs.com/swgames

Yeah, I know, I only have one game. Yeah, I know it sucks. But I made it! Me!
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 27th Jul 2003 00:26
I think thats cos Lee spends all day thinking in C++, which is so uncannily close to basic that he tends to "transpose" some of the commands, I noticed a few C++ like features in DB, (now I`m gonna get flamed for saying C++ is like basic ...WELL? it is!!!)(IMWO)

Mentor.

UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 27th Jul 2003 01:54 Edited at: 27th Jul 2003 01:56
sorry didn't notice the then
I do know how to use if commands

the artist formally known as darkfluff
Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 27th Jul 2003 04:09
I tried puting ()around the things that DBP would let me. It didn't work. I also tried droping command under command like you all told me to try. It didn't work.

I am going to try puting command under command in some other areas to see if that helps.

If you all have any other ideas let me know. I will let you all know how it's going.

UnseenGhost

Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 27th Jul 2003 14:04 Edited at: 27th Jul 2003 14:07
this works fine here, just change the path in the animation load to whatever you have for the animation you are using, I had to add a sync loop or you just see the first frame of the animation, something I forgot since I don`t use em much outside the main loop, cheers.



Mentor.

Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 28th Jul 2003 01:51 Edited at: 28th Jul 2003 02:01
I was able to get the animation to load and play. Now I just have to get it to play more than once. I guess I have to loop the animation going by your sample code.

UnseenGhost

P.S. I don't know how, but I put the code back to the way I had it to begin with and it works all except it doesn't clear the screen first before it loads and plays the animation.

[/code]if (x1=1) and (x2=1) and (x3=1)then x=1: cls:wait 1000:load animation "p1win.avi",31:play animation 31,200,200[code]

Oh well, I thought that was the way to make a code snipet.
All the code is on the same line in my program

Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 28th Jul 2003 04:26
Hey,

I was able to get the animation to load and play, but I would like to be able to play the animation more than once. I'm having trouble figuring it out. I have tried to use the Repeat command but that didn't work, unless I was puting it in the wrong place. Can anyone help ? Here's what I have.

UnseenGhost

Login to post a reply

Server time is: 2026-07-23 07:33:37
Your offset time is: 2026-07-23 07:33:37