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 08-28-2007, 04:57 AM   #31
moyack
Evil Emoticon
 
moyack's Avatar


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

Submissions (17)

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

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

Send a message via MSN to moyack
Default

what?? that function is highlighted in JASSCRAFT and in notepad++. If it happens with your JASSCRAFT, probably it's using a damaged common.j file. Could you post some screenshots please??
moyack is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-01-2007, 10:35 AM   #32
frozenthrone2000
User
 
Join Date: Apr 2007
Posts: 14

frozenthrone2000 has little to show at this moment (0)

Default

Here's the screenshot attached...

Regarding the corrupted file... I think that one of those files really IS corrupted. Whenever I run a syntax check on the common.j, blizzard.j and [Vexorian's] caster system.j, the last one has at least 30 errors. This screenshot also shows two more un-highlighted functions. Hehe... sorry for mixing Vexorian's caster system here.
Attached Images
File Type: jpg my_screenshot.JPG (383.2 KB, 52 views)

Last edited by frozenthrone2000 : 09-01-2007 at 10:40 AM.
frozenthrone2000 is offline   Reply With Quote
Old 11-21-2007, 10:19 AM   #33
Just call me Js
User
 
Join Date: Nov 2007
Posts: 3

Just call me Js has little to show at this moment (0)

Default

i followed your tutorial up to the part before Improving the spell, then i tested the spell somehow it didnt get past the syntax checker although i checked and it seems mine is exactly the same.(some "Invalid argument type(group)" error). Heres my code :

Collapse JASS:
function Trig_Stomp_Conditions takes nothing returns boolean
    return GetSpellAbilityId()=='A001'
endfunction

function Stomp_Filter takes nothing returns boolean
    return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()),GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit())>0.405 and not IsUnitType(GetFilterUnit(),UNIT_TYPE_FLYING)
endfunction

function Stomp_CopyGroup takes group g returns group
    set bj_groupAddGroupDest = CreateGroup()
    call ForGroup(g,function GroupAddGroupEnum)
    return bj_groupAddGroupDest
endfunction

function Stomp_Move takes nothing returns nothing
    local string s = I2S(H2I(GetExpiredTimer()))
    local gamecache gc = udg_AbilityCache
    local real x = GetStoredReal(gc,s,"x")
    local real y = GetStoredReal(gc,s,"y")
    local integer level = GetStoredInteger(gc,s,"level")
    local group g = Stomp_CopyGroup(I2G(GetStoredInteger(gc,s,"group")))
    local real dur = GetStoredReal(gc,s,"dur")+0.05
    local real ux
    local real uy
    local real a
    local unit f
    
    if dur < 1+0.5*level then
        loop
            set f = FirstOfGroup(g)
            exitwhen f == null
            set ux = GetUnitX(f)
            set uy = GetUnitY(f)
            set a = Atan2(uy-y,ux-x)
            call SetUnitPosition(f,ux+40*Cos(a),uy+40*Sin(a))
            call GroupRemoveUnit(g,f)
        endloop
        call StoreReal(gc,s,"dur",dur)
    else
        call DestroyGroup(I2G(GetStoredInteger(gc,s,"group")))
        call FlushStoredMission(gc,s)
        call DestroyTimer(GetExpiredTimer())
    endif
    set gc = null
    call DestroyGroup(g)
    set g = null
    set f = null
endfunction

