• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Expected a name

Status
Not open for further replies.
Level 16
Joined
Aug 20, 2009
Messages
1,552
i used this custom script.

  • Custom script: if IsLocPathable(udg_TempPoint5) == true then
and it says expected a name.
now the trigger can't be enabled.

i copied this from another map ,and paste it, i only change the variable name into the one i am using right now.

i got TempPoint5 in my variable list.

i dont think it actually will be a problem.

here is my full trigger.

it is just a test. there are leaks, but no worries, i will spot it.

  • Laser System PathLocDetector
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MissileGroup is empty) Equal to False
        • Then - Actions
          • Unit Group - Pick every unit in MissileGroup and do (Actions)
            • Loop - Actions
              • Set LaserSpeed = 45.00
              • Set LaserDamage = (4.00 x (Real((Level of LaserDamage for MissileTempUnit))))
              • Set MissileTempUnit = (Picked unit)
              • Set LaserOwner = (Player number of (Owner of MissileTempUnit))
              • Set TempPoint4 = (Position of MissileTempUnit)
              • Set TempPoint5 = (TempPoint4 offset by LaserSpeed towards (Facing of MissileTempUnit) degrees)
              • Set LaserFinalLoc = (Point-value of MissileTempUnit)
              • Custom script: if IsLocPathable(udg_TempPoint5) == true then
              • Set x = (X of TempPoint5)
              • Set y = (Y of TempPoint5)
              • Custom script: call SetUnitX(udg_MissileTempUnit, udg_x)
              • Custom script: call SetUnitY(udg_MissileTempUnit, udg_y)
              • Unit - Set the custom value of MissileTempUnit to ((Custom value of MissileTempUnit) + (Integer(LaserSpeed)))
              • Custom script: else
              • Set LaserFinalLoc = (Custom value of MissileTempUnit)
              • Custom script: endif
              • Unit Group - Pick every unit in (Units within 90.00 of (Position of MissileTempUnit)) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is An Ancient) Equal to False
                      • ((Picked unit) is Magic Immune) Equal to False
                      • ((Picked unit) is alive) Equal to True
                      • ((Picked unit) belongs to an enemy of (Owner of MissileTempUnit)) Equal to True
                      • (Unit-type of (Picked unit)) Not equal to Laser Dummy
                      • (Unit-type of (Picked unit)) Not equal to Dummy (fly)
                      • (Unit-type of (Picked unit)) Not equal to Dummy 90 degrees (fly)
                    • Then - Actions
                      • Set TempPoint = (Position of (Picked unit))
                      • Unit - Cause MissileTempUnit to damage (Picked unit), dealing LaserDamage damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect at TempPoint using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation(udg_TempPoint)
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Custom value of MissileTempUnit) Greater than or equal to LaserFinalLoc
                      • (Terrain pathing at TempPoint5 of type Walkability is off) Equal to True
                      • (Terrain pathing at TempPoint5 of type Walkability is off) Equal to True
                      • (Terrain pathing at TempPoint5 of type Flyability is off) Equal to True
                • Then - Actions
                  • Unit - Create 1 Dummy (fly) for (Owner of MissileTempUnit) at TempPoint4 facing Default building facing degrees
                  • Set FinalDistanceRay[LaserOwner] = (Position of (Last created unit))
                  • Animation - Change (Last created unit)'s size to (200.00%, 200.00%, 200.00%) of its original size
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit Group - Remove MissileTempUnit from MissileGroup
                  • Unit - Add a 0.01 second Generic expiration timer to MissileTempUnit
                • Else - Actions
              • Custom script: call RemoveLocation(udg_TempPoint4)
              • Custom script: call RemoveLocation(udg_TempPoint5)
        • Else - Actions
          • Trigger - Turn off (This trigger)
 
