Jump to content

A video player script?


Guest Thaxor

Recommended Posts

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.

Link to comment
  • 4 weeks later...

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

Link to comment
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.

Link to comment
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.

Link to comment

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.

Link to comment

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.

Link to comment

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.
×
×
  • Create New...