function Trig_Stomp_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local integer level = GetUnitAbilityLevel(caster,'A001')
    local boolexpr b = Condition(function Stomp_Filter)
    local group g = CreateGroup()
    local group g2 
    local unit f
    local gamecache gc = udg_AbilityCache
    local timer t = CreateTimer()
    local string s = I2S(H2I(t))
    
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",x,y))
    call GroupEnumUnitsInRange(g,x,y,500+50*level,b)
    set g2 = Stomp_CopyGroup(g)
    loop
        set f = FirstOfGroup(g2)
        exitwhen f == null
        call UnitDamageTarget(caster,f,50*level,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
        call GroupRemoveUnit(g2,f)
    endloop
    call StoreInteger(gc, s, "level" ,level)
    call StoreInteger(gc, g, "group" ,H2I(g))
    call StoreReal(gc, s, "x", x)//<<<<<<<<<<<<<<<THE PROBLEM! 
    call StoreReal(gc, s, "y", y)
    call TimerStart(t,0.05,true,function Stomp_Move)
    set caster = null
    call DestroyBoolExpr(b)
    set b = null
    set g = null
    call DestroyGroup(g2)
    set g2 = null
    set f = null
    set gc = null
    set t = null    
endfunction

//===========================================================================
function InitTrig_Stomp takes nothing returns nothing
    set gg_trg_Stomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Stomp, Condition( function Trig_Stomp_Conditions ) )
    call TriggerAddAction( gg_trg_Stomp, function Trig_Stomp_Actions )
    call Preload("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl")
endfunction

So i decided to just copy paste your example at the end of the tutorial into my trigger, it all seems to work except for the knockback, for some reason the knockback isnt working the code which i copy pasted:

Collapse JASS:
function Trig_Stomp_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A001'
endfunction

function Stomp_Filter takes nothing returns boolean
    return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit()) > 0.405 and not IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)
endfunction

function Stomp_CopyGroup takes group g returns group
    set bj_groupAddGroupDest = CreateGroup()
    call ForGroup(g, function GroupAddGroupEnum)      
    return bj_groupAddGroupDest
endfunction

function Stomp_Move takes nothing returns nothing
    local string s = I2S(H2I(GetExpiredTimer()))
    local gamecache gc = udg_AbilityCache
    local real x = GetStoredReal(gc, s, "x")
    local real y = GetStoredReal(gc, s, "y")
    local integer i = GetStoredInteger(gc, s, "level")
    local group g = Stomp_CopyGroup(I2G(GetStoredInteger(gc, s, "group")))
    local real dur = GetStoredReal(gc, s, "dur")+0.05
    local real ux
    local real uy
    local real a
    local unit f
    call DisplayTextToPlayer(Player(0),0,0,"The Stomp_Move before the 'if' activated")
    if dur < 1+0.5*i then
        loop
            call DisplayTextToPlayer(Player(0),0,0,"The Stomp_Move within the loop activated")
            set f = FirstOfGroup(g)
            exitwhen f == null
            set ux = GetUnitX(f)
            set uy = GetUnitY(f)
            set a = Atan2(uy-y, ux-x)
            call SetUnitPosition(f, ux+1000*Cos(a), uy+1000*Sin(a))
            call GroupRemoveUnit(g, f)
        endloop
        call StoreReal(gc, s, "dur", dur)
    else
        call DestroyGroup(I2G(GetStoredInteger(gc, s, "group")))
        call FlushStoredMission(gc, s)
        call DestroyTimer(GetExpiredTimer())
    endif
    set gc = null
    call DestroyGroup(g)
    set g = null
    set f = null
endfunction

function Trig_Stomp_Actions takes nothing returns nothing
    local unit c = GetTriggerUnit()
    local real x = GetUnitX(c)
    local real y = GetUnitY(c)
    local integer i = GetUnitAbilityLevel(c, 'A001')
    local boolexpr b = Condition(function Stomp_Filter)
    local group g = CreateGroup()
    local group n
    local unit f
    local gamecache gc = udg_AbilityCache
    local timer t = CreateTimer()
    local string s = I2S(H2I(t))
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y))
    call GroupEnumUnitsInRange(g, x, y, 500+50*i, b)
    set n = Stomp_CopyGroup(g)
    loop
        set f = FirstOfGroup(n)
        exitwhen f == null
        call UnitDamageTarget(c, f, 75*i, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
        call GroupRemoveUnit(n, f)
    endloop
    call StoreInteger(gc, s, "level", i)
    call StoreInteger(gc, s, "group", H2I(g))
    call StoreReal(gc, s, "x", x)
    call StoreReal(gc, s, "y", y)
    call TimerStart(t, 0.05, true, function Stomp_Move)
    set c = null
    call DestroyBoolExpr(b)
    set b = null
    set g = null
    call DestroyGroup(n)
    set n = null
    set f = null
    set gc = null
    set t = null
endfunction


//===========================================================================
function InitTrig_Stomp takes nothing returns nothing
    set gg_trg_Stomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Stomp, Condition( function Trig_Stomp_Conditions ) )
    call TriggerAddAction( gg_trg_Stomp, function Trig_Stomp_Actions )
    call Preload("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl")
