Page 2 of 2

Re: Promod scripting help

Posted: January 26th, 2013, 11:16 pm
by F |Madness| U
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

Re: Promod scripting help

Posted: January 26th, 2013, 11:41 pm
by Drofder2004
Persistent stats should works.

self.pers["welcome"] = 1;

Re: Promod scripting help

Posted: January 27th, 2013, 12:01 am
by izak1996
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

Re: Promod scripting help

Posted: January 27th, 2013, 12:11 pm
by F |Madness| U
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?

Re: Promod scripting help

Posted: January 27th, 2013, 12:54 pm
by izak1996
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

Re: Promod scripting help

Posted: January 27th, 2013, 2:32 pm
by Drofder2004
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.

Re: Promod scripting help

Posted: January 27th, 2013, 8:37 pm
by F |Madness| U
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!

Re: Promod scripting help

Posted: January 27th, 2013, 9:06 pm
by izak1996
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 :)

Re: Promod scripting help

Posted: January 27th, 2013, 9:26 pm
by F |Madness| U
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.

Re: Promod scripting help

Posted: January 27th, 2013, 9:53 pm
by izak1996
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 :)

Re: Promod scripting help

Posted: January 27th, 2013, 10:04 pm
by Rezil
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.

Re: Promod scripting help

Posted: January 27th, 2013, 10:15 pm
by izak1996
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.

Re: Promod scripting help

Posted: January 27th, 2013, 11:18 pm
by F |Madness| U
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:

Re: Promod scripting help

Posted: January 28th, 2013, 2:07 am
by Drofder2004
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 */