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-27-2008, 12:48 AM   #1
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 ExTextTag

This version not using triggers to pass values inside.
And uses textmacro for param settings.

Collapse JASS:
library ExTextTag initializer Init //requires Gx

globals

texttag Gxs_texttag

endglobals

//  Profile based Text Tag Creator.
//  v2.0
//
//  PURPOUSE:
//  > Emulation of ingame texttags (like mana burn or critical strike).
//  
//  CREDITS:
//  > Blizzard for miscdata.txt, vJass creators for extended syntax.
//
//  HOW TO IMPORT:
//  > Copy&Paste entire code to any trigger or map header
//
//  NOTE:
//  > You will need vJass editor for globals and library declaration.

//This is database functions block.
struct Params

 integer R
 integer G
 integer B
 real    V
 integer L
 integer F
 static integer COUNT = 0
 
endstruct

function LoadParams takes integer r,integer g,integer b,real v,integer l,integer f returns nothing
  local Params A = Params.COUNT
  set A.R = r
  set A.G = g
  set A.B = b
  set A.V = v
  set A.L = l
  set A.F = f
  set Params.COUNT = Params.COUNT + 1
endfunction

//! textmacro AddProfile takes NAME,R,G,B,V,I,F
globals
    
   integer $NAME$
    
endglobals

set $NAME$ = Params.COUNT
call LoadParams($R$,$G$,$B$,$V$,$I$,$F$)
//! endtextmacro

//    call CreateTextTagEx("HAHA",0.0,0.0,true,GOLD)

function CreateTextTagEx takes string Text,real X,real Y,boolean Vision, integer Profile returns nothing
    //Generic
    local Params A = 0
    
    if Profile < Params.COUNT and Profile >= 0 then
    set A = Profile
    endif
    
    set Gxs_texttag         = CreateTextTag()
    call SetTextTagText      (Gxs_texttag, Text, 0.024)
    call SetTextTagPos       (Gxs_texttag, X, Y, 0.0  )
    call SetTextTagVisibility(Gxs_texttag, Vision     )
    call SetTextTagPermanent (Gxs_texttag, false      )
    
    call SetTextTagColor     (Gxs_texttag,A.R,A.G,A.B,255)
    call SetTextTagVelocity  (Gxs_texttag,0,A.V)
    call SetTextTagLifespan  (Gxs_texttag,A.L)
    call SetTextTagFadepoint (Gxs_texttag,A.F)
    
endfunction

private function Init takes nothing returns nothing

    //! runtextmacro AddProfile("NULL","255","255","255","0.04","3","2")
    //! runtextmacro AddProfile("GOLD","225","220","0","0.03","2","1")
    //! runtextmacro AddProfile("LUMBER","0","200","80","0.03","2","1")
    //! runtextmacro AddProfile("BOUNTY","225","220","0","0.03","3","2")
    //! runtextmacro AddProfile("MISS","255","0","0","0.03","3","1")
    //! runtextmacro AddProfile("SS","160","255","0","0.04","5","2")
    //! runtextmacro AddProfile("CS","255","0","0","0.04","5","2")
    //! runtextmacro AddProfile("MB","82","82","255","0.04","5","2")

endfunction

endlibrary

Last edited by DioD : 08-27-2008 at 01:09 AM.
DioD is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 08-28-2008, 03:59 PM   #2
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

May I ask how are you managing to use the profiles now? For example, how would I show a texttag using the Gold profile?

Are users expected to use the textmacro? I think that would overcomplicate 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
Old 08-28-2008, 11:32 PM   #3
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

Code:
    //"Name","Red","Green","Blue","Velocity","Lifespan","Fadepoint"
    //! runtextmacro AddProfile("GOLD","255","220","0","0.04","5","2")
    call CreateTextTagEx("Text",X,Y,true,GOLD)

Every profile needs global variable, without textmacro user will be forced to create globals self.
DioD is offline   Reply With Quote
Old 11-19-2008, 03:55 AM   #4
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

So... this seems pretty much okay to me, any objections?
On a related note, this could use ARGB, if you really wanted to. Dunno if that would really be good or bad, though.

Following the new rules, if you don't update or respond to this thread within 7 days, this will be graveyarded.
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.

Last edited by Pyrogasm : 11-19-2008 at 03:55 AM.
Pyrogasm is offline   Reply With Quote
Old 11-22-2008, 10:25 PM   #5
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 "system" using constants only, there is no need of ARGB, but i can change\fix\add anything if needed. (including argb struct loading support).
DioD is offline   Reply With Quote
Old 11-22-2008, 11:20 PM   #6
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

It was just a "you could do this, but it doesn't really matter if you do or not" statement. As is, it's just fine!
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm 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 01:10 AM.


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

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