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-06-2011, 10:24 PM #2
Taylor
Former Black Knight.
Nice, Good Work Man
11-06-2011, 11:24 PM #3
Woof
...hmm
Originally posted by .Choco View Post
.


The reason its not a overflow is because when you set the text of the element its only taking one value.
There is a reason this would be unstable though, being the fact your starting a new class each time it loops.

I would use:
    

DoHeart(text, align, relative, x, y)
{
size = 0;
self endon("death");
for(;size > 1; size--)
{
if(isDefined(heart))
self.heart destroy();
heart = self createFontString("DAStacks", size, self);
heart SetPoint(align, relative, x, y);
heart setText("^" + randomInt(2) + text);
size += 1;
wait 0.2;
}
}

Winky Winky

The following user thanked Woof for this useful post:

Choco
11-07-2011, 12:15 AM #4
And DAStacks is not supported. It is giving you the Default text instead..
11-07-2011, 12:18 AM #5
Blackstorm
Veni. Vidi. Vici.
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

The following user thanked Blackstorm for this useful post:

angelpig1
11-07-2011, 12:19 AM #6
lZombieGodl
Gym leader
nice, but imo doHearts just make the game lag so much :( :n:
11-07-2011, 12:20 AM #7
Originally posted by Blackstorm View Post
Just because it is in a for loop doesn't mean it will 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
And the 25 includes the setText already present in the game . Whats the big deal about having your name flashing on screen anyway?
11-07-2011, 12:26 AM #8
Blackstorm
Veni. Vidi. Vici.
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?


The 25 doesn't include the ones in the game, because the ones in the game (most I think?) are all localized (they should be? :O). And yeah I agree, that's childish :p
11-07-2011, 12:29 AM #9
Originally posted by Blackstorm View Post
The 25 doesn't include the ones in the game, because the ones in the game (most I think?) are all localized (they should be? :O). And yeah I agree, that's childish :p
I think it does include them, why else would it overflow easier in SnD than TDm or FFA ?

Ask Amanda, she knows all about this..
11-07-2011, 12:32 AM #10
Blackstorm
Veni. Vidi. Vici.
Originally posted by x. View Post
I think it does include them, why else would it overflow easier in SnD than TDm or FFA ?

Ask Amanda, she knows all about this..


Well really to find out you'd just have to look at those gsc's pertaining to the gametype you wanna find out. I know the count down is unlocalized for a fact :b

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo