• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] LUA Script Problem

Status
Not open for further replies.
JASS:
//! textmacro NewItem takes id, name, price, damage, armor, HP, MP, HPregen, MPregen, strength, agility, intelligence
    //! externalblock extension=lua ObjectMerger $FILE_NAME$
        
        //! i local index = -1
        //! i local max = -1
        //! i local data = ""
        //! i local bin = {}
        
        //! i function getAcode( i )
            //! i index = index + 1
            //! i bin[index] = i - 'I000' + 'AI00' + index
            //! i if index == 0 then
                //! i data = data .. toString(bin[index])
            //! i else
                //! i data = data .. "," .. toString(bin[index])
            //! i end
            //! i return i - 'I000' + 'AI00' + index
        //! i end
        
        //! i setobjecttype("abilities")
        
        //! i if $damage$ != 0 then
            //! i createobject("AItg",getAcode($id$))
            //! i makechange(current,"Iatt",$damage$)
            //! i makechange(current,"anam","+$damage$ damage")
            //! i makechange(current,"ansf","($name$)")
        //! i end
        
        //! i if $armor$ != 0 then
            //! i createobject("AId1",getAcode($id$))
            //! i makechange(current,"Idef",$armor$)
            //! i makechange(current,"anam","+$armor$ armor")
            //! i makechange(current,"ansf","($name$)")
        //! i end
        
        //! i if $HP$ != 0 then
            //! i createobject("AIl2",getAcode($id$))
            //! i makechange(current,"Ilif",$HP$)
            //! i makechange(current,"anam","+$HP$ HP")
            //! i makechange(current,"ansf","($name$)")
        //! i end
        
        //! i if $MP$ != 0 then
            //! i createobject("AImz",getAcode($id$))
            //! i makechange(current,"Iman",$MP$)
            //! i makechange(current,"anam","+$MP$ MP")
            //! i makechange(current,"ansf","($name$)")
        //! i end
        
        //! i if $HPregen$ != 0 then
            //! i createobject("Arel",getAcode($id$))
            //! i makechange(current,"Ihpr",$HPregen$)
            //! i makechange(current,"anam","+$HPregen$ HP Regen")
            //! i makechange(current,"ansf","($name$)")
        //! i end
        
        //! i if $MPregen$ != 0 then
            //! i createobject("AIrm",getAcode($id$))
            //! i makechange(current,"Imrp",$MPregen$)
            //! i makechange(current,"anam","+" .. 100 * $MPregen$ .. "% MP regen")
            //! i makechange(current,"ansf","($name$)")
        //! i end
        
        //! i if ($strength$ != 0) || ($agility$ != 0) || ($intelligence$ != 0) then
            //! i createobject("AIs1",getAcode($id$))
            //! i makechange(current,"Istr",$strength$)
            //! i makechange(current,"Iagi",$agility$)
            //! i makechange(current,"Iint",$intelligence$)
            //! i makechange(current,"anam","Stats($strength$,$agility$,$intelligence$)")
            //! i makechange(current,"ansf","($name$)")
        //! i end
        
        //! i setobjecttype("items")
        //! i createobject("rde1",$id$)
        //! i makechange(current,"unam","$name$")
        //! i makechange(current,"ilum",0)
        //! i makechange(current,"isst",0)
        //! i makechange(current,"istr",1)
        //! i makechange(current,"isto",1)
        //! i makechange(current,"igol",$price$)
        //! i makechange(current,"ides"," ")
        //! i makechange(current,"utip","$name$")
        //! i makechange(current,"utub"," ")
        //! i makechange(current,"iabi",data)
        
    //! endexternalblock
//! endtextmacro

//! runtextmacro NewItem("I000","DummyItem","0","0","0","0","0","0","0","0","0","0")

Can anyone tell me what I did wrong in this script?
NewGen keeps popping up an error message saying:
$FILE_NAME$ doesn't exist..
I tried the same thing with $FILENAME$, but the same error message was displaying..
 
Status
Not open for further replies.
Top