• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[Crash] Editor Freezes

Status
Not open for further replies.
Level 5
Joined
Feb 22, 2013
Messages
161
Hello everyone, I am trying to make a spell called Deep Freeze that is cast at ground and has a certain area of affect. Here is the code.

JASS:
scope DeepFreeze initializer DeepFreeze_onInit
//===================================
//============START SETUP============
//===================================
    globals
        private constant integer ABILITY_ID = 'D000' // Raw ability id
        private constant real RADIUS = 384.00 // Area of affect range
        private constant integer STUN_DURATION = 4 // Duration of stun when cast
        private constant string AOE_EFFECT = "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl" // Special effect used
        
        private group _targets
        private boolexpr _bool
    endglobals
    
    // Damage dealt to enemies
    private function DeepFreeze__damage takes integer level returns real
        return level * 50
    endfunction
    
    private function DeepFreeze__targets takes unit target returns boolean
        return (GetWidgetLife(target) > 0.405) and (IsUnitType(target, UNIT_TYPE_STRUCTURE) == false) and (IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) == false)
    endfunction
//===================================
//=============END SETUP=============
//===================================
    private function DeepFreeze_pickTargets takes nothing returns boolean
        return DeepFreeze__targets(GetFilterUnit())
    endfunction

    // Checks the ability being cast
    private function DeepFreeze__conditions takes nothing returns integer
        return GetSpellAbilityId() == ABILITY_ID
    endfunction
    
    // Actions that occur after ability is cast
    private function DeepFreeze_onCall takes nothing returns nothing
        local real spellLocX = GetSpellTargetX()
        local real spellLocY = GetSpellTargetY()
        local unit _caster = GetTriggerUnit()
        local integer level = GetUnitAbilityLevel(_caster, ABILITY_ID)
        local unit f
        
        call GroupEnumUnitsInRange(_targets, spellLocX, SpellLocY, RADIUS, _bool)
        loop
            set f = FirstOfGroup(_targets)
            exitwhen f == null
            call GroupRemoveUnit(_targets, f)
            if IsUnitEnemy(f, GetOwningPlayer(_caster)) then
                call PauseUnit(f, true)
            endif
        endloop
        
        set _caster = null
    endfunction
    
    // Initialization of our spell
    private function DeepFreeze_onInit takes nothing returns nothing
        local trigger deepFreezeTrigger = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(deepFreezeTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(deepFreezeTrigger, Condition(function DeepFreeze__conditions))
        call TriggerAddAction(deepFreezeTrigger, function DeepFreeze_onCall)
        
        set _targets = CreateGroup()
        set _bool = Condition(function DeepFreeze_pickTargets)
        
        call Preload(AOE_EFFECT)
    endfunction
endscope

Now the problem is, is when I try and save or test the map JassHelper detects a syntax error but doesn't do anything else and freezes the editor. JassHelper acts like it's doing something but never does. What's going on?

I've deleted JNGP and re-installed it multiple times and I have the Blizzardmodding site version too, so I'm stumped.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Update jasshelper (0.A.2.B). Do not start your identifiers with an underscore. vJass uses underscores for scoping. You do not need to prepend your private functions by the scope's name. That's why you make scopes, internally you can use short identifiers while it does not pollute the superior namespaces.
 
Level 5
Joined
Feb 22, 2013
Messages
161
Did all that, still nothing, but I found a bypass, even though i'd rather not have to do it every time I get an error in my code.. What I have to do is save the map, get an error, open task manager, end the jasshelper process, go back to the map (When the process ends, the map unfreezes), go to the JassHelper scroll menu, select Show previous errors
 
Level 5
Joined
Feb 22, 2013
Messages
161
It crashes on any error in the code, even a slight misspell.. I wouldn't call it a crash but it does seem like it is.
 
Status
Not open for further replies.
Top