• 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.

NewGen WE Problem - Total save lag

Status
Not open for further replies.
Level 11
Joined
Sep 20, 2012
Messages
117
So, i started to coding some JASS, but the regular WE crashes map when i try to save it, so i think i need that NGJP. I downloaded it, and opened, and it was all good, but when im trying to save, it just laggs, and does nothing. I waited for 10 minutes, and still nothing. Just laggs, not crashes, i can see the WE running, but it gives like no response. Can anyone help me?
Thanks.
 
Level 11
Joined
Sep 20, 2012
Messages
117
It seems like standard WC3:RoC map file crashes when there is JASS in it, but the TFT mape doesnt, so its good, but still, the code makes ton of errors, and i cant fix it.

Code:
function ability_conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function ability_actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local integer level = GetUnitAbilityLevel(caster, 'A000')
local location target_loc = GetUnitLoc(target)
local location caster_loc = GetUnitLoc(caster)
local integer target_id = GetUnitTypeId(target)
    if level == 1 then
     call SetUnitPosition(caster, target_loc)
     call UnitDamageTarget(caster, target, 75, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
     call SetUnitPosition(caster, caster_loc) 
        
    elseif level == 2 then
     call SetUnitPosition(target, caster_loc)
     call UnitDamageTarget(caster, target, 155, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
     call DestroyEffect(AddSpecialEffectLoc("Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl", caster_loc))
               
    elseif level == 3 then
     set dummy = CreateUnit(GetOwningPlayer(caster), target_id, target_loc)
     call UnitAddAbility(dummy, 'A001')
     call IssueTargetOrderById(dummy, 'A001', target)
     call RemoveUnit(dummy)    
   endif
call RemoveLocation(target_loc)
call RemoveLocation(caster_loc)   
set caster = null
set target = null
set target_loc =  null
set caster_loc = null
set target_id = 0
set dummy = null
endfunction

function InitTrig_ability takes nothing returns nothing
local trigger gg_trig_ability = CreateTrigger() 
  call TriggerRegisterAnyUnitEventBJ(gg_trig_ability, EVENT_PLAYER_UNIT_SPELL_EFFECT)
  call TriggerAddCondition(gg_trig_ability, Condition(function ability_conditions))
  call TriggerAddAction(gg_trig_ability, function ability_actions)
endfunction
 
I don't have WE on this comp so I can't check the syntax, but it may be this:
JASS:
"Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl"

Whenever you use a string in JASS, you must use double backslashes to specify directories. This is because a single backslash specifies an escape sequence.

So it should be:
JASS:
"Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl"
 
Level 11
Joined
Sep 20, 2012
Messages
117
I didnt fix that code, but i made other one, and when i want to save, i get only one error, sayins "invaild number of arguments" for that line
JASS:
call UnitDamageTarget(caster, temp, 150.00, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
And it happens often when i do UntiDamageTarget, how to fix it?
 
Level 6
Joined
Sep 20, 2012
Messages
179
The good way to know you are doing something wrong in your JASS code is to try to make for the lines you have doubts about the similar lines, but in Trigger Editor native functions, and then convert to custom text. Comparing it to your line helps, at least me, in 95% cases.
 
Status
Not open for further replies.
Top