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



Reply
 
Thread Tools Search this Thread
Old 02-06-2009, 10:48 PM   #1
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 Devour

Click image for larger version

Name:	Devour_Pic.jpg
Views:	480
Size:	55.7 KB
ID:	40546Devour
Made by Av3n

Simple spell, which replicates Devour without the UI change (which personally I hate) and also absorbs mana, includes a progress bar which is perfect. I appreciate criticism and any suggestions to the code since I'm still new to the know-how-to-do code even though I have been coding for a long time.

RequirementsNote that the test map come with these systems as well.
As well the requirements for the systems listed above are in the test map and in the links provided.


Expand Devour:

-Av3n
Attached Files
File Type: w3x Devour.w3x (52.4 KB, 217 views)
__________________

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

Last edited by Av3n : 06-16-2009 at 08:37 AM.
Av3n is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 02-07-2009, 01:23 AM   #2
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

lovely... but expect the critic. There's stuff to improve :)
moyack is offline   Reply With Quote
Old 02-07-2009, 02:29 AM   #3
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

Yeah I know xD. I haven't even set up the thread yet, nor the map to even say it's ready to get moved.

I haven't coded in awhile as well. Anything you want to point out?

-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 02-08-2009, 10:37 PM   #4
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Ok, my comments:

for portability, set an initializer function and make that function private:

Collapse JASS:
library Devour initializer init needs SimError

Make the variable trigger as local.
You can use only one EFFECT_TYPE instead separate ones, it gives to the user one place to edit the effects.
You can use a more accurate event to detect if a unit is going to cast the spell and allow you to reuse the Conditions function to detect the spell cast. Change the onOrder by returning nothing so it can be an action. See those changes here.

Collapse JASS:
private function OnOrder takes nothing returns nothing
     local unit u = GetTriggerUnit()
     if IsUnitInGroup(u,isDevouring) then
        call SimError(GetOwningPlayer(u),SpellErrorMessage)
        call PauseUnit(u,true)
        call IssueImmediateOrder(u,"stop")
        call PauseUnit(u,false)
     endif
     set u = null
endfunction

private function init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Devour.create )
    set t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function OnOrder )
    set isDevouring = CreateGroup()
    set isDevoured = CreateGroup()
    set devourTimer = CreateTimer()
    set index = -1
    set Devour.onLoopFunc = function Devour.onLoop
    set targetE = GetAbilityEffectById(SpellID,EFFECT_TYPE_SPECIAL,0)
    set exeE    = GetAbilityEffectById(SpellID,EFFECT_TYPE_SPECIAL,1)
    set finishE = GetAbilityEffectById(SpellID,EFFECT_TYPE_SPECIAL,2)
    call Preload(targetE)
    call Preload(exeE)
    call Preload(finishE)
    set t = null
endfunction

Well, it seems you're using one timer to manage all the spells, that's not bad, but... because this spell is focused for heroes, doing that is exaggerated, because it's less chances of being cast respect a custom unit ability. I suggest to make it dependable of TimerUtils and use a timer per spell cast., which means that the timer variable will say bye bye.

WAit for more comments... on MSN

Last edited by moyack : 02-09-2009 at 12:03 AM.
moyack is offline   Reply With Quote
Old 02-09-2009, 01:52 AM   #5
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

Yeah I was thinking TimerUtils would be better for the execution accuracy and kills off 2+ vars and the indexing stuff.

-Av3n
__________________

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

Last edited by Av3n : 02-09-2009 at 01:55 AM.
Av3n is offline   Reply With Quote
Old 02-10-2009, 06:23 AM   #6
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

I'm keeping the way I done the effects since it just that much easier object editor wise.

Switched to TimerUtils for accuracy over performance (Well not really if you use Red Flavor).

-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 02-18-2009, 11:03 AM   #7
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Moved so people can give feedback.
moyack is offline   Reply With Quote
Old 02-18-2009, 11:50 AM   #8
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

I think one timer method is always better for periodic stuff, although in this case it maybe isn't because you're using such long periods; why do so, though? It's much more intuitive to define it in damage per second rather than damage per x seconds, especially since the original devour ability also uses dps...

For cancelling the spell, you should use the order event.

When cancelling the spell if the unit is already full, why press the hotkey?

This is wrong: call SetWidgetLife(D.cast,GetWidgetLife(D.cast)+(D.dam-GetWidgetLife(D.targ))) So is the mana part.

Quote:
Originally Posted by moyack
Moved so people can give feedback.
If he wants to submit it, he should do it himself. If not, then don't waste the reviewers' time by moving it here.
__________________
Anitarf is offline   Reply With Quote
Old 02-18-2009, 12:14 PM   #9
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
If he wants to submit it, he should do it himself. If not, then don't waste the reviewers' time by moving it here.
Av3n wants to submit this spell, and as you can see, I gave my review. He could move it, I know, but I did it because is my way to authorize him to release it to the public, because initially it was only for my project.

