Post: [SCRIPT] Pulsing DoHeart
11-06-2011, 09:48 PM #1
Choco
Respect my authoritah!!
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys this is a thread for a pulsing DoHeart() like in mw2 Smile It flashes red & green and changes size...

Here's the script:
    DoHeart(text, align, relative, x, y)
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
if(isDefined(self.heart))
{
self.heart destroy();
}
self.heart = self createFontString("DAStacks", 2.5, self);
self.heart SetPoint(align, relative, x, y);
self.heart setText("^1"+text);
wait 0.2;
self.heart destroy();
self.heart = self createFontString("DAStacks", 3.0, self);
self.heart SetPoint(align, relative, x, y);
self.heart setText("^2"+text);
wait 0.2;
}
}


Thread it like this:
    self thread DoHeart(".Choco", "TOP", "TOP", 0, 0);


I know it's got setText repeating over and over, but I remember reading somewhere that SetText will not overflow if it is in a for(;Winky Winky loop. Feel free to test on PS3 and see if it causes overflow or not Winky Winky

Enjoy guys Smile
(adsbygoogle = window.adsbygoogle || []).push({});
11-07-2011, 01:14 AM #11
Choco
Respect my authoritah!!
Originally posted by Blackstorm View Post
Just because it is in a for loop doesn't mean it will not overflow.

They way setText works (to my understanding) in CoD4:

setText can set text to 25 unlocalized strings.

Every time you set a string you haven't used in setText you use up one of the unlocalized string resources.

You can set up to 25 different strings without it overflowing!

So with this script you are setting two different strings depending on how many times you call the thread. Lets say you do...

self thread DoHeart( "Example", "CENTER" );

Now, since you have used the string "Example" it well use two unlocalized strings ( "^1Example" & "^2Example" ).

Therefore you can only set text to 23 other different strings. Since you are looping those two same strings over and over and since you have those two strings 'stored' in the localized resources setting text with those two strings over and over will not cause it overflow.

Understand guys? :b


I had a for loop set up like this in one of my patches:
    heart()
{
self endon("disconnect");
self endon("death");
self.heart = self CreateFontString( "objective", 2.0, self);
self.heart setPoint("TOP", "");
for(;Winky Winky
{
self.heart SetText("^1Choco");
wait .1;
self.heart SetText("^2Choco");
wait .1;
}
}


And it never overflowed, even on ps3
11-07-2011, 03:34 AM #12
Blackstorm
Veni. Vidi. Vici.
Originally posted by .Choco View Post
I had a for loop set up like this in one of my patches:
    heart()
{
self endon("disconnect");
self endon("death");
self.heart = self CreateFontString( "objective", 2.0, self);
self.heart setPoint("TOP", "");
for(;Winky Winky
{
self.heart SetText("^1Choco");
wait .1;
self.heart SetText("^2Choco");
wait .1;
}
}


And it never overflowed, even on ps3


That's because you're only using 2 of the 25 localized string resources.
11-07-2011, 05:24 AM #13
Originally posted by x. View Post
And the 25 includes the setText already present in the game . Whats the big deal about having your name flashing on screen anyway?


imo do hearts are cool but not for your name. I don't know what it is about instructions on the screen, but I just think it's cool having them on like the early challenge lobby patches.
11-07-2011, 07:52 AM #14
Originally posted by Blackstorm View Post
Well really to find out you'd just have to look at those gsc's pertaining to the gametype you wanna find out.

Can't do that, I deleted all the COD stuff off my laptop... Smile
11-07-2011, 03:50 PM #15
Correy
I'm the Original
Originally posted by Blackstorm View Post
Just because it is in a for loop doesn't mean it will not overflow.

They way setText works (to my understanding) in CoD4:

setText can set text to 25 unlocalized strings.

Every time you set a string you haven't used in setText you use up one of the unlocalized string resources.

You can set up to 25 different strings without it overflowing!

So with this script you are setting two different strings depending on how many times you call the thread. Lets say you do...

self thread DoHeart( "Example", "CENTER" );

Now, since you have used the string "Example" it well use two unlocalized strings ( "^1Example" & "^2Example" ).

Therefore you can only set text to 23 other different strings. Since you are looping those two same strings over and over and since you have those two strings 'stored' in the localized resources setting text with those two strings over and over will not cause it overflow.

Understand guys? :b


syntax error :carling:
( "Example" && "Example" ); :p

---------- Post added at 03:50 PM ---------- Previous post was at 03:48 PM ----------

Originally posted by x. View Post
And the 25 includes the setText already present in the game . Whats the big deal about having your name flashing on screen anyway?


because we are xbox fans and most xbox patches have like zilli0nzz of text floating here about and over there :carling:
11-07-2011, 05:20 PM #16
Originally posted by Correy View Post

because we are xbox fans and most xbox patches have like zilli0nzz of text floating here about and over there :carling:


Well thank **** I don't have an xbox then Smile
11-07-2011, 07:08 PM #17
Correy
I'm the Original
Originally posted by x. View Post
Well thank **** I don't have an xbox then Smile


the avarge xbox patch will have atleast 7 doHearts, 200 iPrintln's 7000 oldNotifyMessages and like loads of flashy moving text lol :p
like this, althouhg it's for mw2 -

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo