Jump to content
  • Advertisement
Sign in to follow this  

any addon usage with = operator

This topic is 2343 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


is it possible to modify any addon to work with = operator?

float f = 24.0f;
any Var = f;
float v2 = Var;
int a = 5;
any Var2 = Var;
Var = a; // show error, not compile error. runtime message

it works just like auto in c++.
.store and .receive are confusing to use.

i like modify it but i am limited by my knowledge of angelscript.
is this doable?

Thanks. Edited by saejox

Share this post

Link to post
Share on other sites
You can register the various overrides for the opAssign methods to allow the assignment of values to the any type.

To allow the any type to be assigned to a primitive type you'll have to register the asBEHAVE_IMPLICIT_VALUE behaviour.

The opAssign can raise a script exception when it detects an invalid assignment. This would be done by getting the active context with asGetActiveContext(), then calling SetScriptException() on it.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!