Last edited:
Level 20
Joined
Jul 6, 2009
Messages
1,885
According to JassCraft,there's no such function.
You can use
JASS:
native IsTerrainPathable
which would be like
  • Custom script: if IsTerrainPathable(GetLocationX(udg_TempPoint5), GetLocationY(udg_TempPoint5), PATHING_TYPE_WALKABILITY) == false then
This function checks if TempPoint5 is walkable which is kind of weird since it's logical that it should be true for the point to be walkable,but...it isn't.
 
Level 16
Joined
Aug 20, 2009
Messages
1,552
sorry, if linking there is forbidden, but, look at the third post.
http://www.thehelper.net/forums/showthread.php/114692-Need-that-in-MUI-rep?highlight=if+isLocPathable

that function is available i think.

and some certain map used it too, such as the diablo III.

  • Custom script: if IsLocPathable(GetLocationX(udg_VA_LeakPoint[1]),GetLocationY(udg_VA_LeakPoint[1])) == true then
that is from the Diablo III, just a part of the vault demon hunter trigger.

that function is available.

i tried GetLocationX and Y too like the way he use it, but it also said "Expected a name".
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
It's either an outdated function that is removed in some newer patch or it's a custom function from map header.

I have checked in JassCraft,JNGP's function list and tried in normal world editor,i couldn't find that function.

Just do this
  • Custom script: if IsTerrainPathable(GetLocationX(udg_TempPoint5), GetLocationY(udg_TempPoint5), PATHING_TYPE_WALKABILITY) == false then
This function checks if TempPoint5 is walkable which is kind of weird since it's logical that it should be true for the point to be walkable,but...it isn't.
 
Level 12
Joined
Nov 20, 2007
Messages
660
  • ((Picked unit) is An Ancient) Equal to False
    • ((Picked unit) is Magic Immune) Equal to False
    • ((Picked unit) is alive) Equal to True
    • ((Picked unit) belongs to an enemy of (Owner of MissileTempUnit)) Equal to True
    • (Unit-type of (Picked unit)) Not equal to Laser Dummy
    • (Unit-type of (Picked unit)) Not equal to Dummy (fly)
    • (Unit-type of (Picked unit)) Not equal to Dummy 90 degrees (fly)
You can put all of these in 1 and :ogre_hurrhurr:
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Ok,here it is.
You will need to copy this code to map header
JASS:
//===================================================
function ItemHide takes nothing returns nothing
    call SetItemVisible(GetEnumItem(),false)
endfunction

function ItemShow takes nothing returns nothing
    call SetItemVisible(GetEnumItem(),true)
endfunction

function IsLocPathable takes location l returns boolean
    local boolean b
    local real dx
    local real dy
    if IsTerrainPathable(GetLocationX(l),GetLocationY(l),PATHING_TYPE_WALKABILITY) == true then
        set b = false
    else
        call MoveRectToLoc(udg_DummyRect,l)
        call EnumItemsInRect(udg_DummyRect,null,function ItemHide)
        call SetItemVisible(udg_DummyItem,true)
        call SetItemPosition(udg_DummyItem,GetLocationX(l),GetLocationY(l))
        set dx = GetItemX(udg_DummyItem) - GetLocationX(l)
        set dy = GetItemY(udg_DummyItem) - GetLocationY(l)
        if SquareRoot(dx * dx + dy * dy) > 0.00 then
            set b = false
        else
            set b = true
        endif
        call EnumItemsInRect(udg_DummyRect,null,function ItemShow)
        call SetItemVisible(udg_DummyItem,false)
    endif
    return b
endfunction
//===================================================
(You can find map header by going to trigger editor and clicking on your map's name - there will be a place to paste code to)

You will also need this trigger
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_DummyItem = CreateItem('phea',0.00,0.00)
      • Custom script: set udg_DummyRect = Rect(-32.0,-32.0,32.0,32.0)
      • Item - Hide DummyItem
and variables: DummyItem (item),DummyRect (region).

To use it,just use custom script and type IsLocPathable(location name) which returns true or false depending if location is pathable or not.
 
Status
Not open for further replies.
Top