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 07-20-2007, 01:38 PM   #16
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by PipeDream
Best JASS ever. Amazing job, Anitarf.
Well, you did help. ;)
Quote:
How about GC for IsUnit(Ignored)Dummy
Hmm. It would indeed be faster for many dummy units, doesn't matter much if you only have two though. In many maps, a single dummy caster is enough to cast all supplemental spells. I'll change it depending on how many people have more dummy casters in their maps.
Quote:
Indentation is funny in GroupEnumUnitsInArea
I blame Vex. :)
Quote:
Switch these two lines (87/88) in the AoE buff template?
Done for 1.1.

Quote:
Originally Posted by Toadcop
i don't like the peredical event =\ it's awesome lame. in 2 ways.
You actualy don't need to use it. You can create a seperate periodic trigger for every buff type and in it, use enumeration by type and you have a working seperate periodic event for that bufftype. It still loops through all buffs though, so having a bunch of such enumerations, even if they run at lower frequencies, wouldn't save that much time.
Quote:
hmmm =\ ... xD queation what will happen if your unit (with a buff) dies but it has reincarnation ?
Good question. It indeed would "work" the way you described. Not much of a problem with completely triggered aurabuffs, but otherwise it's buggy. I blame blizzard and their lame reincarnation. Don't use it and you'll be fine. :)

Quote:
Originally Posted by Fulla
Can the system handle/have the capability:
-Storing a buffs, strength/level?
The system fully supports such a feature, you can either use the level buff parameter for that (right now it's already used by the sample spell Arcane Cleansing, although a bit differently than what you describe, but there's no reason why your map should use it in the same way), or add another parameter by storing a struct with it to the buff's or buff type's custom user data.
__________________
Anitarf is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-20-2007, 02:04 PM   #17
Toink
User
 
Join Date: Oct 2006
Posts: 1,086

Submissions (3)

Toink is on a distinguished road (17)

Send a message via Yahoo to Toink
Default

Awesome wtfhax system. I'm definitely testing it out as soon as I can. :)

Instant approval plx.

Last edited by Toink : 07-20-2007 at 02:05 PM.
Toink is offline   Reply With Quote
Old 07-20-2007, 03:19 PM   #18
rain9441
User
 
Join Date: Jan 2007
Posts: 195

rain9441 will become famous soon enough (61)rain9441 will become famous soon enough (61)rain9441 will become famous soon enough (61)

Default

In aBuff.refresh() function, where you use the RefreshDurationFactor(), consider the following set of events:

Unit A casts buff X on himself, calculated duration: 30 seconds.
15 seconds pass.
Unit A casts buff X on himself, calculated duration: 10 seconds.

By your logic, with RefreshDurationFactor of 0.0, the new duration will be 10 seconds. With RefreshDurationFactor 1.0, it will be 25 seconds.

It may not seem evident what I'm talking about but think of it in terms of short buffs (stuns). A 2 second stun is applied, and 1ms later a 0.25 second stun is applied. There should be some way of telling the aBuff system to keep the 2 second over the 0.25 second. I'm pretty sure the WC3 engine has this same fault (have 2 units with 2 seperate bash abilities, 1000 second stun on one and 0.01 second stun on another: one will unstun the unit).
rain9441 is offline   Reply With Quote
Old 07-20-2007, 08:54 PM   #19
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,886

Submissions (4)

Toadcop is just really nice (299)Toadcop is just really nice (299)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

the last buff overwrite the previous (in most cases) 100% i mean of the same type.
Toadcop is offline   Reply With Quote
Old 07-21-2007, 03:51 AM   #20
Toink
User
 
Join Date: Oct 2006
Posts: 1,086

Submissions (3)

Toink is on a distinguished road (17)

Send a message via Yahoo to Toink
Default

Hmm, so does that mean we can't prolong stuns? i.e A unit is stunned for 5 seconds, the next second it is stunned again for 10 seconds. The total stun would be 14 seconds.
Toink is offline   Reply With Quote
Old 07-21-2007, 05:46 AM   #21
uberfoop
User
 
uberfoop's Avatar
 
Join Date: Jul 2005
Posts: 207

Submissions (1)

uberfoop will become famous soon enough (29)