Last edited by moyack : 02-18-2009 at 12:24 PM.
moyack is offline   Reply With Quote
Old 02-18-2009, 01:51 PM   #10
xombie
Banned
 
Join Date: Oct 2006
Posts: 858

xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)

Default

The idea of re-making a warcraft ability that perhaps could've been done better by Blizzard themselves is nice, but there is no way I'm going to ever use a spell that requires 4 additional libraries to import. Thats luggage.

Last edited by xombie : 02-18-2009 at 01:53 PM.
xombie is offline   Reply With Quote
Old 02-18-2009, 02:32 PM   #11
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

It requires 3, and as far as I'm concerned TimerUtils should be used in any map anyways. LastOrder/AbortSpell should be in any map that needs custom spell error messages. That it requires these three libraries is not extra luggage, it is a sensible necessity for a spell such as this.
__________________
Rising_Dusk is offline   Reply With Quote
Old 02-18-2009, 02:51 PM   #12
xombie
Banned
 
Join Date: Oct 2006
Posts: 858

xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)

Default

LastOrder requires another library behind it to support it, so thats 4. Also, TimerUtils isn't something that all maps should have, there are quite a few alternatives. Y'know, pretty soon you're not going to be able to go to wc3campaigns.net and download a spell without also downloading several other systems. This isn't very good for uniting the wc3 community, but who says thats at all what anybody here wants to do.

I just pulled this out of the Triggers forum:
http://www.wc3c.net/showthread.php?t=104584

//Requires:
// - TimerUtils
// - Table
// - ABuff
// - ADamage
// - SimError
// - LastOrder
// - AbortSpell

What happens if something goes wrong, ever? Your map is entirely gone to shit because there is no way in hell you're going to be debugging 7+ "helpers" and then your own code.

Last edited by xombie : 02-18-2009 at 03:11 PM.
xombie is offline   Reply With Quote
Old 02-18-2009, 03:18 PM   #13
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 xombie
LastOrder requires another library behind it to support it, so thats 4. Also, TimerUtils isn't something that all maps should have, there are quite a few alternatives. Y'know, pretty soon you're not going to be able to go to wc3campaigns.net and download a spell without also downloading several other systems. This isn't very good for uniting the wc3 community, but who says thats at all what anybody here wants to do.
If you include the SimError requirement of AbortSpell, then I agree with you.

Secondly, TimerUtils is as close to a timer handling standard as we have. If you don't use it in your maps, it is your own fault and your own loss. It is the best way to handle timers (recycling) and offers different flavors (at no compatibility penalty to the user) for user preference.

Thirdly, there are no compatibility errors between Table, TimerUtils, SimError, LastOrder, AbortSpell, or Anitarf's systems. We go to extreme lengths to ensure that users don't face compatibility problems when we approve scripts. If there are any compatibility dilemmas that may arise, we require users specifically list them in the first post. (UnitUserData for example) At that point, if the user still experiences them, it is their own fault.

Having many libraries is the point of libraries. They exist to be used, in unison and as necessary, for the abstraction of common or repetitive code within maps. I personally use something like 21 libraries from the database for one of my current maps and experience zero conflicts or troubles. I even find use for those libraries in many of my spells, making them that much more valuable.

Quote:
Originally Posted by Xombie
This isn't very good for uniting the wc3 community, but who says thats at all what anybody here wants to do.
Standards are exactly the way to unite the WC3 scripting community.
__________________

Last edited by Rising_Dusk : 02-18-2009 at 03:20 PM.
Rising_Dusk is offline   Reply With Quote
Old 02-18-2009, 05:05 PM   #14
darkwulfv
Alpha Male of Wc3c
 
darkwulfv's Avatar


Official Map Reviewer
 
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default

I think what he's trying to get at is with so many systems, debugging can become a shit not because of cross-system conflicts, but because you don't know what system is causing the problem in the first place.

Quote:
Standards are exactly the way to unite the WC3 scripting community.
And that's why we have 3-4 versions of multiple systems. (Timer Handling, Unit data, etc. etc.)

ONTOPIC OMG:

I highly suggest a "progress" bar, since the original devour showed the unit's health so you knew how much longer it had to go. I think it'd add a nice touch.
__________________
The Spell Request Thread
Quote:
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt


Last edited by darkwulfv : 02-18-2009 at 05:08 PM.
darkwulfv is offline   Reply With Quote
Old 02-18-2009, 05:28 PM   #15
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Well, to finish this offtopic: systems posted here have something called support and hard review, and if any submitter has a resource in the database, it has to give support to that spell/system/sample. So... if users have problems with a system they must:

1. Check if they have a bug in their code and not in the system.
2. Post the issue in the resource thread so the script developer can check this problem.

So in general, using other systems makes your modding faster and supported.

If I see other comment offtopic, it will be deleted.

On topic: Devour.onLoopFunc variable can be avoided... in fact I dont' understand how using it you can keep it organized.

Last edited by moyack : 02-18-2009 at 05:29 PM.
moyack 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 03:18 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