Advertisement

Passing userdata to global function called from Angelscript code

Started by August 14, 2013 08:42 AM
1 comment, last by Shelim 11 years, 3 months ago

I have a script that does map generation for 2D game. It's called several times, once for each map it has to generate.

I passed a pointer to a map being generated as userdata into script context, but I don't know how to access it in a global function called from script. Am I missing something in docs?

Do not follow where the path may lead — go instead where there is no path and leave a trail.

Danger? Hah! I walk on the wild side! I laugh in the face of danger! Ha! Ha! Ha!

You can get a pointer to the current context via the asGetActiveContext() function.

Advertisement

You can get a pointer to the current context via the asGetActiveContext() function.

Thanks, that's exactly what I needed :-)

Do not follow where the path may lead — go instead where there is no path and leave a trail.

Danger? Hah! I walk on the wild side! I laugh in the face of danger! Ha! Ha! Ha!

This topic is closed to new replies.

Advertisement