HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spell Session 4: Tremor

06-07-2006, 07:31 PM#1
Tim.
Click image for larger version

Name:	Tremor1.png
Views:	2646
Size:	17.7 KB
ID:	7242Tremor (JESP)

Description: The Desert Lord returns to his true form, the sand itself. He then manipulates the sand and minerals to his advantage, damaging and stunning all units in his path. For the finale a giant stone hand forms, then crushes all units in the nearby area. Any time the Desert Lord hits a unit, the unit is knocked into the air, damaged and then stunned. Both damage amounts and stun duration increase with level.

Screenshots:

Click image for larger version

Name:	Tremor2.JPG
Views:	1502
Size:	89.2 KB
ID:	7243Click image for larger version

Name:	Tremor3.JPG
Views:	1649
Size:	108.3 KB
ID:	7244Click image for larger version

Name:	Tremor4.JPG
Views:	1652
Size:	96.0 KB
ID:	7245

Download: Spell Contest 4 - Tim 3.2.w3x (50.7 kb)

Notes: This was my entry for Spell Session 4, and it came in third place. The spell is meant to go with a model such as this one, in order to match the sandy theme of the spell. The Reveneant model used here is only an example. Also, the spell meets the JESP Standard, is much easier to configure than my former spell, and is completely customizable. Even includes a Variable Stun system! (Thanks to blu_da_noob for the original system.)
Attached Images
File type: pngTremor1.png (17.7 KB)
File type: jpgTremor2.JPG (89.2 KB)
File type: jpgTremor3.JPG (108.3 KB)
File type: jpgTremor4.JPG (96.0 KB)
Attached Files
File type: w3xSpell Contest 4 - Tim 3.2.w3x (51.3 KB)
06-07-2006, 09:10 PM#2
Blade.dk
A very nice spell, approved.

There are, however, some things that can be improved in your future spells:

You could make your configuration functions constant, that should make them run a bit faster.

Using the same function for all returns of the same type seems silly. The if statements slows it down, and if they were not there, the functions would be replaced with the actual values in an optimized map.

Collapse JASS:
function TremorTim_Cache takes nothing returns gamecache
    return TremorTim_Gamecache()
endfunction

This seems really pointless, a configuration function directly returning the return value of another configuration function in the same spell?

Using TriggerSleepActions with animations is really bad idea. You do not need to use a timer and another function there, but polling a timer (look at the function PolledWait's code) would give you a more beautiful result.

I don't really like that you use the same timer expiration function with a ton of if statements. Each if statement and declared variable that you do not use, is making the spell slower (even though it is not much).
I suggest you to seperate it, you can always just restart the timer and make it run another function, without having to reattach things.
Example:

Collapse JASS:
function ThirdTimerFunction takes nothing returns nothing
    local timer t = GetExpiredTimer()
    //actions actions actions actions
    if <condition if this part of the spell is over> then
        call DestroyTimer(t)
    endif
    set t = null
endfunction

function SecondTimerFunction takes nothing returns nothing
    local timer t = GetExpiredTimer()
    //actions actions actions actions
    if <condition if this part of the spell is over> then
        call TimerStart(t, 0.04, true, function ThirdTimerFunction)
    endif
    set t = null
endfunction

function FirstTimerFunction takes nothing returns nothing
    local timer t = GetExpiredTimer()
    //actions actions actions actions
    if <condition if this part of the spell is over> then
        call TimerStart(t, 0.04, true, function SecondTimerFunction)
    endif
    set t = null
endfunction
06-07-2006, 11:48 PM#3
Tim.
Quote:
Originally Posted by Blade.dk
You could make your configuration functions constant, that should make them run a bit faster.

Ouch, can't believe I forgot to add that in the end. Will fix.

Quote:
Originally Posted by Blade.dk
Using the same function for all returns of the same type seems silly.

Oh alright, I figured it was better like that :P I won't do it in the future.

Quote:
Originally Posted by Blade.dk
Collapse JASS:
function TremorTim_Cache takes nothing returns gamecache
    return TremorTim_Gamecache()
endfunction

This seems really pointless, a configuration function directly returning the return value of another configuration function in the same spell?

That's left over from a test I was running, forgot to remove it I guess. I'll fix that.

Quote:
Originally Posted by Blade.dk
Using TriggerSleepActions with animations is really bad idea.

Will do in the future, thanks.

Quote:
Originally Posted by Blade.dk
I don't really like that you use the same timer expiration function with a ton of if statements.

Like before, I assumed it was the best way. Won't do so again.
06-08-2006, 06:19 AM#4
Blade.dk
Well, depending on what is important for you, your method can be better than mine.

If you want to save a few bytes in the spell's size, then your method is best, but if you want it to be more efficient, then dropping the extra if statements and using seperate functions is best.
06-09-2006, 03:27 PM#5
erwtenpeller
GIANT HAND, LOL

pwns.
07-23-2006, 02:19 PM#6
Vexorian
you know, it is not a JESP spell if the JESP manifest is not included in the map. The spell itself is awesome, or is it the model what is awesome, I don't know
08-08-2007, 09:55 AM#7
Pyritie
How'd you make the unit's animation go backwards?

And don't yell at me about bumping. This is a resource. It's okay.
08-08-2007, 10:34 AM#8
Whitehorn
It's an open source map, how about you open it and look for yourself?
08-08-2007, 01:09 PM#9
Vexorian
Open source != readable source
08-08-2007, 10:26 PM#10
Whitehorn
Vexorian == pedantic
08-09-2007, 07:18 AM#11
Rising_Dusk
Quote:
How'd you make the unit's animation go backwards?
call SetUnitTimeScale(MyUnit, -1.0) Negative animation speed reverses the animation.
You need to capture the animation in the last frames though, otherwise it won't work.
(That means don't let the animation finish)
08-09-2007, 07:21 AM#12
MaD[Lion]
Quote:
Originally Posted by pyritie
How'd you make the unit's animation go backwards?

And don't yell at me about bumping. This is a resource. It's okay.

1. Play animation "death"
2. Set animation speed = 0
3. Abdakadabra....whatever
4. Set animation speed = -1

Enjoy the show
08-09-2007, 12:15 PM#13
Pyritie
Okay, thanks.
07-14-2008, 02:27 AM#14
Dark_Dragon
Rely amazing, one of best spells I ever sow 5/5
07-29-2008, 11:14 AM#15
Titanhex
An amazing spell for sure. However, I can't find the Map Script that I'm suppose to copy the Return Bug functions from. Could someone tell me where the Map Script is? All I've gotten so far is that I can export it.

Also when I save, 50 compiled errors arise dealing with udg and cannot convert null to integer.