• 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.

Unit Textmacro

Status
Not open for further replies.
Level 17
Joined
Jul 17, 2011
Messages
1,863
[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:
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