Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

Passing userdata to global function called from Angelscript code

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Shelim   Members   

146
Like
0Likes
Like

Posted 14 August 2013 - 02:42 AM

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!


#2 SiCrane   Moderators   

11759
Like
2Likes
Like

Posted 14 August 2013 - 08:42 AM

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



#3 Shelim   Members   

146
Like
0Likes
Like

Posted 14 August 2013 - 09:03 AM

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!





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.