Re: shortcut function calls in bgt
@12 I didn't test this, but according to this question https://stackoverflow.com/questions/144 … ring-java, in Java, assuming that arr[i] is a string and the method is in the same class, you can do:getClass().getMethod(arr[i]).invoke(this);
URL:
Re: shortcut function calls in bgt
@8: ah, that's how you do that. That would've been real nice a long time ago. I've been using a newStringArray function I wrote, which maxes out at however many arguments I feel like typing.I was just this very day working on something invo
Re: shortcut function calls in bgt
Wow I never thought of using getattr. And I didn't know that about BGT.
URL: https://forum.audiogames.net/post/451465/#p451465
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.co
Re: shortcut function calls in bgt
For calling a single function in BGT, it's almost the same thing, replace & with @ and typedef with funcdef and the proper syntax.In Python these things are much easier. For calling a function as a string we can use the getattr function:&
Re: shortcut function calls in bgt
Going to derail the topic and say that C/C++ make this much easier. C:void func() {
}
// call function
call_callback(&func);Literally that's all you do. You can store functions in arrays, but you should use a typedef (otherwise your code looks
Re: shortcut function calls in bgt
Going to derail the topic and say that C/C++ make this much easier. C:void func() {
}
// call function
call_callback(&func);Literally that's all you do. You can store functions in arrays, but you should use a typedef (otherwise your code looks ug
Re: shortcut function calls in bgt
@2 It's possible, but not easy./* A simple example to demonstrate calling a function through an array */funcdef int calculate_operation(int num1, int num2); /* Define the signature of the functions that will be in our array */int add(int a,
Re: shortcut function calls in bgt
what is this thing about arrays and function arguements? Never heard of that before. Can someone please explain what it does?
URL: https://forum.audiogames.net/post/451233/#p451233
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin
Re: shortcut function calls in bgt
Liam, you can store functions in python. Just put their names into a list without the parentheses
URL: https://forum.audiogames.net/post/451231/#p451231
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https
Re: shortcut function calls in bgt
Liam, you can store messages in python. Just put their names into a list without the parentheses
URL: https://forum.audiogames.net/post/451231/#p451231
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https
Re: shortcut function calls in bgt
Oh cool. I wasn't aware you could do that. I love being wrong sometimes.
URL: https://forum.audiogames.net/post/451223/#p451223
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.co
Re: shortcut function calls in bgt
@Liam: thats not true, AngelScript (BGT) allows fast-declaration of arrays as an argument, although it doesn't look nice:function_with_string_array_argument(array = {"this", "is", "a", "test"});This however is
Re: shortcut function calls in bgt
As an aside, in other languages like Python, I believe you can make arrays or well lists in python nomenclature of methods... I think. BGT is extremely inflexible when it gets to more advanced things. for example you're not able to pass an array
Re: shortcut function calls in bgt
I believe you can do call backs, but you can't take a string and have it's contents be processed as the name of something. IEstring function_to_call = "start_game";string name = "Liam";if (name == "Liam")functio
14 matches
Mail list logo