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-13-2009, 10:00 AM   #31
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

What about auras and stun? Are you also going to make them?
__________________
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
Sponsored Links - Login to hide this ad!
Old 09-13-2009, 12:09 PM   #32
DanThanh
User
 
DanThanh's Avatar
 
Join Date: Apr 2009
Posts: 137

Submissions (1)

DanThanh has little to show at this moment (7)

Send a message via Yahoo to DanThanh
Default

The thing i like is all Dusk's systems are convenient and comprehensive following by good samples !
__________________
DanThanh is offline   Reply With Quote
Old 09-13-2009, 02:02 PM   #33
Rising_Dusk
Obscurity, the Art


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

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 Flame_Phoenix
What about auras and stun? Are you also going to make them?
Auras are something that I find don't require a custom buff system even. Just add a dummy tornado aura to a unit and uh, voillah, you've got your custom aura with whatever range and stuff you wanted. I don't need to trigger that behavior.

Stun is also something I don't think should be covered in a buff system. The buff system is for handling custom aura ability based buffs, not stun. Stun is something that should have its own library. (And I do plan to submit one soon)
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-13-2009, 05:24 PM   #34
Themerion
Brahms-fan
 
Themerion's Avatar
 
Join Date: Jan 2006
Posts: 641

Submissions (2)

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

Default

I like this approach. Simple, clean, and non-oop (remember, Warcraft jass is not oop).

Well done!

---
EDIT
---

Just to check...
Table:
//* In order to make a buff work, one must first create a custom aura ability in
//* the Object Editor and a custom buff for that aura. The raw ids for these
//* objects need to be suppled to the IBS via the DefineBuffType function.
=>Script-disabled Spellbook
Right? (or can it be done in a simpler manner)
__________________
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 : 09-14-2009 at 09:13 PM.
Themerion is offline   Reply With Quote
Old 09-16-2009, 07:39 AM   #35
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

Thanks Rising, this system is very useful indeed. Will use it I think.

There are still room for improvements:
What about making these:

Collapse JASS:

function UnitAddBuffPermanent takes unit source, unit target, integer btype, ...

function GroupAddBuffPermanent takes group allUnits, unit source, integer btype, ...

function GroupAddBuffTimed takes unit source, unit target, integer btype, ..., real duration


Also, if you don't do it, I might do an additional library with the ability to protect buffs.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 09-16-2009 at 07:41 AM.
Anachron is offline   Reply With Quote
Old 09-16-2009, 01:33 PM   #36
Rising_Dusk
Obscurity, the Art


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

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 Themerion
Right? (or can it be done in a simpler manner)
You don't need a script disabled spellbook, just base your aura ability on Tornado Slow Aura which already doesn't have an icon.
Quote:
Originally Posted by Anachron
There are still room for improvements:
What about making these:
I do not like the group buff addition functions you have suggested. All the function would do is clone the group and FirstOfGroup loop through it and then restore the group at the end. Really, this is limited in application, because in many cases you will want to do more than just add the buff to a group. You will want to deal damage, play a special effect (could be on onAdd), move the unit, or do something else to the units affected. If you did GroupAddBuffTimed, then you'd be looping through the group twice to accomplish those things, which is inefficient. It is not difficult to just FirstOfGroup loop through the group on your own and do everything you need in one fell swoop, so I strongly recommend doing that.

UnitAddBuffPermanent is a reasonable request, though. What sort of behavior would you want it to have? Persistence on death is rather lame, otherwise you would just add the aura ability to the unit and wouldn't want UnitAddBuff in the first place. I think just having a buff that ended on death with 'infinite' duration would suffice.
Quote:
Originally Posted by Anachron
Also, if you don't do it, I might do an additional library with the ability to protect buffs.
"Protect" buffs?
__________________

Last edited by Rising_Dusk : 09-16-2009 at 01:34 PM.
Rising_Dusk is offline   Reply With Quote
Old 09-16-2009, 01:57 PM   #37
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:
UnitAddBuffPermanent is a reasonable request, though. What sort of behavior would you want it to have? Persistence on death is rather lame, otherwise you would just add the aura ability to the unit and wouldn't want UnitAddBuff in the first place. I think just having a buff that ended on death with 'infinite' duration would suffice.
You should atleast make it possible to add a check condition that is runned for checking if the buff can be removed. Like:
Only exists till unit has 100 mana!
Something like this.

Also, permanent buffs could be ver y useful indeed, for example they last until a unit is getting hit, attacked, dead, or has attacked. There are many uses of this. Its just one more native function. And I would highly recommend it.

