Promod scripting help

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

Moderator: Core Staff

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Promod scripting help

Post by F |Madness| U » January 26th, 2013, 11:16 pm

I don't see why that isn't working. Possibly when the round resets so do the variables that you created, in which case I'm not sure of the way around that, although somebody will probably know. Maybe using pers[] which I've never understood.

Edit: I meant pers not pars :P
Last edited by F |Madness| U on January 27th, 2013, 12:07 pm, edited 1 time in total.
-

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Promod scripting help

Post by Drofder2004 » January 26th, 2013, 11:41 pm

Persistent stats should works.

self.pers["welcome"] = 1;
Image
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

izak1996
CJ Wannabe
CJ Wannabe
Posts: 27
Joined: August 1st, 2012, 11:20 am

Re: Promod scripting help

Post by izak1996 » January 27th, 2013, 12:01 am

I had no idea how to use that, but I did it in my first try :D
For anyone who doesn't know how that works :P

Code: Select all

if(!isDefined(self.pers["welcome"]))
{
        ...
        self.pers["welcome"] = 1;
}
 
Thanks to both of you!

Oh and by the way, does anyone know how to create a hud, that writes a letter by letter and then letters randomly disappear (something like when it prints Defence or Attack when round starts)... It's not crucial or anything I just wonder if anyone knows :D

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Promod scripting help

Post by F |Madness| U » January 27th, 2013, 12:11 pm

Well I think you can use the same script as IW used for writing the Attack/Defence, but simply change the string, although I can't remember what their method is exactly.

If you want to create the HUD element itself, then you would just create each letter as it's own element, and then letter1 destroy(); wait 0.5; letter2 destroy; etc.

Edit: Also Drofder if you see this, mind giving me a brief explanation on what the pers stats are/used for?
Last edited by F |Madness| U on January 27th, 2013, 1:54 pm, edited 1 time in total.
-

izak1996
CJ Wannabe
CJ Wannabe
Posts: 27
Joined: August 1st, 2012, 11:20 am

Re: Promod scripting help

Post by izak1996 » January 27th, 2013, 12:54 pm

Yeah I was thinking about using the same script, the problem is, I don't know where to find that :D and also there are sound effects when writing Attack/Defence, which would be missing if I'd do it myself...

Well thanks anyway but please note that I'm still looking for an answer :D

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Promod scripting help

Post by Drofder2004 » January 27th, 2013, 2:32 pm

F |Madness| U wrote:Edit: Also Drofder if you see this, mind giving me a brief explanation on what the pers stats are/used for?
Pers = Persistent
They are variables that are persistent across rounds (not maps).

They are mostly used to store your ranks, score, deaths, weapons, loadouts, team, challenges, etc.
At the end of the map they are sent to your profile and at the beginning of the map they are recorded back to variables.
Image
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

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Promod scripting help

Post by F |Madness| U » January 27th, 2013, 8:37 pm

Ah I see now, thanks.

I tried looking through some of the CoD4 scripts to see how the text is done, but couldn't find anything of use sorry. Also when I played some CoD4 to check, the only writing I noticed that disappears in the way you described (random letters disappear) is the writing that says Marine Force Recon/S.A.S/Spetsnaz/other when you spawn, and I couldn't find anything related to that in the scripts sorry!
-

izak1996
CJ Wannabe
CJ Wannabe
Posts: 27
Joined: August 1st, 2012, 11:20 am

Re: Promod scripting help

Post by izak1996 » January 27th, 2013, 9:06 pm

Don't worry, I will figure something out :) even without that it is better than nothing. And since we are talking about huds and stuff could you tell me which colors can I use in hud? I know (1, 1, 1) is white and (1, 0, 0) is red and few others, but as far as I know you could use all rgb colors. How I am supposed to know color codes?
Thanks in advance :)

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Promod scripting help

Post by F |Madness| U » January 27th, 2013, 9:26 pm

KillerSam wrote:google RGB colour codes?
Indeed. There are many websites where you can choose a colour from a palette and it will tell you the RGB of that colour.
-

izak1996
CJ Wannabe
CJ Wannabe
Posts: 27
Joined: August 1st, 2012, 11:20 am

Re: Promod scripting help

Post by izak1996 » January 27th, 2013, 9:53 pm

I'm still not sure how that works... e.g. (1, 1, 1) here is white but in real RGB 1, 1, 1 is black, and 255, 255, 255 is white. A brief explanation? :D
Oh and I figured out my previous question :D It's actually pulse effect
Thanks :)

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: Promod scripting help

Post by Rezil » January 27th, 2013, 10:04 pm

I'm still not sure how that works... e.g. (1, 1, 1) here is white but in real RGB 1, 1, 1 is black, and 255, 255, 255 is white. A brief explanation?
RGB values are normalized. You need to divide the original RGB by 255 to get the actual values used.
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.

izak1996
CJ Wannabe
CJ Wannabe
Posts: 27
Joined: August 1st, 2012, 11:20 am

Re: Promod scripting help

Post by izak1996 » January 27th, 2013, 10:15 pm

Now that makes sense! Thanks for that Rezil... And thanks to everyone else.
If i won't be needing any help, know that I'm very glad that you all helped me out! Especially F|Madness|U (Although none of your suggestions worked, you took time and you looked into that and answered each and every one of my questions :D ) :) Thanks again.

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Promod scripting help

Post by F |Madness| U » January 27th, 2013, 11:18 pm

izak1996 wrote:Now that makes sense! Thanks for that Rezil... And thanks to everyone else.
If i won't be needing any help, know that I'm very glad that you all helped me out! Especially F|Madness|U (Although none of your suggestions worked, you took time and you looked into that and answered each and every one of my questions :D ) :) Thanks again.
Good that you got your problems answered. Points for effort though, right? :lol:
-

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Promod scripting help

Post by Drofder2004 » January 28th, 2013, 2:07 am

If you want to do the CoD4 text (random lettering and shit)

you can do:

Automatic Message:

Code: Select all

self thread maps\mp\gametypes\_hud_message::hintMessage( "message" );
Manual Message:

Code: Select all

hud = createFontString(font, size); /* font = default/objective and size has a min value of 1.4 (I think) */
hud.x = 0;
hud.y = 0;
hud.alignX = "center";
hud.alignY = "middle";
hud.alpha = 1;
hud.color = (0.6, 0.9, 0.6);
 
hud setText("Message");
hud.glowColor = (0.2, 0.3, 0.7);
hud.glowAlpha = 1;
hud setPulseFX(value, (timeIn*1000), (timeOut*1000)); /*default for value is 100, defaults for timeIn and timeOut are 2-4 and 1 respectively */ 
Image
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

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 37 guests