As the documentation says, you can defined a function in a struct like but is it possible, to overload this function later? So that you tell the function to do different things later in the code? This means, the script could always execute the same function, but the result would be different depending on the code content.…
Do you mean function overloading where the script calls the function based on arguments? From what Im reading sounds like you want something like polymorphism.
I would like to define the function like above but also be able to do this later: And at this moment the foo.baz() function shall not calculate sqrt(n+1) anymore but just write "hello new world".
haiddasalami, I think thats right. You can change amy member of struct as long as you've instanced it. This works aswell: struct structBlah( foo, bar, x, y)blah = structBlah()blah.foo = fn foo =( print "foo") You can assign any object to a struct member, Maxscript doesn't care if it is a variable, function or a struct.