HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[vJASS] TriggerAddAction(.t, method aaa)

11-10-2008, 02:44 AM#1
Zandose
For the function "TriggerAddAction" how do I use a method instead of a function?


Collapse JASS:
struct Data

    method aaa takes nothing returns nothing
    endmethod
    
    method Create takes integer playerNum returns nothing
        //Event..
        call TriggerAddAction(.t, method aaa)
    endmethod
    
endstruct
11-10-2008, 03:08 AM#2
Zerzax
Any code arguments (in this case the function that will become your triggeraction) have to be static, and use this syntax:

Collapse JASS:
struct Data

    static method aaa takes nothing returns nothing
    endmethod
    
    method Create takes integer playerNum returns nothing
        //Event..
        call TriggerAddAction(.t, function Data.aaa)
    endmethod
    
endstruct

EDIT: You there Zandose? I want to make sure you read this lol, I'm sure the syntax will help you.