Guest Thaxor

A video player script?

Recommended Posts

Guest

Is it possible to script a video player for mta. Like when a player joins in the game, he could watch the server promotion video or something.

So just wondering is it possible to play a avi file or something similar in game with a script.

If everything is possible i belive this is too then.

Share this post


Link to post

No, you can not play video's. You could script something that'd be switching images per frame so it looks like a video

Share this post


Link to post
that would be horrible lol

if you only use 10-15 fps and make a low-res video out of about 100 images it could be quite funny^^

Share this post


Link to post

Download these 100 images would be less funny. ^^

Share this post


Link to post

could wait for peds and do what gta does with its cutscenes guy talks narrate at bottom might not be perfect but itl do the job

Share this post


Link to post
Download these 100 images would be less funny. ^^

It isn't our fault you use a bad format and compression :roll:

Share this post


Link to post
Download these 100 images would be less funny. ^^

It isn't our fault you use a bad format and compression :roll:

what about 99% compressed JPEG? :D

Share this post


Link to post

what about a function to show a website? and then a html site with iframe to a youtube movie or so :D

Share this post


Link to post
what about a function to show a website? and then a html site with iframe to a youtube movie or so :D

What do you think MTA is? Multiplayer or Website browser? Haha

Share this post


Link to post

there isn't an html parsing gui type, so that wouldnt work.

Share this post


Link to post
Guest

Well yeah by adding pictures. Not bad heh. And about 100 images. its not even big to download if its in the right format. i guess i could try it. :D

Share this post


Link to post
Well yeah by adding pictures. Not bad heh. And about 100 images. its not even big to download if its in the right format. i guess i could try it. :D

Each file must not be heavier then 1kb. I made a speedometer with a needle which load 260 images each of them is ~2.2kb and it take long to load them all for the first time (may take 60 seconds, depends on your PC). While the game loads them all you can't even move camera, it just freezes you PC for the loading time. So maybe make them smaller then a kilo.

Share this post


Link to post
Well yeah by adding pictures. Not bad heh. And about 100 images. its not even big to download if its in the right format. i guess i could try it. :D

Each file must not be heavier then 1kb. I made a speedometer with a needle which load 260 images each of them is ~2.2kb and it take long to load them all for the first time (may take 60 seconds, depends on your PC). While the game loads them all you can't even move camera, it just freezes you PC for the loading time. So maybe make them smaller then a kilo.

I am working on a game-mode and because DP2 does not have support for custom fonts I made a dynamic text script. What it does is basically translate a string to an array of font textures (or font images if you like). As a result of that I had to create over 300 gui images at once causing cpu locks (each up to 3 kB in size). What I did is load the images first thing when the client script is loaded. Instead of creating a loop the image loading takes place in the clients' render call back event. This does bring your fps down for a short while, but it doesn't lock the cpu anymore. This also gave me the opportunity to add a working progress bar to the loading event. The loading does not take more than 20 seconds. And I don't even have the best hardware settings...believe me.

Share this post


Link to post

I've never tried to use onClientRender event to load the images and maybe it doesn't take that much cpu.

But anyway, I'd strongly recommend not to use large images (over 2kb) in scripts where tens or even hundreds of images need to be created.

Share this post


Link to post

I second that. Unless the developers come up with some low level function that allows the cpu to process other system messages while performing operation like image loading. I know for example that Delphi has something like ProcessMessages which you can use in cpu extensive loops. I tried to dig into lua threads but it seems like it doesn't have a good system based threading system. Anyway, I did some testing. It took me 44 seconds to load 1000 images of +/- 3 kB each.

Share this post


Link to post

You also must think of users with weaker PC, that barely run MTA.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.