help with script :)
Moderator: Core Staff
help with script :)
can someone tell me how dantheman did the credits in portal and sonic at the end of the map?is it easy?

-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: help with script :)
Not sure what they look like, but I assume black screen and scrolling hud.
Although he will the only one who confirm.
Although he will the only one who confirm.

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: help with script :)
thx but how to put a black screen?Drofder2004 wrote:Not sure what they look like, but I assume black screen and scrolling hud.
Although he will the only one who confirm.


Re: help with script :)
Create a new hud element.
Set sort to 99999 or smthing
Make it fullscreen, setshader ("black",640,480); it
Now, create the text with sort over that 999999 that you just gave. Scroll the text. Done.
Remember to precache both the strings and the black shader.
Set sort to 99999 or smthing
Make it fullscreen, setshader ("black",640,480); it
Now, create the text with sort over that 999999 that you just gave. Scroll the text. Done.
Remember to precache both the strings and the black shader.
Re: help with script :)
i tried this...i'm not good with scripts..need helpIzNoGoD wrote:Create a new hud element.
Set sort to 99999 or smthing
Make it fullscreen, setshader ("black",640,480); it
Now, create the text with sort over that 999999 that you just gave. Scroll the text. Done.
Remember to precache both the strings and the black shader.
Code: Select all
main()
{
precachestring(&"Map created by ...");
thread credits();
}
credits()
{
t = getent("credits_trigger","targetname");
while(1)
{
t waittill("trigger", player);
if(player isTouching(t)){
player.blackscreen = newclienthudelem(player);
player.blackscreen.setshader=("black",640,480);
player.credits = newclienthudelem(player);
player.credits .font = "default";
player.credits .fontScale = 2;
player.credits .color = (1, 1, 1);
player.credits.label = &"Map created by ...";
}
}}
I NEED HELPPPPPPPP


Re: help with script :)
Ever tried to find the scripting docs? (documentation)
If you would have taken the time to either read them or to re-read your script, you could easily point out a few errors.
1. I see no precaching of the black shader
2. setshader is a function, not a sub-var
3. player.credits .font = "default"; shouldnt have a space after player.credits
4. Above stuff could have become visible if you would just use developer 1 and interpret the errors by going to said line (or one above mostly)
5. The hud element is not destroyed after a while. I guess you would eventually fix this?
6. I see no alignx/aligny "fullscreen". Look through some stock scripts, as i know cod2 uses some of these in the killcam. Maybe cod4 does too?
7. Properly align your code. This is a mess to read (and use [c ode=cod] tags here, without the space after the c
If you would have taken the time to either read them or to re-read your script, you could easily point out a few errors.
1. I see no precaching of the black shader
2. setshader is a function, not a sub-var
3. player.credits .font = "default"; shouldnt have a space after player.credits
4. Above stuff could have become visible if you would just use developer 1 and interpret the errors by going to said line (or one above mostly)
5. The hud element is not destroyed after a while. I guess you would eventually fix this?
6. I see no alignx/aligny "fullscreen". Look through some stock scripts, as i know cod2 uses some of these in the killcam. Maybe cod4 does too?
7. Properly align your code. This is a mess to read (and use [c ode=cod] tags here, without the space after the c
Re: help with script :)
IzNoGoD wrote:Ever tried to find the scripting docs? (documentation)
If you would have taken the time to either read them or to re-read your script, you could easily point out a few errors.
1. I see no precaching of the black shader
2. setshader is a function, not a sub-var
3. player.credits .font = "default"; shouldnt have a space after player.credits
4. Above stuff could have become visible if you would just use developer 1 and interpret the errors by going to said line (or one above mostly)
5. The hud element is not destroyed after a while. I guess you would eventually fix this?
6. I see no alignx/aligny "fullscreen". Look through some stock scripts, as i know cod2 uses some of these in the killcam. Maybe cod4 does too?
7. Properly align your code. This is a mess to read (and use [c ode=cod] tags here, without the space after the c
Code: Select all
main()
{
precachestring(&"Map created by ...");
precacheShader("black");
thread credits();
}
credits()
{
t = getent("credits_trigger","targetname");
while(1)
{
t waittill("trigger", player);
if(player isTouching(t)){
player.blackscreen = newclienthudelem(player);
player.blackscreen.setshader=("black",640,480);
player.credits = newclienthudelem(player);
player.credits.sort = 99999;
player.credits.x = 400;
player.credits.y = 400;
player.credits.alignX = "right";
player.credits.alignY = "bottom";
player.credits.font = "default";
player.credits.fontScale = 2;
player.credits.color = (1, 1, 1);
player.credits.label = &"Map created by ...";
wait 5;
player.credits destroy();
player.blackscreen destroy();
}
}}
I think i fixed something...but still no work

iznogod tell me what's missing now pls
Last edited by Goro92 on June 14th, 2011, 8:13 am, edited 1 time in total.

-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: help with script :)
Turn developer mode on then run the script, and it will point you in the direction of where your code is wrong.
-
-
- 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 :)
Code: Select all
player.blackscreen.setshader=("black",640,480);
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.
[...]
#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.
Re: help with script :)
Rezil wrote:This line is wrong. Read the documentation as to why.Code: Select all
player.blackscreen.setshader=("black",640,480);
i read this http://rgnwiki.com/index.php/Call_of_Du ... :SetShader
so it is without the point? or it's something else?
Code: Select all
player.blackscreen setshader=("black",640,480);

Re: help with script :)
It is a function, else it wouldnt be in the docs.
There is even an example:
There is even an example:
Example:Code: Select all
waypoint SetShader( "playbook_objective_stop", 15, 15 );
Re: help with script :)
IzNoGoD wrote:It is a function, else it wouldnt be in the docs.
There is even an example:Example:Code: Select all
waypoint SetShader( "playbook_objective_stop", 15, 15 );
Code: Select all
player.blackscreen setshader("black",640,480);

but now i've an other problem: undefined is not an object...line 19
Code: Select all
t waittill("trigger", player);

Re: help with script :)
I think your credits_trigger is not present (?)
Maybe recheck your map
Also, next time copy paste the line with the * in it too, so you can see where exactly it goes wrong.
Maybe recheck your map
Also, next time copy paste the line with the * in it too, so you can see where exactly it goes wrong.
Re: help with script :)
you won...againIzNoGoD wrote:I think your credits_trigger is not present (?)
Maybe recheck your map
Also, next time copy paste the line with the * in it too, so you can see where exactly it goes wrong.

very very thank you!now it works!
only one other thing..u told me about scrolling text/hud?
what it is the command to use?

Re: help with script :)
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:
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.
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;
Who is online
Users browsing this forum: Google [Bot] and 1 guest