wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 08-10-2008, 05:43 PM   #1
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default FadingText

DioD posting his weird profile version of creating texttags got me checking the script section for this wonderful function. I was surprised to find that it isn't there -- So here I am.

This function creates a texttag that cleans itself up happily over time, rising and fading like pretty texttags do. An example usage is below, 10 is the default font for fading text. I figure it's a pretty basic function with pretty basic applications, but it's one of those functions I find I use in every map I've ever made so I imagine it's that useful to others as well.
Collapse JASS:
function FadingText takes player p, string msg, integer red, integer green, integer blue, real x, real y, real vel, real fade, real life, real size returns nothing
    local texttag t = CreateTextTag()
    set size = size * 0.024 / 10
    call SetTextTagText(t, msg, size)
    call SetTextTagPos(t, x, y, 0.00)
    call SetTextTagColor(t, red, green, blue, 255)
    call SetTextTagVelocity(t, 0, vel)
    if p != null then
        call SetTextTagVisibility(t, (GetLocalPlayer() == p))
    endif
    call SetTextTagFadepoint(t, fade)
    call SetTextTagLifespan(t, life)
    call SetTextTagPermanent(t, false)
    set t = null
endfunction
Collapse Example Use:
call FadingText(Player(3), "I am a texttag!", 255, 255, 255, x, y, 0.04, 2, 5, 10)
__________________
Rising_Dusk is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 08-10-2008, 06:43 PM   #2
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

It sux, too many parameters.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 08-10-2008, 07:21 PM   #3
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

I already submitted one just like this, but w/ less parameters... but since it was part of the ugly "pack" (what was I thinking?), it got tossed away without a second thought.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt


Last edited by darkwulfv : 08-10-2008 at 07:23 PM.
darkwulfv is offline   Reply With Quote
Old 08-10-2008, 08:19 PM   #4
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by cohadar
It sux, too many parameters.
Yeah, that's a really good reason for it sucking...

Dusk, have you considered using ARGB for this? I think it's a good standard for colours and should be used, at least I intend to use it in the future.
__________________
Anitarf is offline   Reply With Quote
Old 08-10-2008, 10:51 PM   #5
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

This is a pretty standardized function though, Wulf. Stuff like this and SimError and so forth can work on their own. However, a script resource that says "Bunch of useful functions" lacks description and so people don't get as much out of it. A 'FadingText' resource could then be viable where a pack of functions is not.

And ARGB is something I'm unfamiliar with on how to use -- And Vex isn't the best at explaining sometimes. :p I could make a version with it, though.
__________________
Rising_Dusk is offline   Reply With Quote
Old 08-10-2008, 11:53 PM   #6
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Yeah yeah I know. Your version is better anyways, mine was tailored for my use =P
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Old 08-11-2008, 12:39 AM   #7
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Quote:
Originally Posted by Anitarf
Yeah, that's a really good reason for it sucking...

Of course it is.
When a function has too many params it means that it is overgeneralized.
Divide and Conquer is the fundamental principle of programming.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

Last edited by cohadar : 08-11-2008 at 12:39 AM.
cohadar is offline   Reply With Quote
Old 08-11-2008, 12:43 AM   #8
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

I don't think 11 is too many. Besides, if you want to blame anyone, blame Blizzard for giving texttags so many different things you can change about them.
__________________
Rising_Dusk is offline   Reply With Quote
Old 08-11-2008, 04:35 AM   #9
DioD
obey
 
DioD's Avatar
 
Join Date: Feb 2006
Posts: 1,532

Submissions (4)

DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)

Send a message via ICQ to DioD
Default

This function much more weird then my, you force user to pass many useless params.
DioD is offline   Reply With Quote
Old 08-11-2008, 04:39 AM   #10
Szythe
User
 
Join Date: Sep 2006
Posts: 320

Submissions (3)

Szythe has a spectacular aura about (143)

Spell Making Session 11 WinnerSmiley contest 4th and 5th place.Mapping Contest Third PlaceSpell making session 08

Default

I don't see a single param with no use.
Szythe is offline   Reply With Quote
Old 08-11-2008, 05:03 AM   #11
DioD
obey
 
DioD's Avatar
 
Join Date: Feb 2006
Posts: 1,532

Submissions (4)

DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)

Send a message via ICQ to DioD
Default

Text tags created to indicate something, like bounty, damage or income, you actually do not need soo many options, you wont use them anyway.

You will choose text tag options for your event and will use them again and again with out any changes.

Size will always be 0.024, color always red.
DioD is offline   Reply With Quote
Old 08-11-2008, 05:46 AM   #12
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by DioD
Text tags created to indicate something, like bounty, damage or income, you actually do not need soo many options, you wont use them anyway.
I do. I use all 12 player colors in my map and I also use different sizes for different floating text. Maybe it's not useful for you, but it's been really useful for me.
__________________
Rising_Dusk is offline   Reply With Quote
Old 08-11-2008, 05:47 AM   #13
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

Quote:
Size will always be 0.024, color always red.
Double wrong. I, as a matter of fact, change everything about a texttag except duration, velocity, and fadepoint, because those are static in my situations and I like the way they look. Everything else (color, size, position) is dynamic, and should be.

11 params is not bad at all. Is it a lot? Yes. Is it necessary? Depends. If you don't need one, it doesn't take a genius to remove it.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Old 08-11-2008, 08:03 AM   #14
Fulla
Evil Overlord
 
Fulla's Avatar
 
Join Date: Jan 2006
Posts: 1,416

Submissions (3)

Fulla has a spectacular aura about (79)Fulla has a spectacular aura about (79)Fulla has a spectacular aura about (79)

Default

Well at any rate it's good to have it here for ppl to base their own custom functions on.
I don't actually use this function, I just make my own custom ones for each purpose,
Collapse JASS:
call GoldTextTag
Collapse JASS:
call CriticalTextTag
etc. etc.
__________________

Last edited by Fulla : 08-11-2008 at 08:06 AM.
Fulla is offline   Reply With Quote
Old 08-11-2008, 02:08 PM   #15
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

This was nice before blizz added the Fade natives, I think the long parameter list makes it more complicated than calling the natives alone. I guess some people would prefer it somehow, so I approve it, at least it works as a documentation on how to make fading things.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:46 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2020, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services