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 > Systems
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 09-17-2009, 11:49 AM   #46
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Originally Posted by Rising_Dusk
Yes, the system automatically removes the buff and aura ability at the end of its duration. However, changing your <structname>.duration will not actually do anything on its own. I think I will probably add a new method for .setDuration, since it has to restart the timer and stuff and the user really doesn't have the capacity to do so on their own. (Callback is private)
Why not adding method operator and use the set buff:duration = X, which is runing a method that restarts timer?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-17-2009, 11:52 AM   #47
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

At that point it reduces to coding style, so who cares?
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-17-2009, 11:56 AM   #48
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Originally Posted by Rising_Dusk
At that point it reduces to coding style, so who cares?
Why do you want to create function calls by user if you can avoid it?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 09-17-2009, 12:01 PM   #49
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

Operators run those function calls anyways, since there is >1 action that needs be done... Operators aren't some mystical magick that removes the calling of functions, they're basically just a hot-fix syntax wrapper for them.
__________________

Last edited by Rising_Dusk : 09-17-2009 at 12:06 PM.
Rising_Dusk is offline   Reply With Quote
Old 09-17-2009, 12:04 PM   #50
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Originally Posted by Rising_Dusk
Operators run those function calls anyways, since there is >1 action that needs be done... Operators aren't some mystical magick that removes the calling of functions, they're basically just a hot-fix syntax wrapper for them.
Yes, but is
Collapse JASS:
set buff:duration = newBuffDuration

not better as

Collapse JASS:
call buff.setNewDuration(newBuffDuration)

?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 09-17-2009, 12:07 PM   #51
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

Is it? Maybe for someone who likes that coding style, sure. In your example it's 6 characters shorter, but I don't like your example. I prefer mine.
Collapse JASS:
call buff.setDur(newBuffDuration)
Suddenly my example is shorter. :)
__________________

Last edited by Rising_Dusk : 09-17-2009 at 12:08 PM.
Rising_Dusk is offline   Reply With Quote
Old 09-17-2009, 12:12 PM   #52
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Originally Posted by Rising_Dusk
Is it? Maybe for someone who likes that coding style, sure. In your example it's 6 characters shorter, but I don't like your example. I prefer mine.
Collapse JASS:
call buff.setDur(newBuffDuration)
Suddenly my example is shorter. :)
W/E. You should atleast make the posability to use that operators, since you release the system for public, and not for your use only.

Sorry for asking / discussion that much, just wanna learn stuff you know! ;)
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 09-17-2009, 12:16 PM   #53
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 Anachron
W/E. You should atleast make the posability to use that operators, since you release the system for public, and not for your use only.
I don't think it wise for a system to have (internally) different syntaxes for the same action, it can get confusing for the user. "So wait, what is the difference between set buff:duration = 5. and call buff.setDur(5.)?" That sort of thing can be avoided by just having one of the options.
Quote:
Originally Posted by Anachron
Sorry for asking / discussion that much, just wanna learn stuff you know! ;)
It's fine. You haven't gotten annoying yet. :p
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-17-2009, 12:21 PM   #54
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
I don't think it wise for a system to have (internally) different syntaxes for the same action, it can get confusing for the user. "So wait, what is the difference between set buff:duration = 5. and call buff.setDur(5.)?" That sort of thing can be avoided by just having one of the options.
Hmm, I know some good systems which also have this. For example a UnitProporities systems which works as following:

either
Collapse JASS:
call SetUnitHP(unit, i)

or
Collapse JASS:
set unit:hp = i

Quote:
It's fine. You haven't gotten annoying yet. :p
Nice, sounds fine. Umm and even if its a bit offtopic, can you take a look at my systems and help me there? (Critique, what to do better, and that stuff)
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 09-17-2009, 12:35 PM   #55
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 Anachron
For example a UnitProporities systems which works as following:
Yes, and before Cassiel deleted UI from wc3c, he had received numerous questions as to why that existed.
Quote:
Originally Posted by Anachron
Umm and even if its a bit offtopic, can you take a look at my systems and help me there? (Critique, what to do better, and that stuff)
All in due time. It takes time going over someone's code that you're unfamiliar with and then providing feedback that isn't useless or already addressed in obscure ways. I'll get to stuff, I usually dedicate my weekends to it. (Ugh...)
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-18-2009, 03:34 AM   #56
Av3n
Roar!
 
