Where the old players come back to what once was grand
 
HomeFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 Freezing Orb

View previous topic View next topic Go down 
AuthorMessage
Piddagoras
Map Maker
avatar

Number of posts : 592
Registration date : 2008-05-22
Age : 29
Location : California

Your Character
Level: 1
Primary Move: Cosines and Sines.

PostSubject: Freezing Orb   Mon Feb 09, 2009 12:43 am

Code:
function FreezingOrbContact takes nothing returns nothing
  local unit tar= GetTriggerUnit()
  local unit m= (s__csmissile_m[(sg__CSData__csdata_get(CS_H2I((GetTriggeringTrigger())) - CSData__MIN_HANDLE_ID))]) // INLINED!!
  local integer ms= GetMissileStruct(m)
  local group g
  local unit temp
  local integer level
    if ( tar == null ) then //Is basically a recode of Frost Nova
        set level = my_GetSpellLevel(s__MissileStruct_owner[ms] , FrostNovaUpg)
        set g = NewGroup()
        set globalUnit = m
        call GroupEnumUnitsInRange(g , GetUnitX(m) , GetUnitY(m) , 325 , Filter(function EnemyFilter))
        loop
            set temp = FirstOfGroup(g)
            exitwhen temp == null
            call GroupRemoveUnit(g , temp)
                call UnitDamageTarget(s__MissileStruct_caster[ms] , temp , ( ( level * GetHeroAgi(s__MissileStruct_caster[ms] , true) ) + AddUnitItemReal(s__MissileStruct_caster[ms] , 'I01O' , 95.0) ) * 2 , true , false , ATTACK_TYPE_NORMAL , DAMAGE_TYPE_COLD , WEAPON_TYPE_WHOKNOWS)
                //takes player owner, integer abilid, integer level, string order, unit target, boolean instant returns unit
                call UnitSlowTarget(s__MissileStruct_caster[ms] , temp , I2R(1 + 2 * level))
        endloop
        call ReleaseGroup(g)
        //real time, string e, real x, real y returns nothing
        call s__TimedGraphic_create("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl" , GetUnitX(m) , GetUnitY(m) , 5)
        call DestroyMissileStruct(m)
        call CollisionMissile_Destroy(m)
    elseif ( not IsUnitAlly(tar , s__MissileStruct_owner[ms]) ) then
        set level = my_GetSpellLevel(s__MissileStruct_owner[ms] , FreezeUpg)
        //takes player owner, integer abilid, integer level, string order, unit target, boolean instant returns unit
        call CasterCastAbilityLevel(s__MissileStruct_owner[ms] , 'A02R' , level , "entanglingroots" , tar , true) //Freeze
        call UnitSlowTarget(s__MissileStruct_caster[ms] , tar , I2R(4 + level * 4)) //Slow Effect
    endif
  //Clean up
  set temp = null
  set tar = null
  set m = null
  set g = null
endfunction
function FreezingOrb_Actions takes nothing returns nothing
  local unit u= GetTriggerUnit()
  local location tarLoc= GetSpellTargetLoc()
  local real angle= my_AngleBetweenUnitAndLocation(u , tarLoc)
  local real distance= my_DistanceBetweenUnitAndLocation(u , tarLoc)
  local integer ms= (s__MissileStruct__allocate()) // INLINED!!
    set s__MissileStruct_caster[ms]=u
    set s__MissileStruct_owner[ms]=GetOwningPlayer(u)
    //takes string MissileModelPath, real x, real y, real dirangle, real speed, real AngleSpeed, real MaxDist,  real height, boolean UseNewCaster, real Collision, code OnImpact returns unit
    call SetMissileStruct(CollisionMissile_Create("Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl" , GetUnitX(u) , GetUnitY(u) , angle , 741.0 , 0.0 , distance , 35.0 , true , 92.0 , function FreezingOrbContact) , ms)
    call RemoveLocation(tarLoc)
  //Clean up
  set u = null
  set tarLoc = null
endfunction

HolyNeko wants to try to fix it.

