 |   |  |  |
|
The Hive Workshop Spells:
Water Explosion
|
|
|
| Image |
|
| Details |
|
Click, copy and send to people.
| Uploaded: | 15:48, 23rd Feb 2008 |
| Last Updated: | 01:43, 26th Jun 2008 |
| Keywords: | None |
| Type: | No Target |
| Category: | None |
Water explosion spell - creates explosions around caster dealing damage.
Spell is MPI which means that more than one player can cast spell at same time.
Warning: its a jass spell not GUI. The code is very simple and the GUI-ers should be able to copy spell in there map and edit a few constant functions which returns a spell type and dummy type, and of course create global variables which is GUI!
Have fun and please give credits if used!
Version 1.1 - Added non-selection trigger for dummy's.
Version 1.2 - Paused timer before destroying it and nulled handle variables.
Version 1.3 - Now Fully MUI and code optimized a bit.
Version 1.3b - Fix whit leeks.
Version 1.3c - Only nulled a bit of variables.
Version 1.3d - In filter function replaced local variable to function GetFilterUnit() as I guess it is a bit of leek when using a variable.
Version 1.4 - Many important fixes, first timer activation area affection fix + first cast lag fix.
|
Rating by users: 0.00 (0 votes)
Rate this spell:
|
| Moderator Review |
|
Not Rated
Diablo-dk: [Approved]
The spell is MUI and works fine ingame.
|
|
This spell is approved and works properly.
Click here to download Water Explosion.w3x (45.38 KB, 2452 Downloads)
|
02-27-2008, 10:23 AM
|
#2 (permalink)
|
User
Join Date: Jul 2007
Posts: 185
|
I used constant functions all ready so I don't understand what should I do more, if you think that when I use globals whit no array that its not MUI that is not true because if you look better this variables are used in instant actions. Not sure is it fully MUI but MPI is for sure that is enough if its a hero spell right?
Now I know I am not so good but I am still learning jass and how to code a good spell or anything, ty for teaching me about PauseTimer did not know it must be used before destroying it.
|
|
|
02-28-2008, 08:52 AM
|
#3 (permalink)
|
Shifting voidwalker!
Join Date: Nov 2004
Posts: 452
|
According to the rules, a JASS spell must be fully MUI. Take a look at KaTTaNa's local handle variables system, which is great at making MUI Jass spells. http://www.wc3jass.com/viewtopic.php?t=224
Quote:
|
, if you think that when I use globals whit no array that its not MUI that is not true because if you look better this variables are used in instant actions
|
I didn't say it had anything about the spell being MUI. It was a suggestion, so you don't have to follow it, since i do understand why you used globals.
Make the spell fully MUI and null the handle variables, then i'll approve it. (If you don't know what nulling handle variables means, search for a jass tutorial. I'm sure you can find an answer there)
|
|
|
02-28-2008, 09:18 AM
|
#4 (permalink)
|
User
Join Date: Jul 2007
Posts: 185
|
ok I will try this
Edit: Ok its updated now its MUI whit no handle local variables system as no one could find the problem
|
|
|
03-24-2008, 05:24 PM
|
#5 (permalink)
|
Flesh Eater
Join Date: Aug 2007
Posts: 1,015
|
Simple improvements
The first, I noticed you used degrees for the angle, as this makes it very easy to write the code, it is almost always more efficient to use radians, I studied your code a bit, and every single time WE needs to loop, it needs to make those unnecessary bj_DEGTORAD calculations
The second, your system to retrieve timer data is good, but I don't see anywhere that you nulled/cleared the timer data global for finished timers, your system would be very good, but it will keep looping through all of your un-used timers every time you retrieve the data, which you do every time the timer expires, almost like putting a loop inside a loop
Either get a different system that doesn't need to loop, or just make sure you clear + null the variables so the system doesn't need to loop through 200 expired timers your not even using
These are both pretty minor, but will definitely improve your code
[For the timer data system, if you'd like a guage on how mcuh better a loopless system would be, those systems only loop once, so if your system only looped once it would be slightly more efficient (less if/thens), but every time it needs to loop, it becomes that many more times slower, in other words if you have 50 timers stored in the data, your system would be 50x slower than a loopless(give or take 5x due to if/thens)]
|
|
|
03-25-2008, 12:51 AM
|
#6 (permalink)
|
User
Join Date: Jul 2007
Posts: 185
|
Hi Herman!
Well its nice you got a look in a spell so lets start to explain things out ^^.
1. Using bj_DEGTORAD is much faster then any other conversion as its a global already calculated constant in blizzard.j Its always much better to use constants as they are very fast.
2. There is only one timer per cast which gets destroyed very fast, as function ClearUserTimerData( timer whichTimer, boolean destroy ) so I don't need to do manual destroy. Note that only one timer loops the spell function, and gets soon destroyed.
3. The system of timer data which you say are lot, well as I explained there are timers equal to instant spell casting times. So if 3 players cast spell at same time there will be 3 timers (3 loops) btw jass if/then is fast GUI one creates function which is slow but in jass thats not a problem.
4. Thanks for commenting!
Edit: Lol sorry when I started to make this spell I made it MPI and then I waste my time on why Handle Locals dont work for me, in that time I forget to make ClearTimerData, thanks now its fixed.
|
|
|
03-26-2008, 12:06 AM
|
#7 (permalink)
|
Flesh Eater
Join Date: Aug 2007
Posts: 1,015
|
What I ment with the DEGTORAD, was that you should use the RADTODEG function, and just calculate in radians (one of the things that will cost you more time, but will improve your code)
If you don't need/want to do that (or don't know how) it's ok, its a pretty minor thing, should be kept in mind for big systems though
Yeah, I wasn't sure about the timers getting destroyed, it would only be slower if the timers were not removed, but I *think* you said you did
The timer thing is very very efficient way of doing if everything is used properly (I might even switch over to it, because I only ever put handlevars on timers)
Great job !!! :D
|
|
|
03-26-2008, 11:23 AM
|
#8 (permalink)
|
User
Join Date: Jul 2007
Posts: 185
|
You were right as I sad I did not destroy timers before I mean I did but did not clear the stored data on timer that was a leak but now its fixed. Only one thing about RADTODEG and DEGTORAD this are not the functions they are global constant variables and its same to say:
set var = 2*3
or
set var = 2 * bj_DEGTORAD
look:
constant real bj_DEGTORAD = bj_PI / 180.
constant real bj_RADTODEG = 180. / bj_PI
where bj_PI is:
constant real bj_PI = 3.14159
So only for your info, it does not matter which one you use they are the same its like you use:
set var = 2/4
set var2 = 4/2
it does not rely matter, note I only tried to explain you, this is for sure same thing as you can find them in blizzard.j dont tread this as function for conversion this is only a constant global variable.
I guess I explained it well, once more ty for comment.
|
|
|
03-27-2008, 01:44 PM
|
#9 (permalink)
|
Flesh Eater
Join Date: Aug 2007
Posts: 1,015
|
sorry I keep referring to it as a function, but yeah I udnerstand what you mean by the calculations, what I'm saying is inside your actual code you need to constantly flip between radians and degrees, because most of the functions take measurements in radians or return in radians
Although there are a select few that take degrees (like unit facing)
|
|
|
03-27-2008, 09:37 PM
|
#10 (permalink)
|
User
Join Date: Jul 2007
Posts: 185
|
Well I guess I explained it well so you now understand that its same do you want to work in RAD or DEG just 1 deg = PI / 180. or 180 deg = PI just what you like to work whit its your same but as its simple to work whit deg so I used deg. If you like more RAD then DEG you can always work in RAD, I just wanted to tell you its same about speed.
|
|
|
04-06-2008, 11:11 AM
|
#11 (permalink)
|
User
Join Date: Apr 2008
Posts: 27
|
looks awesome :D very nice done
|
|
|
04-14-2008, 03:14 PM
|
#12 (permalink)
|
Wannabie Catfood
Join Date: Sep 2007
Posts: 23
|
you have to make the dummies unattackable, the mobs attacked the water beams that fly out when you cast it...
|
|
|
04-16-2008, 04:19 PM
|
#13 (permalink)
|
User
Join Date: Jul 2007
Posts: 185
|
they are used for attack effect and cant be untouchable but they are soon removed and there selection hight is 2^11 which cant be seen, and I guess I did something more but not sure: nothing you need to worry!
|
|
|
05-11-2008, 11:34 PM
|
#14 (permalink)
|
User
Join Date: May 2008
Posts: 2
|
How The Fuck U Make This Work
|
|
|
05-12-2008, 04:12 PM
|
#15 (permalink)
|
User
Join Date: Jul 2007
Posts: 185
|
Hmm...
1) Plz turn off the caps lock
2) You need to tell me exactly what is wrong!
- Like do you have problems importing it in your map or you want to make spell like that and you don't know how, or is it something else like you don't know JASS or something.
If so then just copy trigger in your map as well as units and ability. Now check which raw codes are used in your map for units and abilities and then simple edit code when you see 'e000' - this is a raw code edit it to match your map.
Good luck, if you cant make it work I may be able to import it for you, if you send me your map.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|  |  |  |  |   |  |
|