• 🏆 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] "Expected a name"

Status
Not open for further replies.
Level 1
Joined
Jul 9, 2012
Messages
2
Hi, not new to the world editor but this is the first time I've tried my hand at custom scripts / JASS, not entirely sure what to call it.

I'm following this guide on spellbooks.
http://www.thehelper.net/threads/how-to-make-spellbooks.27637/

The problem is that once I level up some of my spellbook Abilities, that some of the abilities disappear. I would normally just look for a different ability to use but the Channel ability is disappearing!

The guide covers this issue, and tells me to use the following custom script:
JASS:
call UnitMakeAbilityPermanent(whichUnit, true, abilCode)
Replace whichUnit with the unit who has the ability and abilCode with the raw code of the ability.

Tried googling for this error / spellbook tutorials and nothing goes into any further detail. Not sure what exactly to put in the "whichUnit" variable (not 100% on programming terms, sorry).

This is what I guessed I should do:

  • Untitled Trigger 002
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Strength
    • Actions
      • Set permunit = TestHero 0002 <gen>
      • Custom script: call UnitMakeAbilityPermanent( udg_permunit, true, A003)
This throws 1 compile error: "Line 29: Expected a name"

From what I can tell the unit's name is H000:Hpal (TestHero), when I select it on the map it is named TestHero 0002.

JASS:
globals
    // User-defined
    unit                    udg_permunit               = null

    // Generated
    trigger                 gg_trg_Untitled_Trigger_002 = null
    unit                    gg_unit_H000_0002          = null
endglobals

If someone can help me with this I would very much appreciate it!
I hope I have provided enough information.
 
Status
Not open for further replies.
Top