Page 2 of 3

Re: help with script :)

Posted: June 14th, 2011, 11:15 am
by Goro92
IzNoGoD wrote:Try moveovertime()
Also: scaleovertime() and fadeovertime() for other effects.

For fadeovertime (and most likely scaleovertime/moveovertime too) you have to define a value BEFORE calling the function and a value directly after. Like:

Code: Select all

hud.alpha=1;
hud fadeovertime(5);
hud.alpha=0;
This code will make the text fade away after 5 seconds. It will not introduce any waits though, so if you want to do another fadeovertime AFTER this, you will have to write a wait 5; yourself.

the fade function works but i don't understand how to move the string...i tried moveovertime() and scaleovertime()

Re: help with script :)

Posted: June 14th, 2011, 12:10 pm
by IzNoGoD
Try doing exactly the same:

Code: Select all

 
hud.x=0;
hud.y=0;
hud moveovertime(5);
hud.x=640;
hud.y=480;
 

Re: help with script :)

Posted: June 14th, 2011, 12:21 pm
by Goro92
IzNoGoD wrote:Try doing exactly the same:

Code: Select all

 
hud.x=0;
hud.y=0;
hud moveovertime(5);
hud.x=640;
hud.y=480;
 
thx another time :D

works


and if i want to put custom image over the black screen?

is correct ?

Code: Select all


prechaceshader("customimage1");
....
player.image = newclienthudelem(player);
player.image setshader("customimage1",400,100);



Re: help with script :)

Posted: June 14th, 2011, 1:35 pm
by Rezil
Yeah, just set sort to a lower value.

Re: help with script :)

Posted: June 14th, 2011, 2:08 pm
by Goro92
Rezil wrote:Yeah, just set sort to a lower value.
i need to put the imagecustom in a iwd files true?

in which directory?materials or images?

Re: help with script :)

Posted: June 14th, 2011, 2:15 pm
by IzNoGoD

Code: Select all

blackhud.sort=9999;
imagehud.sort=10000;
texthud.sort=10001;
Edit:

Code: Select all

blackhud.alignx="fullscreen";
blackhud.aligny="fullscreen";
That is, if i recall correctly

Re: help with script :)

Posted: June 14th, 2011, 2:59 pm
by Rezil
serveaiuto wrote:
Rezil wrote:Yeah, just set sort to a lower value.
i need to put the imagecustom in a iwd files true?

in which directory?materials or images?
When you convert to .iwi, you get both an image file and a material file. Place them in their respective folders in your .iwd(.iwi in images and the material file - which has no extention - in materials).

Re: help with script :)

Posted: June 14th, 2011, 3:07 pm
by Goro92
IzNoGoD wrote:

Code: Select all

blackhud.sort=9999;
imagehud.sort=10000;
texthud.sort=10001;
Edit:

Code: Select all

blackhud.alignx="fullscreen";
blackhud.aligny="fullscreen";
That is, if i recall correctly
what is it?:)

and in my script i used this:

Code: Select all

player.credits .font = "default";
there are other values for font other than default?

sorry 4 my bad english

Re: help with script :)

Posted: June 14th, 2011, 3:08 pm
by Goro92
Rezil wrote:
serveaiuto wrote:
Rezil wrote:Yeah, just set sort to a lower value.
i need to put the imagecustom in a iwd files true?

in which directory?materials or images?
When you convert to .iwi, you get both an image file and a material file. Place them in their respective folders in your .iwd(.iwi in images and the material file - which has no extention - in materials).

thx rezil :D

Re: help with script :)

Posted: June 14th, 2011, 3:49 pm
by IzNoGoD
serveaiuto wrote:
IzNoGoD wrote:

Code: Select all

blackhud.sort=9999;
imagehud.sort=10000;
texthud.sort=10001;
Edit:

Code: Select all

blackhud.alignx="fullscreen";
blackhud.aligny="fullscreen";
That is, if i recall correctly
what is it?:)

and in my script i used this:

Code: Select all

player.credits .font = "default";
there are other values for font other than default?

sorry 4 my bad english

Code: Select all

#define UI_FONT_DEFAULT			0	// auto-chose betwen big/reg/small
#define UI_FONT_NORMAL			1
#define UI_FONT_BIG				2
#define UI_FONT_SMALL			3
#define UI_FONT_BOLD			4
#define UI_FONT_CONSOLE			5
Ripped from ui/menudefinition.h

Re: help with script :)

Posted: June 14th, 2011, 3:56 pm
by Goro92
IzNoGoD wrote:

Code: Select all

#define UI_FONT_DEFAULT			0	// auto-chose betwen big/reg/small
#define UI_FONT_NORMAL			1
#define UI_FONT_BIG				2
#define UI_FONT_SMALL			3
#define UI_FONT_BOLD			4
#define UI_FONT_CONSOLE			5
Ripped from ui/menudefinition.h

Code: Select all

player.credits .font = "UI_FONT_SMALL";
is this correct?

or just this:

Code: Select all

player.credits .font = "SMALL";

Re: help with script :)

Posted: June 14th, 2011, 4:43 pm
by IzNoGoD
Just "small" will do i suppose

Re: help with script :)

Posted: June 14th, 2011, 6:25 pm
by Goro92
sorry...last question
how to center the string ?


i tried this but not work:

Code: Select all

player.credits.alignX = "center";

Re: help with script :)

Posted: June 14th, 2011, 7:07 pm
by IzNoGoD
IzNoGoD wrote:

Code: Select all

blackhud.sort=9999;
imagehud.sort=10000;
texthud.sort=10001;
Edit:

Code: Select all

blackhud.alignx="fullscreen";
blackhud.aligny="fullscreen";
That is, if i recall correctly

Sorry, my memory was incorrect:

Code: Select all

	self.hud_stat.alignx = "left";
	self.hud_stat.horzAlign = "fullscreen";
	self.hud_stat.vertAlign = "fullscreen";
The alignx/aligny should be center/middle (center for x, middle for y)(top/bottom for y, left/right for x), and the horzalign/vertalign are for what part of the screen you want to use. Set this to fullscreen for the black shader

Re: help with script :)

Posted: June 15th, 2011, 11:20 am
by Goro92
thanks IzNoGoD it works now

really last 2 questions :D

1:in the script i used:

Code: Select all

player.credits.color = (1, 1, 1);
are there other features of Color that can color the edges?
i tried forecolor but doesn't work

2:how to show player.name in the label?
i tried this but does not work

Code: Select all

player.credits.label = &"Congratulations"+player.name;