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



Reply
 
Thread Tools Search this Thread
Old 04-14-2009, 04:46 PM   #16
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

Really hate the name $DESTROY$Timed(), it should seriously be $DESTROY$Delayed(). Even if it is a bit longer, it is more intuitive that the destruction of the handle is delayed, as opposed to timed. (Makes it sound like it should return a duration or something dumb)
__________________
Rising_Dusk is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 04-14-2009, 10:18 PM   #17
Bobo_The_Kodo
oO
 
Bobo_The_Kodo's Avatar
 
Join Date: Jul 2008
Posts: 580

Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)

Default

I don't see the point of using a struct to store one value, can't you just do your own inlined allocation and use an array?
Bobo_The_Kodo is offline   Reply With Quote
Old 04-14-2009, 10:24 PM   #18
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

The point of the struct is to have a unique index to attach to the timer. I mean, if he does what you suggest, he is doing exactly what the struct is already doing for him.
__________________
Rising_Dusk is offline   Reply With Quote
Old 04-14-2009, 11:23 PM   #19
TriggerHappy
 
Join Date: Feb 2008
Posts: 405

Submissions (2)

TriggerHappy will become famous soon enough (43)TriggerHappy will become famous soon enough (43)

Default

Is it really that much of a big deal, personally I like $DESTROY$Timed.
TriggerHappy is offline   Reply With Quote
Old 04-15-2009, 12:17 AM   #20
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

Yeah, it is that big of a deal. If you're going to go to the effort of making it fit into the already existing natives, do it right.
__________________
Rising_Dusk is offline   Reply With Quote
Old 04-15-2009, 12:19 AM   #21
TriggerHappy
 
Join Date: Feb 2008
Posts: 405

Submissions (2)

TriggerHappy will become famous soon enough (43)TriggerHappy will become famous soon enough (43)

Default

Done.

Anything else to get this approved?

I also renamed the textmacro, to it's more unique to this script.
TriggerHappy is offline   Reply With Quote
Old 04-15-2009, 12:22 AM   #22
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

I think it's good now. Approved.
__________________
Rising_Dusk is offline   Reply With Quote
Old 04-15-2009, 02:40 AM   #23
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

What a nice Swiss knife code we got here...

have you ever tried to use the scissors of a swiss knife?? you end using a real scissors instead.

This timed idea is only practical with effects because the only different thing you can do with effects is remove them, with lightnings and other handles you can (and have to) do more stuff while they exists, making this code totally limited.

It's funny how the author justified the purpose of this code:

Quote:
I heard rising_dusk talking about how this would be useful, so my sneaky ass made it :P

The funny thing is that he retook a graveyarded horrible idea and Rising_Dusk (and it seems other admins) helped him to code this horrible idea in a proper way... but still, independent of how nice the textmacro was used and how short the code ended, it is not a horrible idea, but still a bad one.

If you need to understand how impractical the things become, try to use this script with a lightning linking 2 units (a very common thing). At the end you'll have a huge code and only this script will take care of removing the handle, but not updating and controlling it, which is something that is as important (for not saying more important) as clean it. In fact, all of this should be done by one timer.

Still don't believe me?? check this example:

Expand JASS:

Just guess what line of code we have to remove in order to make this code better...





It's a shame that an admin promote the systems and script development (AND approve them) just based in his common sense (AKA because I think that's great) and not in how practical could be the code for the community. Today I feel like this site is an extension of the Hive Workshop.

That's all that I have to say.

Last edited by moyack : 04-15-2009 at 03:02 AM.
moyack is offline   Reply With Quote
Old 04-15-2009, 03:36 AM   #24
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

If I wanted to use a lightning effect attached to a unit and wanted to update it periodically, I wouldn't want to use a delayed destructor call in the first place. The purpose of this script is to function in cases where you ultimately don't care about the handle after you create it, hence fire and forget -
Collapse JASS:
call DestroyEffectDelayed(AddSpecialEffect("SomeModel.mdx", x, y), 10.)
- or similar for static lightning effects.

Also, the applications to weathereffect handles and items are great. Lots of puzzle maps or RPG maps could make use of this library as it is currently structured. The only reason it's slightly limited for lightning effects is because you almost never want to 'fire and forget' a lightning effect.
__________________

