Skip to main content
GameDev.net gamedev.net
🔒 Locked

Passing userdata to global function called from Angelscript code

Started by Shelim Aug 14, 2013 at 8:42 AM 1 replies 1.5k views
Original Post
Shelim
Shelim

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!
SiCrane
SiCrane

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

Shelim
Shelim

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!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.