Undeclared variable problem

Exide

I am amazingly focused right now!
Reaction score
448
Try lowering the TriggerSleepAction value to 1 sec or something.


Also try changing this part:

JASS:
            if (IsUnitType(fog, UNIT_TYPE_MAGIC_IMMUNE) == false) and (IsUnitAlly(fog, GetOwningPlayer(caster)) == false) then
                if (GetUnitTypeId(fog) == 'h002') then
                    call UnitDamageTarget(fog, caster, 100, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_COLD, WEAPON_TYPE_WHOKNOWS)
                    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl", xx, yy))
                else
                    call UnitDamageTarget(fog, caster, 100, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_COLD, WEAPON_TYPE_WHOKNOWS)
                    call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl", xx, yy))
                endif
            endif


into this:

JASS:
            if (IsUnitType(fog, UNIT_TYPE_MAGIC_IMMUNE) == false) and (IsUnitAlly(fog, GetOwningPlayer(caster)) == false) then
                if (GetUnitTypeId(Dummy<i>) == &#039;h002&#039;) then   //Changed this line
                    call UnitDamageTarget(fog, caster, 100, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_COLD, WEAPON_TYPE_WHOKNOWS)
                    call DestroyEffect(AddSpecialEffect(&quot;Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl&quot;, xx, yy))
                else
                    call UnitDamageTarget(fog, caster, 100, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_COLD, WEAPON_TYPE_WHOKNOWS)
                    call DestroyEffect(AddSpecialEffect(&quot;Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl&quot;, xx, yy))
                endif
            endif
</i>


EDIT: In order for DestroyEffect(AddSpecialEffect()) to work the effect that you're using must have a birth animation, else it won't show up.
 

tooltiperror

Super Moderator
Reaction score
231
It gives greater control over the event, though.
Like if there are max 4 players in the game he could change it to loop only 4 times. -No need to do it 16 times.

Yes, but if you are creating a spell for a site like for thehelper or thehive, you should use the BJ.
 

killingdyl

Active Member
Reaction score
6
ok here, no special effects are showing up(but this one incident it did), no damage are applied to enemys, but i got damaged once in a while!

i fixed everything and i even tried to reduce the wait time.
 

Exide

I am amazingly focused right now!
Reaction score
448
ok here, no special effects are showing up(but this one incident it did), no damage are applied to enemys, but i got damaged once in a while!

i fixed everything and i even tried to reduce the wait time.

I suggest you post the complete trigger you're using.
It makes it easier for me (and others) to troubleshoot, then.


Yes, but if you are creating a spell for a site like for thehelper or thehive, you should use the BJ.

What? lol.
What kind of argument is that? :p
 

tooltiperror

Super Moderator
Reaction score
231
Because you should assume that the map has max players. They can change it if they need it.
 

killingdyl

Active Member
Reaction score
6
this is the trigger for my spell
JASS:
function Trig_Elemental_Vortex_Conditions takes nothing returns boolean
    return (GetSpellAbilityId() == &#039;A000&#039;)
endfunction

function Trig_Elemental_Vortex_Actions takes nothing returns nothing
    local unit array Dummy
    local unit caster = GetTriggerUnit()
    local player p = GetOwningPlayer(caster)
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local real xx
    local real yy
    local real Real = 0
    local integer i = 0
    local unit fog = null
    local group g = CreateGroup()

    loop
        exitwhen i &gt; 7
        set Dummy<i> = CreateUnit(p, &#039;h003&#039;, x, y, 270)
        set xx = x + 700 * Cos(Real * bj_DEGTORAD)
        set yy = y + 700 * Sin(Real * bj_DEGTORAD)
        call UnitApplyTimedLife(Dummy<i>, &#039;BTLF&#039;, 3.5)
        call IssuePointOrder(Dummy<i>, &quot;move&quot;, xx, yy)
        set Real = (Real + (360/8))
        set i = i + 1
    endloop
    
    set Real = (360/16)

    loop
        exitwhen i &gt; 15
        set Dummy<i> = CreateUnit(p, &#039;h002&#039;, x, y, 270)
        set xx = x + 500 * Cos(Real * bj_DEGTORAD)
        set yy = y + 500 * Sin(Real * bj_DEGTORAD)        
        call UnitApplyTimedLife(Dummy<i>, &#039;BTLF&#039;, 3.5)
        call IssuePointOrder(Dummy<i>, &quot;move&quot;, xx, yy)
        set Real = (Real + (360/8))
        set i = i + 1
    endloop
    
    call TriggerSleepAction(3.45)   //This will probably cause trouble..

    loop
        exitwhen i &lt; 0
        set xx = GetUnitX(Dummy<i>)
        set yy = GetUnitY(Dummy<i>)
        call GroupEnumUnitsInRange(g, xx, yy, 50, null)

        loop
            set fog = FirstOfGroup(g)
            exitwhen fog == null

            if (IsUnitType(fog, UNIT_TYPE_MAGIC_IMMUNE) == false) and (IsUnitAlly(fog, GetOwningPlayer(caster)) == false) then
                if (GetUnitTypeId(Dummy<i>) == &#039;h002&#039;) then
                    call UnitDamageTarget(fog, caster, 100, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_COLD, WEAPON_TYPE_WHOKNOWS)
                    call DestroyEffect(AddSpecialEffect(&quot;Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl&quot;, xx, yy))
                else
                    call UnitDamageTarget(fog, caster, 100, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_COLD, WEAPON_TYPE_WHOKNOWS)
                    call DestroyEffect(AddSpecialEffect(&quot;Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl&quot;, xx, yy))
                endif
            endif

            call GroupRemoveUnit(g, fog)
        endloop
        
        set Dummy[(i)] = null
        set i = i - 1
    endloop
    
    call DestroyGroup(g)
    set caster = null
    set g = null
    set p = null           //I couldn&#039;t remember which had to be nulled and not, so I nulled them all. =)
endfunction

//===========================================================================
function InitTrig_Elemental_Vortex takes nothing returns nothing
    local trigger Elemental_Vortex = CreateTrigger()
    local integer i = 0
    
    loop
        exitwhen i == 16
        call TriggerRegisterPlayerUnitEvent(Elemental_Vortex, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
        set i = i + 1
    endloop
    
    call TriggerAddCondition( Elemental_Vortex, Condition( function Trig_Elemental_Vortex_Conditions ) )
    call TriggerAddAction( Elemental_Vortex, function Trig_Elemental_Vortex_Actions )
endfunction</i></i></i></i></i></i></i></i></i>
 

Exide

I am amazingly focused right now!
Reaction score
448
You should add a couple of Debug Messages.
For example, after this line:

JASS:

        call GroupEnumUnitsInRange(g, xx, yy, 50, null)


-Add a message that displays the amount of units in that group (g).
If that message always shows up as 0 then you know that that line is the problem.
If not you have to keep troubleshooting.
 

Exide

I am amazingly focused right now!
Reaction score
448
I did that, and it keeps showing "1" which im guessing means the hero i am controlling

I'd guess it's the dummy unit.
Not sure if you intended this or not, but I'm going to explain it anyway:

This spell spawns a couple of dummy units, which all moves (somewhere) around the caster.
When they are done moving they will each create a group in 50 radius (tiny) around themselves. -Any enemies of the caster in this group will be damaged and "special effected".

I suggest you increase the radius a bit and see if anything happens:
JASS:

call GroupEnumUnitsInRange(g, xx, yy, 50, null)   //Increase &#039;50&#039;



[LJASS]if ( not ( GetUnitTypeId(Dummy[(bj_forLoopAIndex)]) == 'h002' ) ) then[/LJASS]

Wont work.

What?
Where is he using that condition and what makes you think it won't work?
 

killingdyl

Active Member
Reaction score
6
ok i increased it to 500 to see what would happen and... I KILLED MY OWN HERO WTF! there were also enemy units around and they didnt get damaged!
 

Exide

I am amazingly focused right now!
Reaction score
448
ok i increased it to 500 to see what would happen and... I KILLED MY OWN HERO WTF! there were also enemy units around and they didnt get damaged!

JASS:
and (IsUnitAlly(fog, GetOwningPlayer(caster)) == false) then

should prevent that..

Try changing into:
JASS:
and (IsUnitAlly(fog, GetOwningPlayer(caster)) == true) then

just to see what happens.


How many units were there in the group?
 

killingdyl

Active Member
Reaction score
6
lmao figured it out, the firstofgroup was working fine it was the damage part, somehow we mixed up the "damager" and the "unit getting damaged" Thanks for all ur help!
 

Exide

I am amazingly focused right now!
Reaction score
448
lmao figured it out, the firstofgroup was working fine it was the damage part, somehow we mixed up the "damager" and the "unit getting damaged" Thanks for all ur help!

Oh.
My bad. :p
Well glad it works for ya.
I hope you learnt something.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top