Last edited by Rising_Dusk : 04-15-2009 at 03:48 AM.
Rising_Dusk is offline   Reply With Quote
Old 04-15-2009, 03:48 AM   #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

Quote:
It's a shame that an admin promote the systems and script development (AND approve them) just based in his common sense (AKA because I think that's great) and not in how practical could be the code for the community. Today I feel like this site is an extension of the Hive Workshop.

That's all that I have to say.
I don't care at all about how other sites work or your opinion on them. Right now though I see a lot of lameness and it is actually coming from you... I got to be honest, it appears you are letting some kind of dumb personal vendetta interfere with the discussion about TriggerHappy's resource... that's very lame...

Anyway, you basically took an application that is completely unrelated to what these functions are meant to help at and, unsurprisingly, showed that these functions don't help in that case. You should have probably also taken more of our time by pointing out how this system does not solve Damage detection or brings world peace.

For your information, this system used to have a feature for halting the timer. I made TriggerHappy remove such feature, I did so precisely to avoid to make people think that it is supposed to solve the sort of problem you have mentioned. It would be lame to do it, as it is easier to use TimerUtils directly in such case.

This script is useful for quick cases in which you just have to destroy the thing after X seconds and forget about it, for example some FX things, and etc. If you need control, go and use TimerUtils directly, if you don't like to use this extra layer of abstraction, just don't and use TimerUtils directly. If you happen to just like something simple such as placing a rune in the map for 40 seconds, and you don't want to bother coding more than one line of script for that, this system is doing its job.

Edit: I am not a fan of Delayed, didn't blizz use "UnitAddTimedLife" or something like that? I think Timed was better but I don't give it much importance.
__________________
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 04-15-2009, 01:06 PM   #26
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:
Originally Posted by Vexorian
I don't care at all about how other sites work or your opinion on them. Right now though I see a lot of lameness and it is actually coming from you... I got to be honest, it appears you are letting some kind of dumb personal vendetta interfere with the discussion about TriggerHappy's resource... that's very lame...
what's lame is that you think is a personal vendetta.

Quote:
Anyway, you basically took an application that is completely unrelated to what these functions are meant to help at and, unsurprisingly, showed that these functions don't help in that case. You should have probably also taken more of our time by pointing out how this system does not solve Damage detection or brings world peace.
So you argue me because I took the time to show a practical example where this application should work... and failed?

Vex... I'm impressed you contributed in this "coding for the lulz". This code limits more than help. I propose you to think actually in usefulness. You'll need normally a timed group? or location? no... because they are not naturally visible ingame, what kind of stuff actually needs to be timed... visible stuff like effects, lightnings, weathers, ubersplasts, tags, units, items, destructables. First scenario reduction.

Now... what can we do with effects? create and destroy. With lightnings? create, destroy, change their coordinates and their RGB. Weathers? create, destroy and control visibility. Ubersplats? create, destroy, show, finish, reset, etc... Tags? create, destroy setposition, and change velocity, text and other stuff. Units? create, destroy, and many things. Items? almost the same as units. Destructables? the same create, destroy and many other things.

As you know, and you can see, it's hard to generalize, but well, we can try. So the only way to make it general is by managing the most common thing that is creating and destroying. And what about the other features that other handles offer???? if any of the above mentioned handles offers settings then it has to be accessible over the time, otherwise it will look as a code bug (I suggest to do a test with a lightning).

The usage scenario has reduced much more... this this system becomes useless in many cases and only viable with effects, weathers, and rarely with items (probably ubersplats... actually I do never needed them in my modding experience).

This is my point.

Quote:
For your information, this system used to have a feature for halting the timer. I made TriggerHappy remove such feature, I did so precisely to avoid to make people think that it is supposed to solve the sort of problem you have mentioned. It would be lame to do it, as it is easier to use TimerUtils directly in such case.
Ok, no access to the timer is fine but at least a safe command to stop it early is always good. This script (not system) is intended for general purposes, then general situations must be taken in account too.

