| 05-21-2008, 08:43 AM | #1 |
I'm new to JASS and I'm not here for criticisms but rather for corrections. Please help me; I'm willing to +rep if it is needed (indicate in reply). EDIT: Forgot to put in the real_aoe variables. What's wrong with the code besides the lack of this? Here's the code: JASS:function Trig_SiphonArcaneBoolExpr1 takes nothing returns nothing return IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()),GetOwningPlayer(GetTriggerUnit())) endfunction function Trig_GenericStartsTheEffectOfAnAbility_Actions takes nothing returns nothing if (GetSpellAbilityId() == 'A00W') then local integer integer_duration = 0 local integer integer_unitcount local location location_target = GetSpellTargetLoc() local location location_unittarget local unit unit_target local group group_target loop set group_target GroupEnumUnitsInRangeOfLoc(CreateGroup(),location_target,real_aoe,function Trig_SiphonArcaneBoolExpr1) set integer_unitcount = (CountUnitsInGroup(group_target)) loop set unit_target = GroupPickRandomUnit(group_target) DestroyEffect(AddSpecialEffectTarget(Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl,unit_target,"overhead")) set integer_unitcount = (integer_unitcount - 1) exitwhen (integer_unitcount = 0) endloop set integer_duration = (integer_duration + 1) exitwhen (integer_duration = 10) call TriggerSleepAction(1.00) endloop call DestroyGroup(group_target) call RemoveLocation(location_target) set location_target = null set group_target = null endif endfunction function InitTrig_GenericStartsTheEffectOfAnAbility takes nothing returns nothing set gg_trg_GenericStartsTheEffectOfAnAbility = CreateTrigger() call TriggerRegisterAnyUnitEventBJ(gg_trg_GenericStartsTheEffectOfAnAbility, EVENT_PLAYER_UNIT_SPELL_EFFECT) call TriggerAddCondition(gg_trg_GenericStartsTheEffectOfAnAbility, Condition(function Trig_GenericStartsTheEffectOfAnAbility_Conditions)) call TriggerAddAction(gg_trg_GenericStartsTheEffectOfAnAbility, function Trig_GenericStartsTheEffectOfAnAbility_Actions) endfunction The error messages: |
| 05-21-2008, 08:55 AM | #2 |
So many errors.. I'll do this section by section JASS:if (GetSpellAbilityId() == 'A00W') then Should be JASS:if (GetSpellAbilityId() == 'A00W') then --------- JASS:set group_target GroupEnumUnitsInRangeOfLoc(CreateGroup(),location_target,real_aoe,function Trig_SiphonArcaneBoolExpr1) Should be JASS:set group_target = CreateGroup() call GroupEnumUnitsInRangeOfLoc(CreateGroup(),location_target,real_aoe,function Trig_SiphonArcaneBoolExpr1) --------- JASS:DestroyEffect(AddSpecialEffectTarget(Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl,unit_target,"overhead")) Should be JASS:call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl",unit_target,"overhead")) I see you are still learning JASS, keep it up and browse some tutorials, it'll pay off once you've mastered it, and then it'll be time to move on to vJass. Sometimes, it is better to keep a problem to yourself and figure out the solution, rather than just asking for help. Noone can teach you something better than yourself, so the best way is to figure things out by yourself. If you can't, then that's when you should ask for help. |
| 05-21-2008, 09:45 AM | #3 |
Thanks for the help. I have not the time nor the initiative to tinker A LOT wit JASS. +rep |
| 05-21-2008, 10:43 AM | #4 |
Um, I thought that initiating locals after anything (other than other local initiation) causes errors... unless I missed out on something. I'm looking squarely at Trig_GenericStartsTheEffectOfAnAbility_Actions |
| 05-21-2008, 01:13 PM | #5 |
JASS:function Trig_GenericStartsTheEffectOfAnAbility_Actions takes nothing returns nothing if (GetSpellAbilityId() == 'A00W') then local integer integer_duration = 0 local integer integer_unitcount local location location_target = GetSpellTargetLoc() local location location_unittarget local unit unit_target local group group_target loop set group_target GroupEnumUnitsInRangeOfLoc(CreateGroup(),location_target,real_aoe,function Trig_SiphonArcaneBoolExpr1) set integer_unitcount = (CountUnitsInGroup(group_target)) loop set unit_target = GroupPickRandomUnit(group_target) DestroyEffect(AddSpecialEffectTarget(Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl,unit_target,"overhead")) set integer_unitcount = (integer_unitcount - 1) exitwhen (integer_unitcount = 0) endloop set integer_duration = (integer_duration + 1) exitwhen (integer_duration = 10) call TriggerSleepAction(1.00) endloop call DestroyGroup(group_target) call RemoveLocation(location_target) set location_target = null set group_target = null endif endfunction Should be JASS:function Trig_GenericStartsTheEffectOfAnAbility_Actions takes nothing returns nothing local integer integer_duration = 0 local integer integer_unitcount local location location_target = GetSpellTargetLoc() local location location_unittarget local unit unit_target local group group_target = CreateGroup() local real real_aoe if (GetSpellAbilityId() == 'A00W') then loop call GroupEnumUnitsInRangeOfLoc(group_target,location_target,real_aoe,function Trig_SiphonArcaneBoolExpr1) set integer_unitcount = (CountUnitsInGroup(group_target)) loop set unit_target = GroupPickRandomUnit(group_target) call DestroyEffect(AddSpecialEffectTarget(Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl,unit_target,"overhead")) set integer_unitcount = (integer_unitcount - 1) exitwhen (integer_unitcount = 0) endloop set integer_duration = (integer_duration + 1) exitwhen (integer_duration = 10) call TriggerSleepAction(1.00) endloop call DestroyGroup(group_target) call RemoveLocation(location_target) set location_target = null set group_target = null endif endfunction |
