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 > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-31-2009, 10:26 PM   #1
thehellman
User
 
Join Date: Jan 2006
Posts: 158

Submissions (2)

thehellman has little to show at this moment (4)

Default What does 'static' do?

I tried looking through JASSHelper but I still don't quite get what the term static does in a struct.

In normal programming it means like makes the entire program have access to that method/variables. But I'm confused it's purpose in a struct.

If anyone would be so kind as to tell me when it comes in handy?
thehellman is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-31-2009, 10:36 PM   #2
thehellman
User
 
Join Date: Jan 2006
Posts: 158

Submissions (2)

thehellman has little to show at this moment (4)

Default

I also have 2 other unrelated questions:

1) What's the best way to keep a units health at 1 (such as disabling health regeneration) and without the use of a timer.
2) Do item abilities stack? (Example, if I put on Item Armor Bonus that adds +4 armor, if I add another ability off the same base Item Armor Bonus, but instead it -4 armor, will the net result be 0 armor gained)
thehellman is offline   Reply With Quote
Old 12-31-2009, 11:03 PM   #3
Here-b-Trollz
Corkscrew Chainsaw!!!
 
Join Date: Jun 2006
Posts: 711

Here-b-Trollz has a spectacular aura about (149)

Hero Contest #2 - 2nd Place

Default

It designates a specific character as static; they cannot undergo character development for the course of the novel.
Expand ???:
Expand A better way to explain:

Static makes it essentially a global with the STRUCTNAME.<blah> prefix. It's not instance specific. There's only one.

Wikipedia: Class variable
Yahoo Answers: What's the difference between static and instance members?

---

You can stack item abilities if they are different abilities;
Example:
Ability A (+4 armor)
Ability B (+4 armor)
Ability C (-4 armor)

A + C = 0
A + B = 8
A + A = 4
Ax10 = 4
A + B + A + C = 4
B + B + B + B + C + C = 0

BonusMod (item abilities)

---

Keeping a unit from regenerating HP could be done with a -100% Unholy Aura Regen, but keeping a unit's HP at exactly 1 is an entirely different thing (assuming you don't want it to die when it takes damage) and therefore DOES require a timer, or a Resistant Skin -50000 ability or Elune's Grace -100% ability. Maybe. This last one is speculation on my part because I don't feel like opening the editor.
__________________
By reading this signature, you agree that I cannot be held accountable for anything that I might say or do.
Here-b-Trollz is offline   Reply With Quote
Old 12-31-2009, 11:34 PM   #4
thehellman
User
 
Join Date: Jan 2006
Posts: 158

Submissions (2)

thehellman has little to show at this moment (4)

Default

Quote:
Originally Posted by Here-b-Trollz
It designates a specific character as static; they cannot undergo character development for the course of the novel.
Expand ???:
Expand A better way to explain:

Static makes it essentially a global with the STRUCTNAME.<blah> prefix. It's not instance specific. There's only one.

Wikipedia: Class variable
Yahoo Answers: What's the difference between static and instance members?

---

You can stack item abilities if they are different abilities;
Example:
Ability A (+4 armor)
Ability B (+4 armor)
Ability C (-4 armor)

A + C = 0
A + B = 8
A + A = 4
Ax10 = 4
A + B + A + C = 4
B + B + B + B + C + C = 0

BonusMod (item abilities)

---

Keeping a unit from regenerating HP could be done with a -100% Unholy Aura Regen, but keeping a unit's HP at exactly 1 is an entirely different thing (assuming you don't want it to die when it takes damage) and therefore DOES require a timer, or a Resistant Skin -50000 ability or Elune's Grace -100% ability. Maybe. This last one is speculation on my part because I don't feel like opening the editor.

Okay thanks. I had the Unholy Aura idea in mind but wanted some confirmation. (And no, the unit will be invulnerable so it can't take damage)
thehellman is offline   Reply With Quote
Old 01-01-2010, 02:26 AM   #5
thehellman
User
 
Join Date: Jan 2006
Posts: 158

Submissions (2)

thehellman has little to show at this moment (4)

Default

I just tested it. It's actually killing the unit, and causing an infinite loop. It's set to -1.00 and percent bonus is on true.
thehellman is offline   Reply With Quote
Old 01-01-2010, 02:10 PM   #6
Themerion
Brahms-fan
 
Themerion's Avatar
 
Join Date: Jan 2006
Posts: 642

Submissions (2)

Themerion has a spectacular aura about (114)Themerion has a spectacular aura about (114)Themerion has a spectacular aura about (114)Themerion has a spectacular aura about (114)

Default

Why wouldn't you want to use timers...?

Anyway, if you can store the unit's current max hp, you can use .: UnitMaxState :. to set its max hp to 1 (then reset it to the stored value at will).
__________________
Submissions::
(v)JASS Tutorial
Covers how to make fast and safe coding for common tasks in vJASS/JASS.
Creep Respawn System
It has never been easier to respawn creep groups...

Last edited by Themerion : 01-01-2010 at 02:10 PM.
Themerion is offline   Reply With Quote
Old 01-03-2010, 09:31 PM   #7
thehellman
User
 
Join Date: Jan 2006
Posts: 158

Submissions (2)

thehellman has little to show at this moment (4)

Default

Yeah I ended up using a timer for this. Thanks for the help

/close
thehellman is offline   Reply With Quote
Old 01-04-2010, 06:00 AM   #8
Tyrande_ma3x
User
 
Tyrande_ma3x's Avatar
 
Join Date: Feb 2009
Posts: 185

Submissions (1)

Tyrande_ma3x is on a distinguished road (12)

Default

> 1) What's the best way to keep a units health at 1 (such as disabling health regeneration) and without the use of a timer.
Use Slow Poison on the unit.

Last edited by Tyrande_ma3x : 01-04-2010 at 06:00 AM.
Tyrande_ma3x 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 07:47 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