Game Development Community

Execute Function from Name

by AndrewOsborne · in Technical Issues · 11/19/2006 (1:52 pm) · 1 replies

Hi Guys,
i read that scripting languages allow for self modofying code, what i want is to have AI with a Dynamic Function Name called ::onReachDestination, which i would set in the Path Node.
I know there is a function in the engine/console that gets variables from names, how can i get a function to execute given only its name, like the command field of ButtonCtrl's etc.

Thankyou in advance.

#1
11/19/2006 (3:39 pm)
I believe theres a function called "call()" which serves this purpose in torque. you could also use eval().