Playing an Avi in the Pro 6.1 Game Engine

Posted By: webamerica

Playing an Avi in the Pro 6.1 Game Engine - 04/20/05 17:29

Dear Conitec,

I am new at building games so please bear with me on some support issues i may have from time to time.

Here is the problem i am currently experiencing.

I need a complete working script to play an avi inside the game and where to place it exactly in the main script for the Pro 6.1 engine.

I have tryed every script that has been posted in the forums and none of them have worked for me as of yet.

I have also searched the help files that are included with the game engine
and have tryed all of the included sample scripts.

None of them have worked either.

I also upgraded to the latest Pro Version but i actually did not care for it
so i deleated that engine and reinstalled the Pro 6.1 again without checking to
see if any of the scripts i have for the avi would work in the upgrade because it meant taking more time to learn the new engine functions and navigation.

I feel very comfortable with the Pro 6.1 version so my desire is to continue
using this version for now.



Perhaps their is a way to use DLL scripting instead of C++?

The system i am currently building the game on is as follows.

Professional 6.1 Game Engine

System Info:

Windows XP PRO
Pentium 4 2.8
1.5 RAM

Any scripts, advice, suggestions or help would be greatly appreciated.

Sincerely,

Charles
Posted By: Bird

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/20/05 18:46

Ok, i'm not conitec, but i think, you should update to the newest version of A6. With this update you will have more and better features, less bugs and a faster engine. Newest Update is A6.31.4

PS: I have read, that you had the newest Update, but you should really update it (again). It's much better!
Posted By: webamerica

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/20/05 20:32

Hello,

Thank you for your suggestion on upgrading a second time to the 6.34 engine.

I took your advice and completed the upgrade.

Unfortunately none of the avi scripts work.

Recieve error message (Keyword unknown word Media_play
script error - engine shutdown)

This is why i am seeking a completed script to play an avi inside the game on a sprite.

Please keeep me posted if you find one that might work.

Please find my original post enclosed below.

------------------------------------------------------------------------------

I am new at building games so please bear with me on some support issues i may have from time to time.

Here is the problem i am currently experiencing.

I need a complete working script to play an avi inside the game and where to place it exactly in the main script for the Pro 6.1 engine.

I have tryed every script that has been posted in the forums and none of them have worked for me as of yet.

I have also searched the help files that are included with the game engine
and have tryed all of the included sample scripts.

None of them have worked either.

I also upgraded to the latest Pro Version but i actually did not care for it
so i deleated that engine and reinstalled the Pro 6.1 again without checking to
see if any of the scripts i have for the avi would work in the upgrade because it meant taking more time to learn the new engine functions and navigation.

I feel very comfortable with the Pro 6.1 version so my desire is to continue
using this version for now.



Perhaps their is a way to use DLL scripting instead of C++?

The system i am currently building the game on is as follows.

Professional 6.1 Game Engine

System Info:

Windows XP PRO
Pentium 4 2.8
1.5 RAM

Any scripts, advice, suggestions or help would be greatly appreciated.

Sincerely,

Charles

--------------------
Excell Technologies
Posted By: Roger

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/20/05 21:39

hmm...Keyword unknown word Media_play...
try this command at the end of the main function before the "}" of your level:
media_play("my_movie.avi", null, 100);

replace my_movie.avi by the real name of your video file ,and make sure the AVI is in the same directory than the WMP.

It should work if you did that right .
Posted By: FeiHongJr

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/20/05 21:39

heres a code i use to play a movie on a model should be pretty much the same.

Code:

var tv_handle = 0;
function new_tv()
{
if(event_type == event_scan && media_playing(tv_handle)== 0)
{
media_play("01.avi",bmap_for_entity(my,2),100);
tv_handle = media_handle;
}
}


action activate_TV// action to attach to tv
{
//TV = me;
my.enable_scan = on; // sensitive to scans
my.event = new_tv;// run tv_on_off if im scanned
while(1)
{
if(media_playing(tv_handle) != 0)
{
my.skin = 2;
}
else
{
my.skin = 1;
}
wait(1);
}
}



Hope it helps/
Posted By: PHeMoX

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/21/05 15:27

I really recommend updating your version to the newest version, though i'm sure there's no bug for the mediaplay function, you're missing the whole shader features and some other big improvements... As far as your script problem, maybe you should download the newest manual from the download page, and look up the function media_play , because 99% of the functions are explained with a short example, which will definately help you, i'm sure!
Also usually when the engine gives this error, it could mean you did a few things wrong, for example at the end of each line of code should come a ; Or you made a typo or something like that, maybe you can post your script??

Cheers
Posted By: Doug

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/21/05 20:34

Quote:

I really recommend updating your version to the newest version,




If I understand his posts, he did upgrade, then returned back to 6.1, and then is now back to the latest version.

Try “FeiHongJr” solution and let us know if it works. Remember, as a Pro owner you have a year of support. We can't answer programming questions but, if you think you have a bug, please let us know.
Posted By: Locoweed

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/22/05 02:50

Hi webamerica,

Perhaps you should post the part of the code where you are trying to play the avi, then someone could look at it and see if they see something wrong with the code itself. Alot of times with the kind of error you explained, the actual error is in one of the lines above the line of code where the error shows up, usually a syntax error, this may or may not be the problem, but it wouldn't hurt to show the code and find out.