Oh, before I forgot is: Auras are an horrible way to add buffs! They are delayed, bug and ofcourse, are limited in its use. (Since we can't have endless auras)

Quote:
"Protect" buffs?
Yeah, buffs which can not be removed, until something is met. Basicly, I would like to add a condition (as above) to check whether a buff can be removed.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 09-16-2009 at 01:58 PM.
Anachron is offline   Reply With Quote
Old 09-16-2009, 02:25 PM   #38
Rising_Dusk
Obscurity, the Art


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

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
You should atleast make it possible to add a check condition that is runned for checking if the buff can be removed. Like:
Only exists till unit has 100 mana!
Something like this.
Uh, no, that shouldn't be done by the system, because the user would do that here:
Collapse JASS:
scope MyScope
//...Stuff
private function PeriodicCallback takes nothing returns nothing
    local dbuff db = GetEventBuff()
    if GetUnitState(db.target, UNIT_STATE_MANA) >= 100 then
        //Omg buff should be removed
        call UnitRemoveBuff(db.target, db.btype)
    endif
endfunction
endscope
Quote:
Originally Posted by Anachron
Also, permanent buffs could be ver y useful indeed, for example they last until a unit is getting hit, attacked, dead, or has attacked. There are many uses of this. Its just one more native function. And I would highly recommend it.
It's not a native, and I already agreed with you that they'd be useful. I asked you what behavior you'd want them to have.
Quote:
Originally Posted by Anachron
Oh, before I forgot is: Auras are an horrible way to add buffs! They are delayed, bug and ofcourse, are limited in its use. (Since we can't have endless auras)
...Auras are how this system and all buff systems work. They are not limited, they are not delayed (they apply the buff instantly), and you can have endless auras on a unit..
Quote:
Originally Posted by Anachron
Yeah, buffs which can not be removed, until something is met. Basicly, I would like to add a condition (as above) to check whether a buff can be removed.
Well, obviously you'd create a wrapper unique to your map for UnitRemoveBuff to accomplish that, since there are thousands of conditions you could want to meet, each potentially firing on a different event.

Of course, you could also save a struct inside the db.level member of the dbuff struct, and inside that struct have a boolean on whether a buff can be destroyed or not. (db.level.isDestroyable) Then you could meet your "condition" and set that to true. Just check the boolean before you call UnitRemoveBuff and voillah, done.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-16-2009, 02:32 PM   #39
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:
It's not a native, and I already agreed with you that they'd be useful. I asked you what behavior you'd want them to have.
Behavior? Just add an boolean isPermanent.

Quote:
...Auras are how this system and all buff systems work. They are not limited, they are not delayed (they apply the buff instantly), and you can have endless auras on a unit..

O.o really? Heared about unit aura stack bug, a few times. So kewl, just learned again something new.
__________________
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-16-2009, 02:42 PM   #40
Rising_Dusk
Obscurity, the Art


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

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
Behavior? Just add an boolean isPermanent.
Behavior in the sense of how they should act, be overwritten, etc. That boolean would be lame, I'd rather just have .duration = DURATION_INFINITE (where that constant is defined arbitrarily high, or possibly negative so it's out of bounds for the user to use). This'd be a better approach since then I wouldn't have to bloat the struct with more variables. (If you really wanted, could add a method for .isPermanent that returns .duration == DURATION_INFINITE)

The only concern I have is that a permanent buff wouldn't be able to be overwritten without removing it first. The default buff behavior for buff overwriting is only such that longer duration buffs overwrite shorter duration ones. However, since this is INFINITE (logically), nothing could overwrite it.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-16-2009, 02:44 PM   #41
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
The only concern I have is that a permanent buff wouldn't be able to be overwritten without removing it first. The default buff behavior for buff overwriting is only such that longer duration buffs overwrite shorter duration ones. However, since this is INFINITE (logically), nothing could overwrite it.
It can not be overwritten, aslong as you don't explicitly call it.

Collapse JASS:
call ApplyTimedBuffOverwrite(samebuff, sameunit)

Edit: to the infinitive thing: Umm well, if you want.
I would simply suggest adding one more boolean, so you even don't have to decrease the amount.

But, its up to you.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 09-16-2009 at 02:45 PM.
Anachron is offline   Reply With Quote
Old 09-16-2009, 02:49 PM   #42
Rising_Dusk
Obscurity, the Art


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

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

Well, hrm, there are many implementations for this. I will think about it and try to come to a conclusion as to which would make life the easiest for the user.
Quote:
Originally Posted by Anachron
Collapse JASS:
call ApplyTimedBuffOverwrite(samebuff, sameunit)
Man, just arbitrarily adding functions to the system is about as counter-intuitive as possible. The idea is to have fewer things the typical user of the system will have to memorize. Two additional booleans for something that should be simple is blah.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-16-2009, 02:55 PM   #43
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:
Man, just arbitrarily adding functions to the system is about as counter-intuitive as possible. The idea is to have fewer things the typical user of the system will have to memorize. Two additional booleans for something that should be simple is blah.
You don't help users by ordering them to create their own functions which could be easily done with your system. Also, functions are all optional. You don't need to use all of them. And, with the possibly of making more, functions offer most users the ability to use the system not only for what its built, but also for a few other things. But simply making 2 functions in a system which for example can revive and kill units is awful, and I guess you also enjoy a few more functions if its what you need.

And since those functions I was talking about are optional and a good way to remove work of the user, I guess its nothing to complain about.
__________________
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, 10:32 AM   #44
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

Sorry for not toying with the system demo map first ^^.

So say if we use an aura to apply a buff (In the case where... you got many different types of slows for example) by setting it's duration via <structname>.duration and making the buff a periodic one. Will this system remove the buff at the end of the duration? Ofc as the user I guess we will have to remove the aura ability that is applying the buff aye?

-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-17-2009, 11:46 AM   #45
Rising_Dusk
Obscurity, the Art


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

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

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)
__________________
Rising_Dusk 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 10:05 PM.


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