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

[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