endfunction

i hope you can answer my questions.
Just call me Js is offline   Reply With Quote
Old 12-30-2007, 04:38 PM   #34
Mantraminator
User
 
Join Date: Nov 2007
Posts: 5

Mantraminator has little to show at this moment (4)

Question

thank you for your amazing tutorial!
everything works well, i mean there are no syntax errors, but my problem is, that the targets dont slow down, they move all the way with the same speed...
here is my code:

Collapse JASS:
function Trig_Stomp_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Stomp_Filter takes nothing returns boolean
    return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit()) > 0.405 and not IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)
endfunction

function Stomp_CopyGroup takes group g returns group
    set bj_groupAddGroupDest = CreateGroup()
    call ForGroup(g, function GroupAddGroupEnum)
    return bj_groupAddGroupDest
endfunction

function Stomp_Move takes nothing returns nothing
    local string s = I2S(H2I(GetExpiredTimer()))
    local gamecache gc = udg_AbilityCache
    local real x = GetStoredReal(gc, s, "x")
    local real y = GetStoredReal(gc, s, "y")
    local integer i = GetStoredInteger(gc, s, "level")
    local group g = Stomp_CopyGroup(I2G(GetStoredInteger(gc, s, "group")))
    local real dur = GetStoredReal(gc, s, "dur")+0.05
    local real ux
    local real uy
    local real a
    local unit f
    local real p = GetStoredReal(gc, s, "speed")-0.5/(1+0.5*i)
    local real fx = GetStoredReal(gc, s, "fx")+0.05
    if dur < 1+0.5*i then
        loop
            set f = FirstOfGroup(g)
            exitwhen f == null
            set ux = GetUnitX(f)
            set uy = GetUnitY(f)
            set a = Atan2(uy-y, ux-x)
            call SetUnitPosition(f, ux+p*Cos(a), uy+p*Sin(a))
            if fx >= 1 then
                call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", f, "origin"))
            endif
            call GroupRemoveUnit(g, f)
        endloop
        call StoreReal(gc, s, "dur", dur)
        call StoreReal(gc, s, "speed", p)
        call StoreReal(gc, s, "fx", fx)
        if fx >= 1 then
            call StoreReal(gc, s, "fx", 0)
        endif
    else       
        set gc = null
        call DestroyGroup(g)
        set g = null
        set f = null
    endif
endfunction

function Trig_Stomp_Actions takes nothing returns nothing
    local unit c = GetTriggerUnit()
    local real x = GetUnitX(c)
    local real y = GetUnitY(c)
    local integer i = GetUnitAbilityLevel(c, 'A000')
    local boolexpr b = Condition(function Stomp_Filter)
    local group g = CreateGroup()
    local group n
    local unit f
    local gamecache gc = udg_AbilityCache
    local timer t = CreateTimer()
    local string s = I2S(H2I(t))
    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y))
    call GroupEnumUnitsInRange(g, x, y, 100+50*i, b)
    set n = Stomp_CopyGroup(g)
    loop
        set f = FirstOfGroup(n)
        exitwhen f == null
        call UnitDamageTarget(c, f, 25*i, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
        call GroupRemoveUnit(n, f)
    endloop
    call StoreInteger(gc, s, "level", i)
    call StoreInteger(gc, s, "group", H2I(g))
    call StoreReal(gc, s, "x", x)
    call StoreReal(gc, s, "y", y)
    call StoreReal(gc, s, "speed", 50)
    call TimerStart(t, 0.05, true, function Stomp_Move)
    set c = null
    call DestroyBoolExpr(b)
    set b = null
    set g = null
    call DestroyGroup(n)
    set n = null
    set f = null
    set gc = null
    set t = null
endfunction

//===========================================================================
function InitTrig_Stomp takes nothing returns nothing
    set gg_trg_Stomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Stomp, Condition( function Trig_Stomp_Conditions ) )
    call TriggerAddAction( gg_trg_Stomp, function Trig_Stomp_Actions )
    call Preload("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl")
    call Preload("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl")