AI tournament - 2nd place

Default

Short stuns NEVER overwrite a longer stun. They don't add to it, but they don't replace it either. The longer stun will always carry out to the end of it's duration.
__________________
Quote:
Originally Posted by darkwulfv
.03 is one 300th of a second.
uberfoop is offline   Reply With Quote
Old 07-22-2007, 11:42 PM   #22
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Tested it and you are correct, uberfoop. Added that to the system.
Version 1.1 released. Some minor fixes and the new RefreshNeverReduceDuration() function are all the additions.
I didn't fix the reincarantion problem because it's one obscure annoying skill, I didn't change the dummy caster declarations to use GC because it doesn't matter unless you have many dummy caster types and I didn't code an aura subsystem yet because I didn't feel like it, I'll save that for 1.2.
__________________
Anitarf is offline   Reply With Quote
Old 07-23-2007, 02:50 AM   #23
NagelBagel
User
 
NagelBagel's Avatar
 
Join Date: Nov 2003
Posts: 33

NagelBagel has little to show at this moment (7)

Default

Awesome system. I just made a bunch of stat functions, and it should work really well with them.

Anyway, I found a bug. In the death trigger, you need to make sure abu isn't 0 before running the code posted below. That or check it in ABuffUnitCleanup. Otherwise you'll be destroying a nonexistant trigger.

Code:
set t = timerStr.create()
set t.data = integer(abu)
call TimerStart(t.t, 0.0, false, function ABuffUnitCleanup)
NagelBagel is offline   Reply With Quote
Old 07-25-2007, 03:31 AM   #24
PipeDream
Moderator
 
PipeDream's Avatar


Code Moderator
 
Join Date: Feb 2006
Posts: 1,405

Submissions (6)

PipeDream is a glorious beacon of light (463)PipeDream is a glorious beacon of light (463)PipeDream is a glorious beacon of light (463)PipeDream is a glorious beacon of light (463)

Default

Ok then, approved
__________________
PipeDream is offline   Reply With Quote
Old 07-25-2007, 02:31 PM   #25
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

hmmm define funny?

..
I would say that using only one timer is the only sane way to do stuff. At least it prevents you from doing so much exotic things just to attach things correctly to all the timers...
__________________
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 07-26-2007, 01:47 AM   #26
Game_Slave
A slave to games
 
Game_Slave's Avatar


 
Join Date: Jan 2006
Posts: 709

Submissions (22)

Game_Slave will become famous soon enough (55)Game_Slave will become famous soon enough (55)

Send a message via AIM to Game_Slave Send a message via MSN to Game_Slave
Default

Quote:
Originally Posted by Anitarf
The system was developed to support and promote the creation of interesting new buff spells, in hope that this will lead to new, more exciting gameplay in established map genres. Use your creativity.
I like what you're promoting. A very unique and useful system.
__________________
When the power of love exceeds the love for power, the world will finally know peace.

Last edited by Game_Slave : 07-26-2007 at 01:47 AM.
Game_Slave is offline   Reply With Quote
Old 07-26-2007, 12:52 PM   #27
erwtenpeller
*****istrator
 
erwtenpeller's Avatar


Art Director
 
Join Date: Nov 2003
Posts: 8,759

Submissions (35)

erwtenpeller has a brilliant future (927)erwtenpeller has a brilliant future (927)erwtenpeller has a brilliant future (927)erwtenpeller has a brilliant future (927)erwtenpeller has a brilliant future (927)erwtenpeller has a brilliant future (927)erwtenpeller has a brilliant future (927)erwtenpeller has a brilliant future (927)

Skinning Contest 7 ~ Were-AnimalsConcept art session 3 - Dungeon

Default

The off-topic discussion between Kaz, Toadcop and more recently cassiel has been moved here, into the off-topic.
__________________
erwtenpeller is offline   Reply With Quote
Old 07-27-2007, 02:32 AM   #28
Ignitedstar
Moderator
 
Ignitedstar's Avatar


RP Section Moderator
 
Join Date: Jul 2005
Posts: 1,755

Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)Ignitedstar has a spectacular aura about (102)

Send a message via MSN to Ignitedstar Send a message via Yahoo to Ignitedstar
Default