Loco
Posted By: webamerica

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/22/05 04:03

Hello,

As you requested here is a sniplet of the code and it's placement in the script.
-----------------------------------------------------------------------------
I did try this script enclosed below and it opens the avi for about
1-1/2 frames with no sound and then i recieve the following error message.

Acknex has encountered a problem and needs to close.
To be more specific, it crashes the game.

Interestingly enough, no other script will even open the avi.
This will at least perform the function as far as i mentioned above.

I have tryed several file sizes on the avi's from very large to very small
with out any change in the ability to run the avi.

So the size does not seem to be the issue or at least not at this point untill we find the script and or the location to place the script in the main wdl.

However, the resolutions of the avi's that we make are of broadcast quality
since this is one of the services we provide to the film, video and television industry.

I mention the possible problem with the resolution being to high and the frame rate to fast for the engine to run based on the help files which point out that it is best to keep both as low as possible.

At this point i do not know how to adjust down or up an avi resolution or frame rate to satisfy the engine if this is what it needs.

Please find the script that peforms the above mentioned actions.
Please remember that this is the only script that has even come close to running an avi so far.

/////////////////////////////////////////////////////////////////
// The main() function is started at game start
function main()
{media_play("walls.avi",Null,100);


// set some common flags and variables
// warn_level = 2; // announce bad texture sizes and bad wdl code
tex_share = on; // map entities share their textures

// center the splash screen for non-640x480 resolutions, and display it
splashscreen.pos_x = (screen_size.x - bmap_width(splashmap))/2;
splashscreen.pos_y = (screen_size.y - bmap_height(splashmap))/2;
splashscreen.visible = on;
// wait 3 frames (for triple buffering) until it is flipped to the foreground
wait(3);

// now load the level
level_load(level_str);
// freeze the game
freeze_mode = 1;

// wait the required second, then switch the splashscreen off.
sleep(5);
splashscreen.visible = off;
bmap_purge(splashmap); // remove splashscreen from video memory

// load some global variables, like sound volume
load_status();

// display the initial message
msg_show(mission_str,10);

// initialize lens flares when edition supports flares
ifdef CAPS_FLARE;
lensflare_start();
endif;

// use the new 3rd person camera
move_view_cap = 1;

// un-freeze the game
freeze_mode = 0;

// client_move(); // for a possible multiplayer game
// call further functions here...
}
{

As you requested i am sending you this information to see if we can possibly
continue to search for soulutions.
Posted By: jcl

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/22/05 06:46

A crash when playing a movie file can happen when the file itself, or the CODEC on your PC is faulty.

However, this forum section is not suited for technical support. Please contact our support directly.
Posted By: webamerica

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/22/05 07:37

Hello,

The game itself does not crash.

The avi is scripted to play before the game actually begins.

When debuging here is the exzct order of events that occur.

1. Acknex has encountered a problem and needs to close.

2. Except the mandatory abort.

3. Game never gets a chance to open.

So the game and the engine do not crash.

The file is not corrupt and the CODEC is working fine.

This is why i brought the following possible issues to your attention as follows.

///////////////////////////////////////////////////////////////////////

I have tryed several file sizes on the avi's from very large to very small
with out any change in the ability to run the avi.

So the size does not seem to be the issue or at least not at this point untill we find the script and or the location to place the script in the main wdl.

However, the resolutions of the avi's that we make are of broadcast quality
since this is one of the services we provide to the film, video and television industry.

I mention the possible problem with the resolution being to high and the frame rate to fast for the engine to run based on the help files which point out that it is best to keep both as low as possible.

At this point i do not know how to adjust down or up an avi resolution or frame rate to satisfy the engine if this is what it needs.

Please find the script that peforms the above mentioned actions.
Please remember that this is the only script that has even come close to running an avi so far.

/////////////////////////////////////////////////////////////////
// The main() function is started at game start
function main()
{media_play("walls.avi",Null,100);

Sincerely,

Charles
Posted By: Ayrus

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/22/05 07:45

Quote:

1. Acknex has encountered a problem and needs to close.





Not quite, Acknex.exe is the engine, and it is what is crashing when the AVI starts to play, which would lead, in my mind to a playback issue, which well, could be a codec, a corrupt frame, driver or whole host of other things including something within the engine itself possibly. You could try using a different codec, ensure your video drivers are up to date, do a test publish and try it on another system to see if it crashes, take Jcl's advice... but personally, I would see if it crashes on another system first in order to ensure that it isn't a localized issue (Improperly installed driver/codec, etc..) and even ensure (I bet you have already done this, but I'll say it anyways) that the avi file plays in windows media player or an equilivilant; Then look at the possibility of maybe trying a different codec/compression/resolution (Start with it as simple as possible and go from there) to eliminate any and all external (from the engine) possibilities.

Regards,
Ayrus
Posted By: jcl

Re: Playing an Avi in the Pro 6.1 Game Engine - 04/22/05 08:57

As I've said, you have to contact the support. If your software crashes, we need to know where you got this software version. Please do not post here anymore before you've talked to the support.
© 2024 lite-C Forums