• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Extendor

Level 21
Joined
Mar 27, 2012
Messages
3,232
This feature would have to be evaluated before textmacros to allow true dynamic textmacros.
Source
JASS:
library Main
    globals
        //# runextendor SomenameGlobals
    endglobals

    //# runextendor SomenameMethods
endlibrary

library Lib1 requires Main
    //# extendor SomenameGlobals
        //unit NewUnitA
    //# endextendor
    //# extendor SomenameMethod
        //function CreateUnitA takes nothing returns unit
            //set NewUnitA = stuff
        //endfunction
    //# endextendor
endlibrary

library Lib2 requires Main
    //# extendor SomenameGlobals
        //unit NewUnitB
    //# endextendor
endlibrary

library Lib3 requires Main
    //# extendor SomenameGlobals
        //unit NewUnitC
    //# endextendor
endlibrary

Result after extendors and libraries have been evaluated.
JASS:
globals
    unit NewUnitA
    unit NewUnitB
    unit NewUnitC
endglobals

function CreateUnitA takes nothing returns unit
    set NewUnitA = stuff
endfunction

Extendors can also be declared with an optional priority parameter
JASS:
//# extendor SomeName 9
Extendors with a lower priority number are copied first into the script. For example, with priorities (4,1,-5,0) the order of extendors would be:
-5
0
1
4

If priority is not defined, it is assumed to be 0.

Installation instructions

Extract all files from inside the archive into your jass newgen pack folder. Note that wehack.lua will be replaced, so you might want to back it up before installing.
Open the importextendor.lua file and change newgenpath to what it is on your machine.

Attachments

  • Extendor.7z
    5.6 KB · Views: 10
Last edited:
Top