Quote:
This script is useful for quick cases in which you just have to destroy the thing after X seconds and forget about it, for example some FX things, and etc. If you need control, go and use TimerUtils directly, if you don't like to use this extra layer of abstraction, just don't and use TimerUtils directly. If you happen to just like something simple such as placing a rune in the map for 40 seconds, and you don't want to bother coding more than one line of script for that, this system is doing its job.
Now count how many times in your WC3 modding time you needed to do this with handles different from effects.

I invite you to do a test. Do useful code FOR SPELLS where you need to "throw temporally" other handles different than effects, and let's talk.

I hope with this my point gets clear. Anyways I'm open to a further discussion about this and learning from the experience. If you offer me enough valid arguments, then I will request to remove my TimedEffects script to the graveyard.
moyack is offline   Reply With Quote
Old 04-15-2009, 02:47 PM   #27
Viikuna-
User
 
Viikuna-'s Avatar
 
Join Date: Feb 2009
Posts: 203

Viikuna- will become famous soon enough (44)Viikuna- will become famous soon enough (44)

Default

Moyack is right. This is hardly ever useful for lightnings, because they usually require some additional coding too. You need to move lightnings and change their color.

It works nicely with effects, because you can only create and destroy them.
__________________
No Marlo, no game.
Viikuna- is offline   Reply With Quote
Old 04-15-2009, 02:50 PM   #28
wraithseeker
User
 
Join Date: Feb 2009
Posts: 406

wraithseeker is on a distinguished road (17)

Default

About Deaod's code, he is using TimerUtils and has recycled the timer so why is he still nulling it? Isn't that a extra one line?
wraithseeker is offline   Reply With Quote
Old 04-15-2009, 03:03 PM   #29
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

Quote:
what's lame is that you think is a personal vendetta.
Then what's a logical explanation for this? You went overboard, made personal attacks and even insulted my beloved web site all for a script? I mean, if it is not because of some stupid personal vendetta then what is it for? I can't find any other logical explanation for that xombie-reminiscent post.

Quote:
I invite you to do a test. Do useful code FOR SPELLS
Not everything in freaking map making is spells. Sometimes you could really use it, for the stuff used in the textmacros it is very useful, you might try viewing things as a map maker and not as a spell maker for once.

The types used by this are effect (which even in spells is useful) lightning (which does not necessarily need to be updated all the time, you could like, create the lightning, add some color and transparency then call this function so it goes missiing after 0.5 seconds. Still useful. weathereffect which I personally don't think has ever needed more than just being shown. items which, again, make these functions very useful for runes and ubersplats. So it is unbelievable but all the types these function allow for delayed destruction actually need such thing sometime!

If you don't want to use it , then just don't use it. If you make any other post in this thread, I won't show any tolerance, thank you.

Quote:
Ok, no access to the timer is fine but at least a safe command to stop it early is always good. This script (not system) is intended for general purposes, then general situations must be taken in account too.
Again, that would be retarded, if you need to have control, just use TimerUtils directly.

So really, I have had such urge some time, to show an effect for 0.5 seconds, or to place a bonus item in the map for 20.0 seconds. I guess Dusk as a map maker with zillions of maps made also needed something like that once (surprise! "I think it will be useful" coming from Dusk is in fact a good reason!). So really, this is useful enough for its intended usage. Hence why I don't appreciate the drama.
__________________
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 04-15-2009, 03:03 PM   #30
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 moyack
So you argue me because I took the time to show a practical example where this application should work... and failed?
Vex is saying that in the event where you want to control the handle (ie. move a lightning's coordinates), it is not useful to apply a timed life to the handle in the first place. In that case, the smart coder will apply TimerUtils directly in order to maintain control of them and be able to destroy them at his desire. In the case where he applies TimerUtils directly, it is a waste of processing power for him to ever call StartTimed$WHATEVER$, because he already knows that he will be handling the lightning or whatever with TimerUtils.

It is ludicrous to claim that this script falters in a case where it would be lame to use it even if it were exactly like you suggest.
Quote:
Originally Posted by wraithseeker
About Deaod's code, he is using TimerUtils and has recycled the timer so why is he still nulling it? Isn't that a extra one line?
It is good practice to null handles, whether they leak or not.
__________________

Last edited by Rising_Dusk : 04-15-2009 at 03:06 PM.
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 04:40 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2020, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services