Jump to content
  • 0
vykimo

Video function (as 'cutin')

Question

Hi all,

I'm trying to build a src function to show kind of ""video"" (more a gif since it'll play a lot of .bmp in succession) based on the cutin function.

In fact, It's already possible doing things like this :

mes "Video";for(.@i=0;.@i<100;.@i++) {        cutin "image"+.@i,0;        sleep2 500;}close2;cutin "",255;end;

 

BUT the problem is that during the animation, the player can't do anything!!

What I'd to do is a src function like that :

 

 *video "<filename>,<position>,<number of frame>,<number of repeat 0 for infinite>,<timetick>; 

 

And during the animation, the player can close the npc dialog to stop the video for example.

 

 

I'm convinced that I need to create a sub-executed program like 'donpcevent' does and put a line in 'close' function to abort this sub-program.

but I don't know how to manage to do this.

 

I started like this :

BUILDIN(video){	TBL_PC* sd;	int i;	char *image;	sd = script->rid2sd(st);	if( sd == NULL )		return true;		image = Malloc((sizeof(script_getstr(st,2)) + 1)*sizeof(char));		// Need to create a sub-executed program to not interrupt the running of the main script	do {		for(i=1; i<=script_getnum(st,4);i++) {						sprintf(image,"%s%d",script_getstr(st,2),i);						clif->cutin(sd,image,script_getnum(st,3));						ticks = script_getnum(st,5);			// Timer Function, still don't know what using				} while(script_getnum(st,4)==0);		free(image);	return true;}

 

Can someone help me to build it?

It's a masterpiece function in customization and I'm sure It'll help a lot of people.. ;)

Thanks in advance!

Edited by vykimo

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.