 |   |  |  |
JASS Functions Approved JASS functions will be located here.
Remember to submit your own resources to the submission forum. |
 |
|
10-18-2007, 01:10 PM
|
#16 (permalink)
|
work work!
Join Date: Nov 2004
Posts: 79
|
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!
|
|
|
12-03-2007, 12:04 PM
|
#17 (permalink)
|
BBoy Silv
Join Date: Nov 2006
Posts: 866
|
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 = nullendfunction
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
|
|
|
12-03-2007, 03:36 PM
|
#18 (permalink)
|
Resistance 2
Join Date: Jul 2007
Posts: 737
|
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 == trueendfunctionfunction 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%
|
|
|
12-03-2007, 10:40 PM
|
#19 (permalink)
|
BBoy Silv
Join Date: Nov 2006
Posts: 866
|
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
|
|
|
12-07-2007, 12:24 AM
|
#20 (permalink)
|
Resistance 2
Join Date: Jul 2007
Posts: 737
|
__________________
Current Projects:
Humans vs Orcs v5.01 full release: 98%
Untitled Warcraft 1-2 historical reenactment: 30%
|
|
|
12-07-2007, 09:32 PM
|
#21 (permalink)
|
iRawr
Join Date: Dec 2005
Posts: 8,349
|
Ah yes, adding some to the listing...
No offense, but yes it is.
|
|
|
12-09-2007, 11:41 AM
|
#22 (permalink)
|
BBoy Silv
Join Date: Nov 2006
Posts: 866
|
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
|
|
|
01-13-2008, 09:59 AM
|
#23 (permalink)
|
BBoy Silv
Join Date: Nov 2006
Posts: 866
|
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..
|
|
|
01-15-2008, 05:41 PM
|
#24 (permalink)
|
iRawr
Join Date: Dec 2005
Posts: 8,349
|
Use 'or'? T'would be better than using elseif, since and/or are short circuit in JASS, apparently.
|
|
|
01-15-2008, 09:25 PM
|
#25 (permalink)
|
BBoy Silv
Join Date: Nov 2006
Posts: 866
|
Ok, I wanted to do that too, but the stupid editor didn't allow such a long line.
*Edited*
|
|
|
01-18-2008, 12:26 AM
|
#26 (permalink)
|
────║╣ero────
Join Date: Dec 2006
Posts: 75
|
Quote:
Originally Posted by Silvenon
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..
|
|
|
01-18-2008, 07:18 AM
|
#27 (permalink)
|
BBoy Silv
Join Date: Nov 2006
Posts: 866
|
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).
|
|
|
02-08-2008, 04:17 PM
|
#28 (permalink)
|
User
Join Date: Mar 2005
Posts: 230
|
Hello friends. Here is my gift of the month to you:
EDIT: moved here
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..
|
|
|
02-08-2008, 05:28 PM
|
#29 (permalink)
|
BBoy Silv
Join Date: Nov 2006
Posts: 866
|
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
|
|
|
02-09-2008, 03:43 PM
|
#30 (permalink)
|
Resistance 2
Join Date: Jul 2007
Posts: 737
|
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 ) endifendfunction
__________________
Current Projects:
Humans vs Orcs v5.01 full release: 98%
Untitled Warcraft 1-2 historical reenactment: 30%
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
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
|
|
|
|  |  |  |  |   |  |
|