Code:
function FrostNova_Actions takes nothing returns nothing
  local unit u= GetTriggerUnit()
  local player p= GetOwningPlayer(u)
  local location loc= GetSpellTargetLoc()
  local group g
  local integer level= my_GetSpellLevel(p , FrostNovaUpg)
  local integer duration= 1 + 2 * level
  local real damage= level * GetHeroAgi(u , true)
  local unit temp= null
        set g = NewGroup()
        set globalUnit = u
        call GroupEnumUnitsInRange(g , GetLocationX(loc) , GetLocationY(loc) , 325 , Filter(function EnemyFilter))
    loop
        set temp = FirstOfGroup(g)
        //call BJDebugMsg("Looping Frost Nova")
        exitwhen temp == null
        call GroupRemoveUnit(g , temp)
            call UnitDamageTarget(u , temp , damage + AddUnitItemReal(u , 'I01O' , 95.0) , true , false , ATTACK_TYPE_NORMAL , DAMAGE_TYPE_COLD , WEAPON_TYPE_WHOKNOWS)
            //takes player owner, integer abilid, integer level, string order, unit target, boolean instant returns unit
            call UnitSlowTarget(u , temp , duration)
    endloop
    call AddItemManaRestoreIce(u)
    call ReleaseGroup(g)
    call RemoveLocation(loc)
    set loc = null
  //Clean up
  set u = null
  set p = null
  set g = null
  set temp = null
endfunction

Frost nova code

_________________

"On the lips, on the mouth, on the floor, reaching out.
On the carpet, on the ceiling, no more words, no more feelings"
Back to top Go down
View user profile
AquaAscension
Legendary
Legendary


Number of posts : 580
Registration date : 2008-05-21

Your Character
Level: 1
Primary Move: Flying Dragon Kick

PostSubject: Re: Freezing Orb   Mon Feb 09, 2009 2:45 am

>.< good luck.

Codes... confuse me.
Back to top Go down
View user profile
diaster
Ultimate Sage
Ultimate Sage
avatar

Number of posts : 1378
Registration date : 2008-05-21
Age : 27
Location : behind you

Your Character
Level: 1
Primary Move: Wind Control

PostSubject: Re: Freezing Orb   Mon Feb 09, 2009 2:58 pm

my eyes....they burn >_< can't do anything with jass sorry.
Back to top Go down
View user profile
Zync
Elite Mage
Elite Mage


Number of posts : 364
Registration date : 2008-06-20
Age : 32
Location : Arizona

Your Character
Level: 1
Primary Move: Karate Chop

PostSubject: Re: Freezing Orb   Mon Feb 09, 2009 3:18 pm

In truth, since it is compiled, that code is hard to read for even experienced JASSers ( especially some of the lines that end in "//INLINED!!" get atrocious ).
Back to top Go down
View user profile
Piddagoras
Map Maker
avatar

Number of posts : 592
Registration date : 2008-05-22
Age : 29
Location : California

Your Character
Level: 1
Primary Move: Cosines and Sines.

PostSubject: Re: Freezing Orb   Mon Feb 09, 2009 5:56 pm

Yeah, but I figured I should post the compiled version because HolyNeko is unfamiliar with vJASS syntax and only has the convert to custom text option and a native/bj library.

_________________

"On the lips, on the mouth, on the floor, reaching out.
On the carpet, on the ceiling, no more words, no more feelings"
Back to top Go down
View user profile
Zync
Elite Mage
Elite Mage


Number of posts : 364
Registration date : 2008-06-20
Age : 32
Location : Arizona

Your Character
Level: 1
Primary Move: Karate Chop

PostSubject: Re: Freezing Orb   Mon Feb 09, 2009 6:10 pm

Wow, that's like ... programming in Basic ... that's a nightmare.
Back to top Go down
View user profile
Rhys
Map Maker
avatar

Number of posts : 719
Registration date : 2008-05-23
Age : 35
Location : Massachusetts

Your Character
Level: 1
Primary Move: Atomic Tea-Bag

PostSubject: Re: Freezing Orb   Mon Feb 09, 2009 6:43 pm

in all honesty im fairly certain he just wanted to show neko that it was not as easy as he thinks it is since hes been pretty much saying he is going to be fixing all the bugs in mm&m now the he is a leet coder in jass =p


I actually have an easier time reading it post compiled because it reminds me of other languages which Im more familiar with then jass.

