Jump to content
  • Advertisement
Sign in to follow this  
e3d_ALiVE

AngelScript variable decomposition

This topic is 2806 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

hello, i'v got a question :D
for example we have code

int a=5;
int b=a*7;
int c=(a*7)*a-b;
int d=b+c;

and i want to execute this string

int test=c+b;


is there any way to get from angel script information about all variables, that is associated with script string[a,b,c] without accessing private data of angelscript?

Share this post


Link to post
Share on other sites
Advertisement
Not quite sure what you're looking for, but yes, it is possible to enumerate variables and their values through the interfaces. For global variables in script modules you'll use the asIScriptModule interface, specifically the GetGlobalVarCount, GetGlobalVar, and GetAddressOfGlobalVar methods. For local variables in script functions you'll use the asIScriptContext interface, specifically the GetVarCount, GetVarName, and GetAddressOfVar methods. Of course, for local variables you'll need to execute the script and access the variables when you're in the function (either by suspending the context, or accessing them from the line callback, or even from an application registered function called from the script function).

Share this post


Link to post
Share on other sites

Not quite sure what you're looking for, but yes, it is possible to enumerate variables and their values through the interfaces. For global variables in script modules you'll use the asIScriptModule interface, specifically the GetGlobalVarCount, GetGlobalVar, and GetAddressOfGlobalVar methods. For local variables in script functions you'll use the asIScriptContext interface, specifically the GetVarCount, GetVarName, and GetAddressOfVar methods. Of course, for local variables you'll need to execute the script and access the variables when you're in the function (either by suspending the context, or accessing them from the line callback, or even from an application registered function called from the script function).


i'm looking for enumerating variables, that are used in during script execution.
it's like, when you execute script on as vm u get the values from internal tables of the variables the script gonna use.
i need some hook for that variables or any other method to get them.
i'm doing this because i have 760 values from DB, that has about 1500000 pages of data, and loading every variable into angelscript is very costly, because of that i need to only load the variables that are gonna be USED during script execution.

p.s. i guess i keep trying...

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!