Download

Can CallFunctionByNameWithArguments be used with default arguments?

Hello.

I’m creating a chat system where you can input commands, and it works very well except that I have to input all arguments before CallFunctionByNameWithArguments works.
Isn’t there any way to make default arguments work with CallFunctionByNameWithArguments?

For example, I have a function called AddItem which takes three arguments, two of which are defaulted to 0.
I would like it very much if I just had to type “/additem itemid”, instead of “/additem itemid 0 0”. :>

Make Args be a struct.

I’m not sure how you would do that, unless you’d make the struct have an array of void pointers.
Could you elaborate a bit more? :slight_smile: