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-07-2009, 12:03 AM   #16
Kyrbi0
~There we go~
 
Kyrbi0's Avatar
 
Join Date: May 2008
Posts: 2,901

Submissions (1)

Kyrbi0 is a jewel in the rough (152)Kyrbi0 is a jewel in the rough (152)

Send a message via MSN to Kyrbi0
Default

Aww crap...
__________________
My Projects, Resources, + Tutorials: ~Just got back from my mission. Glad to be back. Woot! :P~
=It was brought to my attention recently that the ":P" icon stands for "tongue-sticking out", and not the "smirky half-smile" I was using it for all these years. = Thusly I apologize for any unintentional juvenilization of my messages to anyone so afflicted.=
Kyrbi0 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 02-07-2009, 01:18 AM   #17
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

Yes.
Vexorian is offline   Reply With Quote
Old 02-22-2009, 04:23 PM   #18
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 I updated the spells to use GroupUtils because I have a tendency to be creating groups when I don't need to and it helped me get rid of that.

Also, apparently the post is too long or something, because it won't let me add the code for Quench Life to the first post, otherwise it bugs out and thinks I haven't posted anything at all. Not sure what's going on there.

Enjoy the updates.
__________________
Rising_Dusk is offline   Reply With Quote
Old 03-12-2009, 01:25 AM   #19
moyack
Evil Emoticon
 
moyack's Avatar


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

Submissions (17)

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

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

Send a message via MSN to moyack
Default

Because these are spell for heroes, having one timer for all the instances is exaggerated. Your code will be simpler if you use timerUtils and attach all the data to the timers.

You have a bad habit of making the spell casting triggers public. They don't have to, in fact you can avoid this global var and make it local into the init functions.

I haven't checked the last one, but you can use other post to submit it.
moyack is offline   Reply With Quote
Old 03-12-2009, 04:52 PM   #20
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 moyack
Because these are spell for heroes, having one timer for all the instances is exaggerated. Your code will be simpler if you use timerUtils and attach all the data to the timers.
Exaggerated? That doesn't even make sense. You should not use libraries for the sake of using libraries; you should only use them as necessary. Here it is not necessary.
Quote:
Originally Posted by moyack
You have a bad habit of making the spell casting triggers public. They don't have to, in fact you can avoid this global var and make it local into the init functions.
This is not a bad habit. Actually, it is a good habit. If they are public, that means users can 'turn off spells' at runtime by simply disabling the public trigger. The public keyword still fully encapsulates the trigger within the scope, but gives the user the option to disable it at their own need. Please don't say this is useless either, I put it to great use in my own work.

I'll figure something out about posting the last one. I don't want to use multiple threads, though, that's ugly. I'll think of something.
__________________
Rising_Dusk is offline   Reply With Quote
Old 03-12-2009, 06:18 PM   #21
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

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

Default

You could use a post in this thread. I really don't know what the problem is, though, I had no trouble posting the code of all 7 of my olympic spells...
__________________
Anitarf is offline   Reply With Quote
Old 03-12-2009, 06:19 PM   #22
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

I agree with Rising_Dusk, there is no point in not allowing users to disable the trigger. It is public so its still encapsulated. The private keyword should be used only on things that it must be used on to ensure you're not able to break the spell. However, if you design your spell so that certain values may be changed even during the spell's effect, then there is no reason for using the private keyword, it only limits the user.
xombie is offline   Reply With Quote
Old 03-12-2009, 06:22 PM   #23
moyack
Evil Emoticon
 
moyack's Avatar


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

Submissions (17)

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

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

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Rising_Dusk
Exaggerated? That doesn't even make sense. You should not use libraries for the sake of using libraries; you should only use them as necessary. Here it is not necessary.
You know that your code can be simpler for that (like saying bye bye to any loops and ensuring high precision in your spells), other thing is that you have the laziness to improve them, but, well, I'm getting used to that.

Quote:
This is not a bad habit. Actually, it is a good habit. If they are public, that means users can 'turn off spells' at runtime by simply disabling the public trigger. The public keyword still fully encapsulates the trigger within the scope, but gives the user the option to disable it at their own need. Please don't say this is useless either, I put it to great use in my own work.
that's what I call "the rare user situation syndrome", that has been rounding in this site lately. That feature is not used commonly so it doesn't have sense keeping it.

I won't request to modify the trigger part, in fact is part of your coding style, but I need to see those spells using TimerUtils.

Quote:
Originally Posted by xombie
I agree with Rising_Dusk, there is no point in not allowing users to disable the trigger. It is public so its still encapsulated. The private keyword should be used only on things that it must be used on to ensure you're not able to break the spell. However, if you design your spell so that certain values may be changed even during the spell's effect, then there is no reason for using the private keyword, it only limits the user.
The only part a normal user should be able to change and have control is the configuration part. Everything else will be a chance to make the code unstable.