endfunction

i hope somebody can help me

Last edited by Mantraminator : 01-01-2008 at 01:42 AM.
Mantraminator is offline   Reply With Quote
Old 01-15-2008, 09:38 AM   #35
Mantraminator
User
 
Join Date: Nov 2007
Posts: 5

Mantraminator has little to show at this moment (4)

Default

plz, could anybody help me and see through my code? (srry for doubleposting but i cant delete it anymore...) :(

Last edited by Mantraminator : 01-15-2008 at 09:39 AM.
Mantraminator is offline   Reply With Quote
Old 01-16-2008, 02:00 AM   #36
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


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

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 is slowing down, but it's such a miniscule amount that you don't notice it. In the line where you decrease the speed (local real p = GetStoredReal(gc, s, "speed")-0.5/(1+0.5*i)) you're decreasing it by 0.33, 0.25, and 0.20 for levels 1, 2, and 3 respectively.

You should instead change it to a much, much greater number like this: local real p = GetStoredReal(gc, s, "speed")-22.5/(1+0.5*i)
__________________
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 01-23-2008, 03:35 PM   #37
Mantraminator
User
 
Join Date: Nov 2007
Posts: 5

Mantraminator has little to show at this moment (4)

Default


for answering my question, now it works^^
Mantraminator is offline   Reply With Quote
Old 01-27-2008, 03:22 PM   #38
BurmistrovJ
User
 
Join Date: Jan 2008
Posts: 1

BurmistrovJ has little to show at this moment (0)

Default

Thanks this tutorial sure tought me a lot about jass basics...
BurmistrovJ is offline   Reply With Quote
Old 02-13-2008, 06:53 PM   #39
RolePlaynGamer
User
 
RolePlaynGamer's Avatar
 
Join Date: Feb 2008
Posts: 199

Submissions (1)

RolePlaynGamer is on a distinguished road (20)

Send a message via MSN to RolePlaynGamer
Default

Thanks Blade.dk, this tut learned me a lot of nice stuff. Keep up the good work and finish your second spell tutorial ;)
RolePlaynGamer is offline   Reply With Quote
Old 06-11-2008, 10:17 AM   #40
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

Hii, it is a great tutorial, although i do admire how you managed to complicate such a simple spell ...
I have some question and fixes you should make.

First question, will your use GameCache. Katana's system is said to cause problems when using campaigns. So, will your code cause problems on single player campaigns as well ?

