Post: [SCRIPT] Display Text Till Notified
05-31-2011, 09:44 PM #1
Karoolus
I'm the W@W Menu Guy !
(adsbygoogle = window.adsbygoogle || []).push({}); it's actually a rather stupid script
what it does is display a text top of your screen untill you are notified





thread it like this:

    self thread DisplayTillNotified( text you want to show, what notification to wait for);
//example used in the video:
self thread DisplayTillNotified( "Press frag to open the menu", "R2");


the actual function:
    DisplayTillNotified( text, trigger )
{
// background
BG = createIcon( "black", 650, 30 );
BG.hidewheninmenu = true;
BG setPoint( "TOP", undefined, 0, 10 );
BG.alpha = .2;
BG.sort = 0;

// string
string = createFontString( "objective", 1.6 );
string.hidewheninmenu = true;
string setPoint( "TOP", undefined, 0, 10 );
string.sort = 0.5;
string setText( text );
self waittill( trigger );
BG Destroy();
string Destroy();
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to Karoolus for this useful post:

.Kane., Dreamcather, iReset Nigga
05-31-2011, 09:55 PM #2
TheFallen
Former Dark Night
Or to make it more stable do this:
    
DisplayTillNotified( text, trigger )
{
// background
BG = createIcon( "black", 650, 30 );
BG.hidewheninmenu = true;
BG setPoint( "TOP", undefined, 0, 10 );
BG.alpha = .2;
BG.sort = 0;

// string
string = createFontString( "objective", 1.6 );
string.hidewheninmenu = true;
string setPoint( "TOP", undefined, 0, 10 );
string.sort = 0.5;
string setText( text );
self waittill( trigger );
BG.alpha = 0;
string setText("");
}
05-31-2011, 10:05 PM #3
Karoolus
I'm the W@W Menu Guy !
Originally posted by ITheFallenI View Post
Or to make it more stable do this:
    
DisplayTillNotified( text, trigger )
{
// background
BG = createIcon( "black", 650, 30 );
BG.hidewheninmenu = true;
BG setPoint( "TOP", undefined, 0, 10 );
BG.alpha = .2;
BG.sort = 0;

// string
string = createFontString( "objective", 1.6 );
string.hidewheninmenu = true;
string setPoint( "TOP", undefined, 0, 10 );
string.sort = 0.5;
string setText( text );
self waittill( trigger );
BG.alpha = 0;
string setText("");
}


exactly the opposite..
you would create a new HUD element every time you called the function, but never destroy it when it's no longer needed.. which consumes memory while it shouldn't..
destroy them everytime, a lot easier Winky Winky
05-31-2011, 10:28 PM #4
TheFallen
Former Dark Night
Good point. I didn't fully change the code. It's really easy to fix though. You know this could be more stable Winky Winky
05-31-2011, 10:48 PM #5
Karoolus
I'm the W@W Menu Guy !
Originally posted by ITheFallenI View Post
Good point. I didn't fully change the code. It's really easy to fix though. You know this could be more stable Winky Winky


what's not stable about it ? :p
05-31-2011, 11:19 PM #6
TheFallen
Former Dark Night
when u destroy things its like creating things
Originally posted by Karoolus View Post
what's not stable about it ? :p
06-01-2011, 12:09 AM #7
.Kane.
Banned
Originally posted by Karoolus View Post
what's not stable about it ? :p


Yes this is really stupid =D

+Rep anyways.
06-01-2011, 08:36 PM #8
Karoolus
I'm the W@W Menu Guy !
Originally posted by ITheFallenI View Post
when u destroy things its like creating things



uh no ? your function would've created a new string everytime but it wouldn't destroy it, so it's using memory for something that no longer exists..
mine destroys it so the memory that was used by that string is now free again = reduce lag etc

Originally posted by Kane
Yes this is really stupid =D

+Rep anyways.


yeah i have no idea what to write lately so it's just some stupid things.. but hey, it might be stupid to us, but i've noticed that since 1.12 patch on MW2, the WAW section has more readers :p so the WAW newbs might find this useful Winky Winky
06-01-2011, 08:38 PM #9
TheFallen
Former Dark Night
Originally posted by Karoolus View Post
uh no ? your function would've created a new string everytime but it wouldn't destroy it, so it's using memory for something that no longer exists..
mine destroys it so the memory that was used by that string is now free again = reduce lag etc



yeah i have no idea what to write lately so it's just some stupid things.. but hey, it might be stupid to us, but i've noticed that since 1.12 patch on MW2, the WAW section has more readers :p so the WAW newbs might find this useful Winky Winky


Yes, I know my function does that. Like I said, I didn't change the entire code. And why are we still talking about this?
06-01-2011, 08:44 PM #10
Karoolus
I'm the W@W Menu Guy !
Originally posted by ITheFallenI View Post
Yes, I know my function does that. Like I said, I didn't change the entire code. And why are we still talking about this?


i have no idea xD
let's just drop it :p

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo