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

Unit Textmacro

Status
Not open for further replies.
Level 17
Joined
Jul 17, 2011
Messages
1,864
[vJass] Unit Textmacro

Can anyone give me an example of what a UNIT textmacro which crates new units via rawcode and something else should look like i cant get it right i need it to create new units and copy n paste is way too slow for example:
JASS:
 //! textmacro CreateUnit takes RAWCODE
//! external ObjectMerger w3u hpea // this is the rawcode for a peasant 
//! endtextmacro

//! runtextmacro CreateUnit("hpea")

what am i doing wrong :D
 
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
seet http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/lua-object-generation-191740/ for tutorials object generation...
you lack customID for your 'hpea'...

textmacros are just like modules implemented, the difference is that you can change the value of textmacros when you run it...
JASS:
//! textmacro TEST takes BLAH, LOC
function TEST$BLAH$ takes nothig returns nothing
     local $LOC$ test
endfunction
//! endtextmacro

//! runtextmacro TEST("ME", "real")
//! runtextmacro TEST("YOU", "intger")
//! runtextmacro TEST("EVERYBODY", "string")

the outcome is this...
JASS:
function TESTME takes nothig returns nothing
     local real test
endfunction
function TESTYOU takes nothig returns nothing
     local integer test
endfunction
function TESTEVERYBODY takes nothig returns nothing
     local string test
endfunction
 
Status
Not open for further replies.
Top