help with script :)

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: help with script :)

Post by Goro92 » June 14th, 2011, 11:15 am

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()
Image

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: help with script :)

Post by IzNoGoD » June 14th, 2011, 12:10 pm

Try doing exactly the same:

Code: Select all

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

Its not a glitch... Its the future!

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: help with script :)

Post by Goro92 » June 14th, 2011, 12:21 pm

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);


Image

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: help with script :)

Post by Rezil » June 14th, 2011, 1:35 pm

Yeah, just set sort to a lower value.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: help with script :)

Post by Goro92 » June 14th, 2011, 2:08 pm

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?
Image

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: help with script :)

Post by IzNoGoD » June 14th, 2011, 2:15 pm

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
LMGTFY!

Its not a glitch... Its the future!

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: help with script :)

Post by Rezil » June 14th, 2011, 2:59 pm

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).
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: help with script :)

Post by Goro92 » June 14th, 2011, 3:07 pm

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
Image

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: help with script :)

Post by Goro92 » June 14th, 2011, 3:08 pm

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
Image

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: help with script :)

Post by IzNoGoD » June 14th, 2011, 3:49 pm

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
LMGTFY!

Its not a glitch... Its the future!

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: help with script :)

Post by Goro92 » June 14th, 2011, 3:56 pm

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";
Image

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: help with script :)

Post by IzNoGoD » June 14th, 2011, 4:43 pm

Just "small" will do i suppose
LMGTFY!

Its not a glitch... Its the future!

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: help with script :)

Post by Goro92 » June 14th, 2011, 6:25 pm

sorry...last question
how to center the string ?


i tried this but not work:

Code: Select all

player.credits.alignX = "center";
Image

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: help with script :)

Post by IzNoGoD » June 14th, 2011, 7:07 pm

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
LMGTFY!

Its not a glitch... Its the future!

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: help with script :)

Post by Goro92 » June 15th, 2011, 11:20 am

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;
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests