• 🏆 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!

[Solved] Undeclared function IsTerrainWalkable

Status
Not open for further replies.
Level 31
Joined
Jun 27, 2008
Messages
2,556
Hey.

So I imported a spell from a Spell section. It has this code among all of the code:
JASS:
        if IsTerrainWalkable(x1, y1) then //If the terrain is passable the you'll dash, if not then trigger ends.
            call SetUnitX(caster, x1)
            call SetUnitY(caster, y1)
            set cur_dist = cur_dist + Offset //This counts how many times you've moved.
            call SaveReal(udg_Rush_Hash, id, 2, cur_dist)
        else
            call PauseTimer(t)
            call DestroyTimer(t)
            call DestroyGroup(g)
            call SetUnitAnimation(caster, "stand") //Resets the animation.
            call FlushChildHashtable(udg_Rush_Hash, id)
        endif
When saving the map JNGP gives me errors saying Undeclared function IsTerrainWalkable, also another error points to endif saying Cannot convert null to boolean.

I don't have a lot of knowledge on Jass, almost none. I tried to google it up, I found that this function is based on vJass. In the base map from which I copied this, it works, when I copied to another map - not. How to solve this so that map runs properly without errors?

Thanks.
 
Last edited by a moderator:
Level 31
Joined
Jun 27, 2008
Messages
2,556
This is the spell.

Errors happen on my map, original map has no errors, same coding though.

I work with GUI mainly. So I need to copy this library code to my map? Test map is not available there.

EDIT: Oh, I copied the code into the map and now it works perfectly. Library was missing after all. Thanks a lot. :)
 
Level 7
Joined
Oct 19, 2015
Messages
286
I am guessing the spell code was in a scope instead of in a library and so you didn't get an explicit "missing library" error. This is a good reason to always use libraries instead of scopes in vJass.
 
Status
Not open for further replies.

Similar threads

Top