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 > Tutorials > JASS/AI scripts tutorials
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-19-2008, 08:02 AM   #31
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

You could update thus to use TimerUtils =P
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-19-2008, 08:47 AM   #32
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,514

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

It's really not a complicated process, Flame... I think you can figure it out.

Replace CreateTimer() with NewTimer(), DestroyTimer() with ReleaseTimer(), SetHandleInt() with SetTimerData(), and remove FlushHandleLocals().
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 12-19-2008, 11:20 AM   #33
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)

Default

Quote:
Originally Posted by moyack
Well, and doing a full code that search on units can be faster than a native function? I don't think so...
Think harder.

I must notice that both you and Vex are using <and if>-s quite simptomatic isn't it?
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

Last edited by cohadar : 12-19-2008 at 11:22 AM.
cohadar is offline   Reply With Quote
Old 12-19-2008, 11:36 AM   #34
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,269

Submissions (17)

moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Flame_Phoenix
You could update thus to use TimerUtils =P
Updated to use timerutils and removing the usage of Kattanas system.
moyack is offline   Reply With Quote
Old 01-01-2009, 07:47 PM   #35
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

As Pyro said this is masterful, however I have a question: this spell, especially the buff, it can't be used on a normal game because the humans already have slow. My question would be: how to avoid a conflict between the buffs ? Like, sure you will say "use a different buff" but what if I can't?
I am not sure if this question should be here though.
Anyway, hoping you can help, I am going to read this tutorial for the second time =D

Also, I don't want to seem bold, but as a suggestion Vexorian gave me (I assume it applies to all people on earth) you shold make the trigger local because it will be more portable.
You should change this:
Collapse JASS:
function InitTrig_Rabid_Bite takes nothing returns nothing
    set gg_trg_Rabid_Bite = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Rabid_Bite, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Rabid_Bite, Condition( function Conditions ) )
    call TriggerAddAction( gg_trg_Rabid_Bite, function Actions )
endfunction

into this:
Collapse JASS:
function InitTrig_Rabid_Bite takes nothing returns nothing
    local RabidBiteTrg = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(RabidBiteTrg, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( RabidBiteTrg, Condition( function Conditions ) )
    call TriggerAddAction( RabidBiteTrg, function Actions )
    set RabidBiteTrg = null
endfunction
 

You should also consider using the scope with an initializer:
Collapse JASS:
scope RabidByte initiazlier InitTrig_Rabid_Bite
endscope

And this way the InitTrig_Rabid_Bite function can also be private.

You helped me so many times, I am just trying to pay back the favor =)

Off-topic:
Thx for the comment to my tutorial. You really should check it now, it is finished =) (pratically lol)

EDIT

Collapse JASS:
private function Loop takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local Data D = Data(GetTimerData(t))
    local real Dam = Damage(GetUnitAbilityLevel(D.caster, SpellID))
    // This conditional detects if the buff is on the target unit...
    if not D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) > 0 then
        set D.hasbuff = true
    endif
    // If the buff is on the target unit, then do the effect
    if D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) > 0 then
        call UnitDamageTarget(D.caster, D.target, Dam * dt, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
    endif
    // If the buff is not present anymore, then stop the spell
    if D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) < 1 then
        call D.destroy()
        call ReleaseTimer(t)
    endif
    set t = null
endfunction

I have some questions about this:
1 - Why in the second if you check if the unit has the buff ? I mean, if the boolean is true, we already know it has the buff, why the need to use the "and" statement?
2 - In the end, the check fro non buff, shouldn't it be:
Collapse JASS:
if D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) < 0 then
instead of
Collapse JASS:
if D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) < 1 then
???
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 01-03-2009 at 01:54 PM.
Flame_Phoenix is offline   Reply With Quote
Old 01-03-2009, 02:41 PM   #36
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,269

Submissions (17)

moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Flame_Phoenix
As Pyro said this is masterful, however I have a question: this spell, especially the buff, it can't be used on a normal game because the humans already have slow. My question would be: how to avoid a conflict between the buffs ? Like, sure you will say "use a different buff" but what if I can't?
When I mean basing on slow is to create in the object editor an new ability based on slow and do the same with the buff, so there's no conflict...
Quote:
I am not sure if this question should be here though.
Anyway, hoping you can help, I am going to read this tutorial for the second time =D
Nice :)

Quote:
Also, I don't want to seem bold, but as a suggestion Vexorian gave me (I assume it applies to all people on earth) you shold make the trigger local because it will be more portable.
You should change this:
Collapse JASS:
function InitTrig_Rabid_Bite takes nothing returns nothing
    set gg_trg_Rabid_Bite = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Rabid_Bite, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Rabid_Bite, Condition( function Conditions ) )
    call TriggerAddAction( gg_trg_Rabid_Bite, function Actions )
endfunction

into this:
Collapse JASS:
function InitTrig_Rabid_Bite takes nothing returns nothing
    local RabidBiteTrg = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(RabidBiteTrg, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( RabidBiteTrg, Condition( function Conditions ) )
    call TriggerAddAction( RabidBiteTrg, function Actions )
    set RabidBiteTrg = null
endfunction
 

You should also consider using the scope with an initializer:
Collapse JASS:
scope RabidByte initiazlier InitTrig_Rabid_Bite
endscope

And this way the InitTrig_Rabid_Bite function can also be private.

You helped me so many times, I am just trying to pay back the favor =)
Ohh yes, you're right, I left is as is because I based my spell from a basic GUI trigger conversion, and this can be done too. I'll update this when I have time.

Quote:
Off-topic:
Thx for the comment to my tutorial. You really should check it now, it is finished =) (pratically lol)

EDIT

Collapse JASS:
private function Loop takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local Data D = Data(GetTimerData(t))
    local real Dam = Damage(GetUnitAbilityLevel(D.caster, SpellID))
    // This conditional detects if the buff is on the target unit...
    if not D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) > 0 then
        set D.hasbuff = true
    endif
    // If the buff is on the target unit, then do the effect
    if D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) > 0 then
        call UnitDamageTarget(D.caster, D.target, Dam * dt, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
    endif
    // If the buff is not present anymore, then stop the spell
    if D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) < 1 then
        call D.destroy()
        call ReleaseTimer(t)
    endif
    set t = null
endfunction

I have some questions about this:
1 - Why in the second if you check if the unit has the buff ? I mean, if the boolean is true, we already know it has the buff, why the need to use the "and" statement?
2 - In the end, the check fro non buff, shouldn't it be:
Collapse JASS:
if D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) < 0 then
instead of
Collapse JASS:
if D.hasbuff and GetUnitAbilityLevel(D.target, BuffID) < 1 then
???
moyack is offline   Reply With Quote
Old 01-16-2009, 02:58 PM   #37
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
When I mean basing on slow is to create in the object editor an new ability based on slow and do the same with the buff, so there's no conflict...
Problem is that there will be conflict =S
Please look at this very simple test map where I have 3 slow based spells, both with different buffs.

IMO Blizzard screwed up here ...
Attached Files
File Type: w3x slowBuff.w3x (16.7 KB, 8 views)
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix 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 09:29 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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