Av3n's Avatar


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

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

Thanks Dusk! This system will become very useful for me then.

-Av3n

EDIT: Is it possible to make a buff upgradable if the current buff's level is lower than the one that could be applied? From a glance of the functions provided there isn't an option to do so... If you do implement it make it a boolean argument where true == upgrades buff if the current buff is a lower level than the buff being applied and false == nothing happens if a higher level of a buff is applied.
__________________

Thanks to FatherTime for the sig
.:
Current ProjectsSubmissions
Power of CorruptionMy Terrain
The Black RoadMy Resources
Strikeforce
Twitter

Last edited by Av3n : 09-18-2009 at 05:09 AM.
Av3n is offline   Reply With Quote
Old 09-18-2009, 07:42 PM   #57
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 Av3n
EDIT: Is it possible to make a buff upgradable if the current buff's level is lower than the one that could be applied? From a glance of the functions provided there isn't an option to do so... If you do implement it make it a boolean argument where true == upgrades buff if the current buff is a lower level than the buff being applied and false == nothing happens if a higher level of a buff is applied.
That is something I considered as well when making the system. Currently, the only way to refresh a buff is to apply it with a duration greater than the duration currently on the unit (this is how standard WC3 renders buffs).

The thing is, right now a user may store either a struct or an integer in the level field, so using it as a check for refreshing is questionable. Furthermore, does the case example you use even make sense?
  • 10s buff at level 1 is replaced by a 2s buff at level 2.
Is that behavior as you'd really want it? When would it make sense for that to be done? If you can seriously find a use for that, I will update to accommodate it.

If I do expand level to a means of refreshing the buff, though, then I will need to add another value to the dbuff struct so users can hook their own structs to it and stuff.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-18-2009, 09:54 PM   #58
Av3n
Roar!
 
Av3n's Avatar


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

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

The case example doesn't work as well as I sort it would.
  • So say the caster just hit someone with the level 1 buff that lasts for 15 seconds.
  • That caster "somehow" levels up and improves the buff ability to level 2
  • The caster hits the same target with the level 2 buff but this is what I want to happen
Your system already refreshes the duration of a buff when the buff is reapplied aye?
What I want it to do is if current buff level is lower (<) applied buff level that the buff's level will change the to higher one. Ofc I think it would be better as a boolean if the user didn't want this type of behavior to happen.

I think that clears it up a little bit.

-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 09-18-2009, 10:05 PM   #59
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 Av3n
Your system already refreshes the duration of a buff when the buff is reapplied aye?
Yap, so:
Quote:
Originally Posted by Av3n
What I want it to do is if current buff level is lower (<) applied buff level that the buff's level will change the to higher one.
This already happens if the (higher level) new buff's duration is > old buff. There is a case where it can act a bit wonky, though, I suppose..
  • 10s buff at level 2 is replaced by a 10s buff at level 1 made 1s after initial one.
In that sense the lower buff level prevails, when I suppose it would be intuitive for the higher level one to hold. What are your thoughts on that?

I guess the best question is as follows: in order of importance, what should the system priorities be?
  • Buff Level -> Duration
  • Duration -> Buff Level
  • Duration (Only)
__________________

Last edited by Rising_Dusk : 09-18-2009 at 10:06 PM.
Rising_Dusk is offline   Reply With Quote
Old 09-18-2009, 11:10 PM   #60
Av3n
Roar!
 
Av3n's Avatar


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

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

Quote:
In that sense the lower buff level prevails, when I suppose it would be intuitive for the higher level one to hold. What are your thoughts on that?
When you consider multiple units using the same buff (in my case this doesn't happen) by casting the lvl 2 buff then making it longer with the lvl 1 version shouldn't happen. So when the lvl 1 version is cast the buff's should go to lvl 1 IMO.

Quote:
I guess the best question is as follows: in order of importance, what should the system priorities be?

* Buff Level -> Duration
* Duration -> Buff Level
* Duration (Only)

I think those priorities should be sweet. I'm just wonder how will you handle the Duration -> Buff Level check.

-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
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:27 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