I am an adept of ABC (ya i know is old, but is easy to use, and the guys from HAIL and the other thing don't exaplin much about how using their systems).
Will your code (or Katana's system) conflict with my ABC spells ?

There is a new thing now vJASS (new when compared to your tutorial). Will your spell and cache thing work Ok with vJASS and structs ?

To conclude, with need 2 triggers, (one for spell, other for cache) and we need to place the H2I functions in maps header rit ?

I think these are all questions for now (lol)

Now, when reading your tutorial i saw a few mistakes, and I pointed some:

When you say:
"The line where the boolexpr variable is declared also shows how to use function pointers - Notice that the function you refer to must be above the function where you refer to it in.
I use the Condition() native here, but the Filter() native could also be used, as it does the same (Note: They don't do exactly the same. The Condition() native returns a conditionfunc, and the Filter() native returns a filterfunc. But both conditionfunc and filterfunc are children of the boolexpr type, and all the GroupEnumUnits* natives takes a boolexpr argument. Therefore both are valid, so it does not matter which one we use)."

Why is GroupEnumUnits with the * thing ?? did you forgot to tell something ? I found no notes elated to it in the end of the tutorial.

Also in your code:
Collapse JASS:
else
        call DestroyGroup(I2G(GetStoredInteger(gc, s, "group")))
        call FlushStoredMission(gc, s)
        call DestroyTimer(GetExpiredTimer())
    endif

There is a reasonable chance that destroying a timer like you do will cause a leak or a bug.
The solution for this is to use Timer recycling systems, or you can just pause the timer first, and then destroy it (which is what i advice).
You probably already knew this but forgot to update the tutorial, so i am saying now.
I only discovered this little time ago, but if you need you can talk to DoctorSuperGood or EarthFury the THW chatroom they will explain every detail to you.
__________________
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
Old 06-11-2008, 10:25 AM   #41
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

Hi i found it amazing how you managed to complicate such a simple thing.
Anyway, when reading your tutorial I saw some little mistakes, and i have some questions.

First of all, is said that cache systems (like Katana's) do not work in campaigns. Your spell uses cache so, will it work on a single player campaign ?

Will this spell conflict with ABC system ??
Will it conflict with vJASS structs ??

Also, i found some typos you may want to correct:

Quote:
The line where the boolexpr variable is declared also shows how to use function pointers - Notice that the function you refer to must be above the function where you refer to it in.
I use the Condition() native here, but the Filter() native could also be used, as it does the same (Note: They don't do exactly the same. The Condition() native returns a conditionfunc, and the Filter() native returns a filterfunc. But both conditionfunc and filterfunc are children of the boolexpr type, and all the GroupEnumUnits* natives takes a boolexpr argument. Therefore both are valid, so it does not matter which one we use).

Why is GroupEnumUnits with the * thing ?? Did you forget to write something down ?

Also in the code:

Collapse JASS:
else
        call DestroyGroup(I2G(GetStoredInteger(gc, s, "group")))
        call FlushStoredMission(gc, s)
        call DestroyTimer(GetExpiredTimer())
    endif

There is a reasonable chance that by destroying a timer like that it will leak or cause bugs.
The solution for this it to use a timer recycling system, or (as i advice) to first pause the timer, and then destroy it.
This a rare bug as well, you probably already knew it but forgot to update the tutorial, so here i am remembering you =P
If you need to know more talk to EarthFury or DoctorSuperGood on THW chatroom, those guys will explain every detail to you.
There are also some tutorials about this but i am not sure where.

Great tutorial, btw, can you link me to the other tutorial of the sequence ?? I am kinda lost here =S

Hope it helps.
__________________
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 : 06-11-2008 at 10:27 AM.
Flame_Phoenix is offline   Reply With Quote
Old 06-14-2008, 05:15 AM   #42
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


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

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

First off, I should note that Blade.dk is no longer here. He's just gone. So he won't be updating the tutorial, but I can answer your questions for you.
Quote:
Originally Posted by Flame_Phoenix
First question, will your use GameCache. Katana's system is said to cause problems when using campaigns. So, will your code cause problems on single player campaigns as well ?

I am an adept of ABC (ya i know is old, but is easy to use, and the guys from HAIL and the other thing don't exaplin much about how using their systems).
Will your code (or Katana's system) conflict with my ABC spells ?

There is a new thing now vJASS (new when compared to your tutorial). Will your spell and cache thing work Ok with vJASS and structs ?

To conclude, with need 2 triggers, (one for spell, other for cache) and we need to place the H2I functions in maps header rit ?
No. No. Yes, but only if the code for it is in all maps of the campaign. Yes.

The purpose of this tutorial is to educate on the basics of JASS spellmaking, and a great start is KaTTaNa's system; there's no need to complicate the tutorial with a whole bombardment about other storage options and really it's all up to preference, personal choice, and the options you actually have. For instance, Mac OS X users cannot use any vJASS code (which includes HAIL, ABC, structs, etc.); one person reading the tutorial might want to use ABC, whilst others may prefer CSData. If this tutorial required the person trying to learn from it to use vJASS and a specific system (rather than the basic, original: Local Handle Variables), then this tutorial would be useless or a bad choice to/for some people.
Quote:
Originally Posted by Flame_Phoenix
Why is GroupEnumUnits with the * thing ?? did you forgot to tell something ? I found no notes elated to it in the end of the tutorial.
Because he's saying any function that starts with "GroupEnumUnits", such as:
Collapse JASS:
native GroupEnumUnitsOfType                 takes group whichGroup, string unitname, boolexpr filter returns nothing
native GroupEnumUnitsOfPlayer               takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
native GroupEnumUnitsOfTypeCounted          takes group whichGroup, string unitname, boolexpr filter, integer countLimit returns nothing
native GroupEnumUnitsInRect                 takes group whichGroup, rect r, boolexpr filter returns nothing
native GroupEnumUnitsInRectCounted          takes group whichGroup, rect r, boolexpr filter, integer countLimit returns nothing
native GroupEnumUnitsInRange                takes group whichGroup, real x, real y, real radius, boolexpr filter returns nothing
native GroupEnumUnitsInRangeOfLoc           takes group whichGroup, location whichLocation, real radius, boolexpr filter returns nothing
native GroupEnumUnitsInRangeCounted         takes group whichGroup, real x, real y, real radius, boolexpr filter, integer countLimit returns nothing
native GroupEnumUnitsInRangeOfLocCounted    takes group whichGroup, location whichLocation, real radius, boolexpr filter, integer countLimit returns nothing
native GroupEnumUnitsSelected               takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
Quote:
Originally Posted by Flame_Phoenix
There is a reasonable chance that by destroying a timer like that it will leak or cause bugs.
The solution for this it to use a timer recycling system, or (as i advice) to first pause the timer, and then destroy it.
This a rare bug as well, you probably already knew it but forgot to update the tutorial, so here i am remembering you =P
Let's not overcomplicate things. The timer stuff is mentioned/discussed in Rising_Dusk's Timers: The Tricks and the Traps tutorial.
Quote:
Originally Posted by Flame_Phoenix
Great tutorial, btw, can you link me to the other tutorial of the sequence ?? I am kinda lost here =S
He never wrote them. He disappeared.
__________________
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 06-14-2008, 12:48 PM   #43
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

OMG, he is dead !? NOOOOOO.... i wanted so much to learn more about this kind of stuff.... who do I ask if I need help?

Anyway, thx for your answers Pyrogasm, really. I thought that this was ment to be ignored. Anyway, +rep for you ! =)
__________________
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
Old 06-14-2008, 07:37 PM   #44
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


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

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

You post in the Triggers and Scripts forum... that's why it's there. Or ask questions here if it's specifically related to this tutorial, but a new thread is probably better.
__________________
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 09-04-2008, 07:44 PM   #45
b_a_d
User
 
Join Date: Mar 2008
Posts: 9

b_a_d has little to show at this moment (0)

Default

hey im having a problem with mine when i use the spell it stomps but nothing happens the units take no damage or anything any ideas why this would be doing that heres my code
Collapse JASS:
constant function Stomp_SpellId takes nothing returns integer
    return 'A011'
endfunction

function Stomp_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == Stomp_SpellId()
endfunction

function Stomp_Filter takes nothing returns boolean
    return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetFilterUnit())) and GetWidgetLife(GetFilterUnit()) > 0.405 and not IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)
endfunction

function Stomp_CopyGroup takes group g returns group
    set bj_groupAddGroupDest = CreateGroup()
    call ForGroup(g, function GroupAddGroupEnum)
    return bj_groupAddGroupDest
endfunction

function Stomp_Move takes nothing returns nothing
    local string s = I2S(H2I(GetExpiredTimer()))
    local gamecache gc = udg_AbilityCache
    local real x = GetStoredReal(gc, s, "x")
    local real y = GetStoredReal(gc, s, "y")
    local integer i = GetStoredInteger(gc, s, "level")
    local group g = Stomp_CopyGroup(I2G(GetStoredInteger(gc, s, "group")))
    local real dur = GetStoredReal(gc, s, "dur")+0.05
    local real ux
    local real uy
    local real a
    local unit f
    local real p = GetStoredReal(gc, s, "speed")-22.5/(1+0.5*i)
    local real fx = GetStoredReal(gc, s, "fx")+0.05
    if dur < 1+0.5*i then
        loop
            set f = FirstOfGroup(g)
            exitwhen f == null
            set ux = GetUnitX(f)
            set uy = GetUnitY(f)
            set a = Atan2(uy-y, ux-x)
            call SetUnitPosition(f, ux+p*Cos(a), uy+p*Sin(a))
            if fx >= 1 then
                call DestroyEffect(AddSpecialEffectTarget(GetAbilityEffectById(Stomp_SpellId(), EFFECT_TYPE_MISSILE, 1), f, GetAbilityEffectById(Stomp_SpellId(), EFFECT_TYPE_MISSILE, 2)))
            endif
            call GroupRemoveUnit(g, f)
        endloop
        call StoreReal(gc, s, "dur", dur)
        call StoreReal(gc, s, "speed", p)
        call StoreReal(gc, s, "fx", fx)
        if fx >= 1 then
            call StoreReal(gc, s, "fx", 0)
        endif
    else
        call DestroyGroup(I2G(GetStoredInteger(gc, s, "group")))
        call FlushStoredMission(gc, s)
        call DestroyTimer(GetExpiredTimer())
    endif
    set gc = null
    call DestroyGroup(g)
    set g = null
    set f = null
endfunction

function Stomp_Actions takes nothing returns nothing
    local unit c = GetTriggerUnit()
    local real x = GetUnitX(c)
    local real y = GetUnitY(c)
    local integer i = GetUnitAbilityLevel(c, Stomp_SpellId())
    local boolexpr b = Condition(function Stomp_Filter)
    local group g = CreateGroup()
    local group n
    local unit f
    local gamecache gc = udg_AbilityCache
    local timer t = CreateTimer()
    local string s = I2S(H2I(t))
    call DestroyEffect(AddSpecialEffect(GetAbilityEffectById(Stomp_SpellId(), EFFECT_TYPE_MISSILE, 0), x, y))
    call GroupEnumUnitsInRange(g, x, y, 100+50*i, b)
    set n = Stomp_CopyGroup(g)
    loop
        set f = FirstOfGroup(n)
        exitwhen f == null
        call UnitDamageTarget(c, f, 25*i, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
        call GroupRemoveUnit(n, f)
    endloop
    call StoreInteger(gc, s, "level", i)
    call StoreInteger(gc, s, "group", H2I(g))
    call StoreReal(gc, s, "x", x)
    call StoreReal(gc, s, "y", y)
    call TimerStart(t, 0.05, true, function Stomp_Move)
    set c = null
    call DestroyBoolExpr(b)
    set b = null
    set g = null
    call DestroyGroup(n)
    set n = null
    set f = null
    set gc = null
    set t = null
endfunction

//===========================================================================
function InitStomp takes nothing returns nothing
    set gg_trg_Stomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Stomp, Condition( function Stomp_Conditions ) )
    call TriggerAddAction( gg_trg_Stomp, function Stomp_Actions )
    call Preload(GetAbilityEffectById(Stomp_SpellId(), EFFECT_TYPE_MISSILE, 0))
    call Preload(GetAbilityEffectById(Stomp_SpellId(), EFFECT_TYPE_MISSILE, 1))
endfunction
b_a_d 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:03 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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