• 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] two triggering questions (how to make custom functions/get unit by its handle id)

Status
Not open for further replies.
Level 7
Joined
Jan 30, 2011
Messages
267
hi everyone,
1. how to create custom functions? (without JNGP)
2. is there an inversion of GetHandleId? (to get a unit for example by its ID)
 
Level 7
Joined
Jan 30, 2011
Messages
267
@maker: when i do what you suggested for 1., then compiler says that the trigger must have an initialisation
 
Level 7
Joined
Jan 30, 2011
Messages
267
i wrote that into the head:
JASS:
function test takes integer i returns nothing
endfunction
compiler said, name is expected (translated, not literally)
 
Level 7
Joined
Jan 30, 2011
Messages
267
im generally coding on gui, the only other jass trigger is the one where i tried to create the custom function in a jass trigger ;)
 
After placing the function in your map's header

160036-albums4747-picture50796.png


You can call it as:
  • Custom script: call test (2)
 
Level 7
Joined
Jan 30, 2011
Messages
267
i did write it into the maps header, as you allready told
but when i want to save or execute the map, the compiler says: expects name (translated), without having a call test (1) somewhere in the map
 
Level 7
Joined
Jan 30, 2011
Messages
267
sorry, my dumbness prevented it from working
i created the function twice, once in the head, once in the jass trigger
just recognized that, now it works as i deleted the second one

thx for your help :)
 
Status
Not open for further replies.
Top