Last edited by moyack : 03-12-2009 at 06:22 PM.
moyack is offline   Reply With Quote
Old 03-12-2009, 06:22 PM   #24
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

Quote:
Originally Posted by moyack
other thing is that you have the laziness to improve them

I think you mean "you are too lazy to improve them".

Whats with the double-post moyack, lol.

Quote:
Originally Posted by moyack
The only part a normal user should be able to change and have control is the configuration part. Everything else will be a chance to make the code unstable.

This is completely untrue. Code can still be perfectly stable even if users have more-than-basic control over a spell. It requires more work to ensure that the spell will still function as it is intended, but it is most definitely do-able. For example, in my Storm Hammer spell it used to be possible for users to change the x/y of the target, which would result in the data of the struct being updated to match that (method operators). This does not make the code less stable it just gives them more control over its features. There is nothing wrong with this. What you're suggesting is that every user who wants to use his spell is inexperienced and incapable of managing the spell logically, or they are willing to go into his code and change it so they can use it how they want to.

What you're suggesting here goes against the logic of using a method operator.

Last edited by xombie : 03-12-2009 at 06:30 PM.
xombie is offline   Reply With Quote
Old 03-12-2009, 06:44 PM   #25
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 moyack
You know that your code can be simpler for that (like saying bye bye to any loops and ensuring high precision in your spells), other thing is that you have the laziness to improve them, but, well, I'm getting used to that.
You're telling me to use N timers each using the same interval, whereas I am replacing it with 1 timer with N iterations of a loop. If you want me change it, show me a detailed benchmark of my method being substantially slower than your method. I believe that it is widely recognized that fewer timers running is quicker and cleaner than more timers.
Quote:
Originally Posted by moyack
The only part a normal user should be able to change and have control is the configuration part. Everything else will be a chance to make the code unstable.
There is nothing unstable about a public trigger existing so that users can handle it if they so deem it necessary..
__________________

Last edited by Rising_Dusk : 03-12-2009 at 06:45 PM.
Rising_Dusk is offline   Reply With Quote
Old 03-12-2009, 06:47 PM   #26
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

Where did this notion of "users should not be able to edit anything or use systems in any way other than the intended way" come from? All you are suggesting is that the code should be less flexible which is completely wrong.

Last edited by xombie : 03-12-2009 at 06:48 PM.
xombie is offline   Reply With Quote
Old 03-12-2009, 07:00 PM   #27
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

It is often true that there is a 'wrong' way to use something. It is up to the system/script maker to make the code robust enough to adjust for these incorrect usages. (Such as returning false)
__________________
Rising_Dusk is offline   Reply With Quote
Old 03-12-2009, 07:14 PM   #28
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

Collapse JASS:
method operator x= takes real newx returns boolean
    if newx > GetRectMaxX(bj_mapInitialPlayableArea) or newx < GetRectMinX(bj_mapInitialPlayableArea) then
        return false
    endif
    set .mX = newx
    return true
endmethod

Last edited by xombie : 03-12-2009 at 07:14 PM.
xombie is offline   Reply With Quote
Old 03-12-2009, 07:21 PM   #29
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, that is an example. (Though I prefer BoundSentinel)
__________________
Rising_Dusk is offline   Reply With Quote
Old 03-13-2009, 01:43 AM   #30
moyack
Evil Emoticon
 
moyack's Avatar


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

Submissions (17)

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

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

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Rising_Dusk
You're telling me to use N timers each using the same interval, whereas I am replacing it with 1 timer with N iterations of a loop. If you want me change it, show me a detailed benchmark of my method being substantially slower than your method. I believe that it is widely recognized that fewer timers running is quicker and cleaner than more timers.
It is not my task to make benchmarks. But you can test it by yourself running any of these effect-over-time spells in a map with 1200 units (to be clear: we're assuming this spell is applied to a normal unit and we have a melee map with 100 units per player in a full house). Now put them to cast the ability, or at least 50% of them. Horrible lag.

Now you'll say "That's a non sense", AKA "I'm lazy" for my eyes, then I say, "yes, because this is a hero spell", and then you'll say "of course!!" then you'll realize that for a hero spell this scenario is impossible, so this spell is actually casted not so often (probably never if the hero is not chosen), so your code can perform as fast (not faster) as one using TimerUtils, but then the efficiency remains in the code length (AKA simplicity), so... which will be faster?? by the tacit programmer's rule we can say: the shorter code. How do you achieve a shorter code?? using TimerUtils and attaching data to timers.

So don't come here again with your "that's non sense" and care that your stuff can be better. If you love this site, do your best for this site and offer only the best. Other thing: stop believing in the common sense and don't be so stubborn, do tests, compare. You have to do your own benchmarks, not somebody else.
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 04:22 AM.


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