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 12-13-2008, 02:48 PM   #1
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default TTBars

This script was designed to ease access to custom bars out of texttags.

This library uses ARGB and TimerUtils by Vexorian.

Changelog

12/13/08 - Version 1.0
- initial release

02/22/09 - Version 1.0.1
- removed TTBase
- cleaned up the API (removed RemoveGradient and added better encapsulation)
- fixed a bug, where you couldnt add MAX_GRADIENTS gradients
- a few other minor improvements

03/16/2009 - Version 1.1.0
- heavy API changes, mainly in relation to background coloring (uses ARGB now)
- Bars are now initialized to be displayed to all players by default
- Adding no gradients or insufficient gradients is now handled gracefully
- each bar can now have distinct primitive strings ("|" gets converted to "||" automatically to avoid some problems)
- some speed improvements
- documented what i left out initially

03/17/2009 - Version 1.2.0
- more API changes, this time in relation to coloring the Bar.
- Added the SetForeground method and a default gradient parameter to the create method. You can now select a default gradient on a per-bar basis.
- separated the Gradients from the initial TTBar struct. The new struct is called TTGradBar and inherits all members and methods TTBar has.

03/17/2009 - Version 1.3.0
- unified API to use ARGB
- removed parameter of the create method for defining a default gradient. Added a global to fill in that parameter.
- corrected the way SetForeground behaves (in TTGradBar structs). Gradients now take precedence over the color specified by this method.

03/18/2009 - Version 1.3.1
- reordered some methods as to improve efficiency a bit.

07/02/2009 - Version 1.4.0
- some optimization behind the scenes (complexity for creating the text of the bar changed to O(1))
- added interface for using strings to color the foreground of a bar (AddGradientString, SetForegroundString)
- made the primitive char the bar consists of and the number of primitive chars the bar consists of changeable after creating the bar.

07/29/2009 - Version 1.4.1
- a few bugfixes. Thanks to map-maker for reporting them.

09/10/2009 - Version 1.5.0
- Added the ability to fade out bars (which is another way of destroying it).
- Added an additional demonstration for TTBars based on zwiebelchen's recent submission (credits for it go to him)



Expand TTBARS+Credits:

I also attached a testmap.
Type in "-test" to display credits and start testing.

I hope someone needs this.

Deaod
Attached Files
File Type: w3x TTBARS_1.5.0.w3x (44.5 KB, 129 views)

Last edited by Deaod : 09-10-2009 at 08:58 PM. Reason: Updated to 1.5.0
Deaod is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-13-2008, 05:23 PM   #2
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

if Used<99 then

as i know, there is 99 tt started from 0, soo this value must be set to 98

fix.

I tested native tags allocation.

allocation started from 99 and run to 1, after limit hit CreateTextTag returns nulls.

Last edited by DioD : 12-13-2008 at 06:14 PM.
DioD is offline   Reply With Quote
Old 12-13-2008, 08:16 PM   #3
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

so, first ID a texttag gets is 99 and last one is 1? If yes, then this already works.
__________________
Deaod is offline   Reply With Quote
Old 12-13-2008, 10:03 PM   #4
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,153

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

is this system able to block the original wc3 health bars, yet ?
if not, i know there is a way, but i dont remember it atm, was something with an ability ...dunno
akolyt0r is offline   Reply With Quote
Old 12-13-2008, 10:08 PM   #5
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (457)Ammorth is a glorious beacon of light (457)Ammorth is a glorious beacon of light (457)Ammorth is a glorious beacon of light (457)

Default

I wouldn't use this system for health bars, but for some sort of stamina or caster bar (mana maybe?). Cause I think the latest patch has an option to enable health bars (so they are always visible).
__________________
Ammorth is offline   Reply With Quote
Old 12-13-2008, 10:13 PM   #6
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

erm, if you add a locust ability to a unit and then remove it again, no healthbar is displayed.
You could also try to overlay standard healthbars with this, but i dont recommend doing that. Its just too much work.
__________________
Deaod is offline   Reply With Quote
Old 12-13-2008, 11:13 PM   #7
Av3n
Roar!
 
Av3n's Avatar


Project Leader: TBR
Project Member: PoC
 
Join Date: May 2006
Posts: 1,853

Submissions (7)

Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)

Hero #4 extra-official winner2008 Spell olympics - Fire - BronzeHero Contest #3 - 3rd Place

Default

or maybe place it at the feet of the units instead or above the health bar (the height might vary due to different model sizes i think)

-Av3n
__________________

Thanks to FatherTime for the sig
.:
Current ProjectsSubmissions
Power of CorruptionMy Terrain
The Black RoadMy Resources
Strikeforce
Twitter
Av3n is offline   Reply With Quote
Old 12-13-2008, 11:49 PM   #8
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

When i test i don't see any bar, i tried to change the war3 graphic options, but it's still the same, i can see the knight be surrounded with footmen and that's all.
__________________
Cool != Useful
Troll-Brain is offline   Reply With Quote
Old 12-14-2008, 12:40 AM   #9
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

wait, what resolution do you use?
__________________
Deaod is offline   Reply With Quote
Old 12-14-2008, 11:25 AM   #10
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

Quote:
Originally Posted by Deaod
wait, what resolution do you use?
I used 800*600*32 and i also tried 1024*768*32

Could it be like that because i don't use an english warcraft ?
__________________
Cool != Useful
Troll-Brain is offline   Reply With Quote
Old 12-14-2008, 01:06 PM   #11
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

1024*768 is the resolution i use...maybe change the size of the text to 6, i remember that a size of 4 hid them completely (for me).
__________________
Deaod is offline   Reply With Quote
Old 12-14-2008, 01:13 PM   #12
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

I don't want to be the bad guy here but, why do we need these if wc3 engine already provides us with health bars as well ? Besides, this is horrible for the 100 TextTag limit wc3 has (or so I heard).
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 12-14-2008, 01:33 PM   #13
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

wc3 have 99 tags not 100
DioD is offline   Reply With Quote
Old 12-14-2008, 02:19 PM   #14
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

Quote:
Originally Posted by Deaod
1024*768 is the resolution i use...maybe change the size of the text to 6, i remember that a size of 4 hid them completely (for me).

Yes it depends the resolution, for the highest resolution, if i use a size under 8.8 (didn't try more accurate value), i don't see anything.
__________________
Cool != Useful
Troll-Brain is offline   Reply With Quote
Old 12-14-2008, 05:21 PM   #15
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
wc3 have 99 tags not 100
That is irrelevant, it just proofs my point =P

Btw, Diod or Deod !? Blasphemy ! THIS IS WC3C !!!!

=p
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix 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:54 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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