Need some help with this Jass trigger

DragonComple

New Member
Reaction score
1
JASS:
function GroupCheckCondition takes nothing returns nothing
call PauseUnit(GetEnumUnit(), true)
call SetUnitTimeScalePercent( GetEnumUnit(), 0.00 )
endfunction
 
function GroupActions takes nothing returns nothing
set udg_spherePoint = GetUnitLoc(GetEnumUnit())
set udg_sphereGroup[1] = GetUnitsInRangeOfLocMatching(400.00, udg_spherePoint, Condition(IsUnitType(GetFilterUnit(), UNIT_TYPE_MELEE_ATTACKER) != true() and GetFilterUnit() != udg_sphereCaster()))
call ForGroup(udg_sphereGroup[1], function GroupCheckCondition)
endfunction
 
function sphereLoopActions takes nothing returns nothing
call ForGroup(udg_sphereGroup[0], function GroupActions)
call RemoveLocation(udg_spherePoint)
endfunction
 
//===========================================================================
function InitTrig_sphereLoop takes nothing returns nothing
set gg_trg_sphereLoop = CreateTrigger( )
call DisableTrigger( gg_trg_sphereLoop )
call TriggerRegisterTimerEvent(gg_trg_sphereLoop, 0.01, true)
call TriggerAddAction( gg_trg_sphereLoop, function sphereLoopActions )
endfunction


I get a " Expected' " at
JASS:
 set udg_sphereGroup[1] = GetUnitsInRangeOfLocMatching(400.00, udg_spherePoint, Condition(IsUnitType(GetFilterUnit(), UNIT_TYPE_MELEE_ATTACKER) != true() and GetFilterUnit() != udg_sphereCaster()))


Anyone got an idea?
 

BloodySkullz

Active Member
Reaction score
10
I thought that the boolexp is supposed to be a function?

Try moving "(IsUnitType(GetFilterUnit(),UNIT_TYPE_MELEE_ATTACKER)!=true()andGetFilterUnit()!=udg_sphereCaster()))" to a function.

Add:
JASS:
function SphereGroupFilter takes nothing returns boolean
return not (IsUnitType(GetFilterUnit(),UNIT_TYPE_MELEE_ATTACKER)) and not (GetFilterUnit()==udg_sphereCaster)
endfunction


Amend:
JASS:
set udg_sphereGroup[1]=GroupEnumUnitsInRange(400.00,udg_spherePoint,Condition(function SphereGroupFilter))


EDIT: Try to avoid BJs (code in red) as they are redundant.
 

Imp Midna

Active Member
Reaction score
52
JASS:
 set udg_sphereGroup[1] = GetUnitsInRangeOfLocMatching(400.00, udg_spherePoint, Condition(IsUnitType(GetFilterUnit(), UNIT_TYPE_MELEE_ATTACKER) != true() and GetFilterUnit() != udg_sphereCaster()))

You seemingly got the bad habit to treat variables and constants as functions. You can not call true, neither can you call udg_sphereCaster, unless you got a weird function with that name, but im at least quite sure jass parser wont allow you to define a function named true().
Eitherway, then theres still the problem that Condition() takes a code-variable as an attribute, your expression is mostlikely resolved to a boolean.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top