I really like this buff system of yours, Anitarf. Now, all I need to do is read the tutorial a number of times before actually getting it. X_X
__________________
Current Activity: It's a secret, now.
Evaluation: I actually logged in?!?!
"If I speak in the tongues of men and of angels, but have not love,
I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all knowledge,
and if I have a faith that can move mountains, but have not love, I am nothing."

1 Corinthians 13:1-2

Current Works:
None.

Last edited by Ignitedstar : 07-27-2007 at 02:33 AM.
Ignitedstar is offline   Reply With Quote
Old 07-27-2007, 03:23 PM   #29
rain9441
User
 
Join Date: Jan 2007
Posts: 195

rain9441 will become famous soon enough (61)rain9441 will become famous soon enough (61)rain9441 will become famous soon enough (61)

Default

I got an implementation question for ya Anitarf!

Is there any reason that GetABuffFromUnitByType returns an abuff that is about to be destroyed?

Suppose an eventCleanup, eventDestroy, or eventExpire occurs, and I have in the code to call a function "recalculatesomething". RecalculateSomething calls GetABuffFromUnitByType to determine a variable... Classic example:

A buff that raises the HP of a unit by 500. on EventCreate I call RecalculateHitpoints(eventBuff.target.u), which will do a bunch of calculations based on stats, level, *AND* the level of the aBuff on the unit of type "MyHitpointsAbuff". This works great, the RecalculateHitpoints() call sets the unit's hitpoints accordingly.

Now the hitpoints buff expires or is dispelled. In my EventCleanup function I again call RecalculateHitpoints(eventBuff.target.u). Unfortunately, It sees that the MyHitpointsAbuff is still active, even though its going to be destroyed in 0.00 seconds.

I'm going even further out on a limb to say that it might be a good idea to make sure GetAbuffFromUnit not return an abuff scheduled to be deleted because of another issue. Suppose in my Cleanup function I have somehow called AbuffApply on the same unit with the same aBuff (Example off the top of my head: A buff that when expires has a 20% chance to reapply itself on the buffed unit, or a buff that when expires has a 20% chance to reapply itself on ALL friendly/enemy units in an area). In these cases the AbuffApply will refresh the buff which is about to be destroyed, then the ABuff module will instantly destroy the buff.

What do you think? I know theres a work-around, by using a Timer to call RecalculateHitpoints/AbuffApply in 0.00 seconds, but it COULD go either way. I'd like to know what you think the best way to approach this problem is.
rain9441 is offline   Reply With Quote
Old 07-27-2007, 07:15 PM   #30
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Good points, rain9441.

There's plenty of reasons why GetABuffFromUnitByType should return buffs in the process of being destroyed, for example if you have a buff that has a specific effect when it is destroyed or expires if another specific buff is on the unit at that time, if a spell was cast that destroys all buffs on the unit then that specific buff may already be in the process of being destroyed by the time this buff's destroy response runs.

As far as your first question goes, the fastest solution would be to have an additional check for the buff's .beingDestroyed boolean, I realize now that it is undocumented, but I'll keep it that way for safety reasons because there's a better solution:

Make your function RecalculateHitpoints take an additional aBuff parameter. Then you can call it in three ways:
RecalculateHitpoints(eventBuff.target.u, eventBuff) from the buff's create and refresh functions. This is also faster than a GetABuffFromUnitByType call which uses gamecache.
RecalculateHitpoints(eventBuff.target.u, 0) from the cleanup function.
RecalculateHitpoints(u, GetABuffFromUnitByType(u, id)) from anywhere else.
Should work exactly as you want it to, unless the hit points can depend on multiple buffs, then you would have to check the .beingDestroyed boolean for each of them or, instead of recalculating life, simply add (create) or subtract (cleanup) from it as much as the buff should add.

As for your second problem, this is an obvious lack of functionality in the refresh and cleanup function, the refresh function should set the .beingDestroyed back to false and the cleanup then shouldn't cleanup if .beingDestroyed does not equal true. Never try to apply a buff from a cleanup function though! I will add this feature in 1.2 which should be out in a few days.

Thanks for the feedback.
__________________

Last edited by Anitarf : 07-27-2007 at 07:20 PM.
Anitarf 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:12 PM.


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