_________________


"Am I the narrow-minded one...or you? I believe in things that have no logical explanation." - Bart, My New Favorite Quoter
Back to top Go down
View user profile
Piddagoras
Map Maker
avatar

Number of posts : 592
Registration date : 2008-05-22
Age : 29
Location : California

Your Character
Level: 1
Primary Move: Cosines and Sines.

PostSubject: Re: Freezing Orb   Mon Feb 09, 2009 6:47 pm

The only problem I have with compiled vJASS is that the function and array names that it writes for the structs are really long, so you have to strain your eyes to find which value or method in the struct it is actually referencing.

_________________

"On the lips, on the mouth, on the floor, reaching out.
On the carpet, on the ceiling, no more words, no more feelings"
Back to top Go down
View user profile
HolyNeko
Mage
Mage


Number of posts : 62
Registration date : 2009-02-05
Age : 27

Your Character
Level: 1
Primary Move: Crotch Kick

PostSubject: Re: Freezing Orb   Tue Feb 10, 2009 1:52 am

Rhys wrote:
in all honesty im fairly certain he just wanted to show neko that it was not as easy as he thinks it is since hes been pretty much saying he is going to be fixing all the bugs in mm&m now the he is a leet coder in jass =p


I actually have an easier time reading it post compiled because it reminds me of other languages which Im more familiar with then jass.
hey i never said anything near the lines of leet =/ and if the original frost nova wasnt based on stats of the hero itd be so much easyer to fix >.< *feels bloodvessel pop in brain* crap X_X
Back to top Go down
View user profile
mikazuki
Guest



PostSubject: Re: Freezing Orb   Tue Feb 10, 2009 7:34 am

Quote :
call GroupEnumUnitsInRange(g , GetUnitX(m) , GetUnitY(m) , 325 , Filter(function EnemyFilter))

Could you post the function "EnemyFilter"?

If my assumptions are correct, I think that function is the problem (I'm guessing the function detects enemy of owner of triggering unit, but doesn't the "triggering unit" not carry on to the FreezingOrbContact function?).

I don't want to sound smart or knowledgeble about JASS or anything, I just want to know what's wrong with the trigger for expanding my own knowledge (if that makes any sense) ^^
Back to top Go down
Jay.J
Head Admin
Head Admin
avatar

Number of posts : 3470
Registration date : 2008-05-21
Age : 26
Location : Toronto

Your Character
Level: ∞
Primary Move: Moderate

PostSubject: Re: Freezing Orb   Tue Feb 10, 2009 12:27 pm

Quote :
I don't want to sound smart or knowledgeble about JASS or anything, I just want to know what's wrong with the trigger for expanding my own knowledge (if that makes any sense) ^^

Lol @ the fine print Smile

_________________

Back to top Go down
View user profile http://lolcatz.jayj
Piddagoras
Map Maker
avatar

Number of posts : 592
Registration date : 2008-05-22
Age : 29
Location : California

Your Character
Level: 1
Primary Move: Cosines and Sines.

PostSubject: Re: Freezing Orb   Tue Feb 10, 2009 1:39 pm

Code:
function EnemyFilter takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit() , GetOwningPlayer(globalUnit)) and GetUnitState(GetFilterUnit() , UNIT_STATE_LIFE) > 0
endfunction

The GetTriggerUnit that is referenced in the contact function is the unit triggering the UnitEntersRange event that the castersystem uses. The only part that is malfunctioning is the part where GetTriggerUnit() returns null, which means that there was no unit entering the range of the missile to trigger the effects, which means the missile had run its course which means the frost nova effects trigger.

I'm just happy that the community is actually interested in JASS. In fact I'm not even sure that this version of freezing orb is malfunctioning. It could have arisen later (Even though neither Rhys nor myself did anything to the freezing orb function after the version that i grabbed this code from)

_________________

"On the lips, on the mouth, on the floor, reaching out.
On the carpet, on the ceiling, no more words, no more feelings"
Back to top Go down
View user profile
Belial
Master Mage
Master Mage
avatar

Number of posts : 266
Registration date : 2008-07-23
Age : 26
Location : No ty, i don't want people to try to rape me in my own house.

