(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Resources > JASS Functions

JASS Functions Approved JASS functions will be located here.
Remember to submit your own resources to the submission forum.

Reply
 
LinkBack Thread Tools Display Modes
Old 10-18-2007, 01:10 PM   #16 (permalink)
 
Unhit's Avatar

work work!
 
Join Date: Nov 2004
Posts: 79

Unhit has little to show at this moment (56)


When stunning a unit for x seconds, I suggest using Aerial Shackles with infinite duration and then adding an expiration timer, or any timer after casting the spell. As far as I know, aerial shackles cannot be dispelled, but the only way to cancel it is to stun/silence the caster which won't work with a locust unit. So that way you get the same effect like stormbolt, with a duration of x.xx seconds if you like, and you only need one spell level :)
(I have tried it this way in my map "BEER BEER", and so far it worked flawless)

//Edit: Just saw that purplepoot posted something similiar already. Well, I suggest aerial shackles as dummy!
Unhit is offline   Reply With Quote
Old 12-03-2007, 12:04 PM   #17 (permalink)
 
Silvenon's Avatar

BBoy Silv
 
Join Date: Nov 2006
Posts: 866

Silvenon is on a distinguished road (81)Silvenon is on a distinguished road (81)


function PreloadSoundPath takes string path returns nothing
    local sound snd = CreateSound(path, false, false, false, 10, 10, "")
    call SetSoundVolume(snd, 0)
    call StartSound(snd)
    call KillSoundWhenDone(snd)
    set snd = null
endfunction


Just a retarded function that preloads a sound in the given path. If someone doesn't know, first time you play a sound nothing happens, because the sound is loaded first, so this function does that loading part.

Maybe we should do something about these snippets Pooty? For example do something about this:

Quote:
Originally Posted by PurplePoot
Functions

(none yet)
__________________
PurgeandFire111: Then you can delete the sound and whala... You have the label,filepath, and other parameters.
Silvenon: It's voila, not whala, you... stupidhead :)
PurgeandFire111: Yeah, I was in a rush. =( *cry*
Herman: Voila is an instrument that I quit playing in 6th grade, whala works just fine if not better
PurgeandFire111: No, viola is an instrument. Stupidhead... =D
Silvenon is offline   Reply With Quote
Old 12-03-2007, 03:36 PM   #18 (permalink)
 
hvo-busterkomo's Avatar

Resistance 2
 
Join Date: Jul 2007
Posts: 737

hvo-busterkomo has little to show at this moment (57)


function Trig_Single_Player_Defeat_Actions takes nothing returns nothing
    //do whatever//
endfunction

//===========================================================================
function Trig_Single_Player_Defeat_Conditions takes nothing returns boolean
    return bj_isSinglePlayer == true
endfunction

function InitTrig_Single_Player_Defeat takes nothing returns nothing
    set gg_trg_Single_Player_Defeat = CreateTrigger( )
    call TriggerRegisterTimerEventSingle( gg_trg_Single_Player_Defeat, 15.00 )
    call TriggerAddCondition( gg_trg_Single_Player_Defeat, Condition( function Trig_Single_Player_Defeat_Conditions ) )
    call TriggerAddAction( gg_trg_Single_Player_Defeat, function Trig_Single_Player_Defeat_Actions )
endfunction

That will detect if the game is single player at 15 seconds.
__________________
Current Projects:

Humans vs Orcs v5.01 full release: 98%

Untitled Warcraft 1-2 historical reenactment: 30%
hvo-busterkomo is offline   Reply With Quote
Old 12-03-2007, 10:40 PM   #19 (permalink)
 
Silvenon's Avatar

BBoy Silv
 
Join Date: Nov 2006
Posts: 866

Silvenon is on a distinguished road (81)Silvenon is on a distinguished road (81)


Uhmmm......what?? This is just GUI with a line of custom script converted to JASS.
__________________
PurgeandFire111: Then you can delete the sound and whala... You have the label,filepath, and other parameters.
Silvenon: It's voila, not whala, you... stupidhead :)
PurgeandFire111: Yeah, I was in a rush. =( *cry*
Herman: Voila is an instrument that I quit playing in 6th grade, whala works just fine if not better
PurgeandFire111: No, viola is an instrument. Stupidhead... =D
Silvenon is offline   Reply With Quote
Old 12-07-2007, 12:24 AM   #20 (permalink)
 
hvo-busterkomo's Avatar

Resistance 2
 
Join Date: Jul 2007
Posts: 737

hvo-busterkomo has little to show at this moment (57)


No it isn't..........
__________________
Current Projects:

Humans vs Orcs v5.01 full release: 98%

Untitled Warcraft 1-2 historical reenactment: 30%
hvo-busterkomo is offline   Reply With Quote
Old 12-07-2007, 09:32 PM   #21 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,349

PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)

Paired Mapping Contest #4 Winner: Fallen Angel - Lucifer's Keep Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

Ah yes, adding some to the listing...

Quote:
No it isn't..........
No offense, but yes it is.
PurplePoot is offline   Reply With Quote
Old 12-09-2007, 11:41 AM   #22 (permalink)
 
Silvenon's Avatar

BBoy Silv
 
Join Date: Nov 2006
Posts: 866

Silvenon is on a distinguished road (81)Silvenon is on a distinguished road (81)


I have a weird set b = null in my GetClosestUnit function, you can remove that please (since there's no "b" variable). I believe I wanted to null the taken boolexpr, but taken values don't need to be nulled.
__________________
PurgeandFire111: Then you can delete the sound and whala... You have the label,filepath, and other parameters.
Silvenon: It's voila, not whala, you... stupidhead :)
PurgeandFire111: Yeah, I was in a rush. =( *cry*
Herman: Voila is an instrument that I quit playing in 6th grade, whala works just fine if not better
PurgeandFire111: No, viola is an instrument. Stupidhead... =D
Silvenon is offline   Reply With Quote
Old 01-13-2008, 09:59 AM   #23 (permalink)
 
Silvenon's Avatar

BBoy Silv
 
Join Date: Nov 2006
Posts: 866

Silvenon is on a distinguished road (81)Silvenon is on a distinguished road (81)


function IsDestTree takes destructable dest returns boolean
    local integer d = GetDestructableTypeId(dest)
    return d == 'ATtr' or d == 'BTtw' or d == 'KTtw' or d == 'YTft' or d == 'JTct' or d == 'YTst' or d == 'YTct' or d == 'YTwt' or d == 'JTwt' or d == 'JTwt' or d == 'FTtw' or d == 'CTtr' or d == 'ITtw' or d == 'NTtw' or d == 'OTtw' or d == 'ZTtw' or d == 'WTst' or d == 'LTlt' or d == 'GTsh' or d == 'Xtlt' or d == 'WTtw' or d == 'Attc' or d == 'BTtc' or d == 'CTtc' or d == 'ITtc' or d == 'NTtc' or d == 'ZTtc'
endfunction


Just a function that checks if the given destructable is a tree.
__________________
PurgeandFire111: Then you can delete the sound and whala... You have the label,filepath, and other parameters.
Silvenon: It's voila, not whala, you... stupidhead :)
PurgeandFire111: Yeah, I was in a rush. =( *cry*
Herman: Voila is an instrument that I quit playing in 6th grade, whala works just fine if not better
PurgeandFire111: No, viola is an instrument. Stupidhead... =D

Last edited by Silvenon; 01-15-2008 at 09:29 PM..
Silvenon is offline   Reply With Quote
Old 01-15-2008, 05:41 PM   #24 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,349

PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)

Paired Mapping Contest #4 Winner: Fallen Angel - Lucifer's Keep Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

Use 'or'? T'would be better than using elseif, since and/or are short circuit in JASS, apparently.
PurplePoot is offline   Reply With Quote
Old 01-15-2008, 09:25 PM   #25 (permalink)
 
Silvenon's Avatar

BBoy Silv
 
Join Date: Nov 2006
Posts: 866

Silvenon is on a distinguished road (81)Silvenon is on a distinguished road (81)


Ok, I wanted to do that too, but the stupid editor didn't allow such a long line.

*Edited*
Silvenon is offline   Reply With Quote
Old 01-18-2008, 12:26 AM   #26 (permalink)
 
Hero12341234's Avatar

────║╣ero────
 
Join Date: Dec 2006
Posts: 75

Hero12341234 has little to show at this moment (2)


Quote:
Originally Posted by Silvenon View Post
function IsDestTree takes destructable dest returns boolean
    local integer d = GetDestructableTypeId(dest)
    return d == 'ATtr' or d == 'BTtw' or d == 'KTtw' or d == 'YTft' or d == 'JTct' or d == 'YTst' or d == 'YTct' or d == 'YTwt' or d == 'JTwt' or d == 'JTwt' or d == 'FTtw' or d == 'CTtr' or d == 'ITtw' or d == 'NTtw' or d == 'OTtw' or d == 'ZTtw' or d == 'WTst' or d == 'LTlt' or d == 'GTsh' or d == 'Xtlt' or d == 'WTtw' or d == 'Attc' or d == 'BTtc' or d == 'CTtc' or d == 'ITtc' or d == 'NTtc' or d == 'ZTtc'
endfunction


Just a function that checks if the given destructable is a tree.
That looks like you just too out a piece of my code and called it your own code..
__________________
Hero12341234 is offline   Reply With Quote
Old 01-18-2008, 07:18 AM   #27 (permalink)
 
Silvenon's Avatar

BBoy Silv
 
Join Date: Nov 2006
Posts: 866

Silvenon is on a distinguished road (81)Silvenon is on a distinguished road (81)


I never said I made it, but yes, that was a bitchy thing to do, sorry.

This is what I said when I was using the function in the Coding an efficient knockback tutorial if it makes you feel better:

Quote:
Originally Posted by Silvenon
This is a function I wrote (actually copied from Hero12341234's Tree Revival tutorial, hehe, sorry Hero....)
You can see for yourself if you don't believe me. I just modified it a bit.

Now I'm going in my room to cry........give me neg rep Purple! (not a joke, I deserve it)

Again, sorry Hero, I forgot to mention it was yours (like I did in the tutorial).
Silvenon is offline   Reply With Quote
Old 02-08-2008, 04:17 PM   #28 (permalink)

User
 
Join Date: Mar 2005
Posts: 230

DiscipleOfLife is on a distinguished road (71)DiscipleOfLife is on a distinguished road (71)


Hello friends. Here is my gift of the month to you:
EDIT: moved here
Not here anymore

I have tested all of these except for the __InGroup versions, but I think its safe to assume that all of them work because of their similarity.

Im also quite sure (lets say 100%) that this is faster than the FirstOfGroup(...) looping alternative.

117 lines of code... I guess this might be better off with a thread of its own but meh. If thats the case Im sure you'll tell me.
__________________

Last edited by DiscipleOfLife; 03-05-2008 at 12:04 PM..
DiscipleOfLife is offline   Reply With Quote
Old 02-08-2008, 05:28 PM   #29 (permalink)
 
Silvenon's Avatar

BBoy Silv
 
Join Date: Nov 2006
Posts: 866

Silvenon is on a distinguished road (81)Silvenon is on a distinguished road (81)


That looks awesome, but:

Quote:
To keep out a potential deluge of threads with very small functions, I've created this thread for you to post relatively short functions you wish to share.
I would rather post that in the JASS functions, not small code snippets.

Crap, this totally beats up my GetClosestUnit function, thanks Disciple <sarcasm> :P
Silvenon is offline   Reply With Quote
Old 02-09-2008, 03:43 PM   #30 (permalink)
 
hvo-busterkomo's Avatar

Resistance 2
 
Join Date: Jul 2007
Posts: 737

hvo-busterkomo has little to show at this moment (57)


This is really small, and probably already made, but it's worth a shot.

function AddWeatherEffectForPlayer takes rect where, integer effectID, player whichplayer returns nothing
    if GetLocalPlayer() == whichplayer then
        call AddWeatherEffect(where, effectID)
    endif
endfunction
__________________
Current Projects:

Humans vs Orcs v5.01 full release: 98%

Untitled Warcraft 1-2 historical reenactment: 30%
hvo-busterkomo is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Twice as small Oziris World Editor Help Zone 1 02-05-2008 10:41 AM
Small help needed with a small map-mod I'm making. Ekoi Map Development 5 10-07-2005 05:47 AM
GMAX CODE - Can someone give me your Gmax code please? Ryxian Modeling & Animation 1 11-12-2004 01:11 AM
Just a small hello. Sponge3737 Off-Topic 10 10-21-2004 09:16 PM

All times are GMT. The time now is 08:15 AM.






Your link here 
3dge Viral Emails | Guitar Lesson | Loans | Credit Card Offers | Mortgages