Your Character
Level: 1
Primary Move: Posession

PostSubject: Re: Freezing Orb   Tue Feb 10, 2009 4:20 pm

Freezing orb worked in version 6.xx. So why not just copy the code from there?
Back to top Go down
View user profile
Piddagoras
Map Maker
avatar

Number of posts : 592
Registration date : 2008-05-22
Age : 29
Location : California

Your Character
Level: 1
Primary Move: Cosines and Sines.

PostSubject: Re: Freezing Orb   Tue Feb 10, 2009 4:23 pm

Because if no one changed the code for freezing orb then the error must be elsewhere. The code has not been changed as far as I know.

_________________

"On the lips, on the mouth, on the floor, reaching out.
On the carpet, on the ceiling, no more words, no more feelings"
Back to top Go down
View user profile
Rhys
Map Maker
avatar

Number of posts : 719
Registration date : 2008-05-23
Age : 35
Location : Massachusetts

Your Character
Level: 1
Primary Move: Atomic Tea-Bag

PostSubject: Re: Freezing Orb   Tue Feb 10, 2009 5:17 pm

Freezing orb has not been touched by my hands ever. Ive looked it over a billion times since this issue has been risen to my attention and I have no clue what it is because everything seems to be correctly coded. It is not the EnemyFilter function because so many of the other spells in mm&m rely on that function and work fine which cuts that possibility out completely. The problem is with the Damage which means there is a lead to where the issue resides, my guesses so far are with the MissileStruct functions however no other orbs are screwing up so far which leads me to believe its not this. Next possibility is the Grouping function, since its grouping units together and looping through that group damaging units as it discards them from the group there may be an issue here, however like I said the grouping loop seems fine, no issues that are sticking out saying there's a problem here.



Quote :
set temp = FirstOfGroup(g)
Here we use the declared unit TEMP and create a group, we assign TEMP to be = to the First unit in the Group at all times.
Quote :
exitwhen temp == null
we tell the loop to stop looping once TEMP is is NULL which means no units are in the group anymore.
Quote :
call GroupRemoveUnit(g , temp)
Now everytime the loop progresses it removes the first unit in the group, this will continue to loop as long as a unit is in the group.
Quote :

call UnitDamageTarget(s__MissileStruct_caster[ms] , temp , ( ( level * GetHeroAgi(s__MissileStruct_caster[ms] , true) ) + AddUnitItemReal(s__MissileStruct_caster[ms] , 'I01O' , 95.0) ) * 2 , true , false , ATTACK_TYPE_NORMAL , DAMAGE_TYPE_COLD , WEAPON_TYPE_WHOKNOWS)
call UnitSlowTarget(s__MissileStruct_caster[ms] , temp , I2R(1 + 2 * level))
endloop
Now when we progress through the loop we will assign a damage and slow to TEMP which is the first unit in the group.
My guess if I had to make one is the progression in which we use the lines of code.

1.)Setup group
2.)Remove From Group
3.)Damage removed unit from the group
4.)Reloop

Now switching number 3 and 2 could force this to work again because by removing units from the group we are essentially setting TEMP to NULL every loop through right before the Damage and Slow take Effect.


I haven't tested this because i have no time right now, but if I'm wrong let me know Pyth.

_________________


"Am I the narrow-minded one...or you? I believe in things that have no logical explanation." - Bart, My New Favorite Quoter
Back to top Go down
View user profile
Piddagoras
Map Maker
avatar

Number of posts : 592
Registration date : 2008-05-22
Age : 29
Location : California

Your Character
Level: 1
Primary Move: Cosines and Sines.

PostSubject: Re: Freezing Orb   Tue Feb 10, 2009 5:36 pm

Unfortunately I think Rhys is incorrect, but it would be worth it to change it simply because of convention, and sometimes you never know.

TEMP is set to the current first unit in the group, not to a pointer to the first unit slot of the group.

_________________

"On the lips, on the mouth, on the floor, reaching out.
On the carpet, on the ceiling, no more words, no more feelings"
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Freezing Orb   

Back to top Go down
 
Freezing Orb
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Old Mages Magic & Mayhem Gamers Forum :: Archives :: Archives-
Jump to: