Setting and Getting a Global Var

Started by
10 comments, last by WitchLord 18 years, 3 months ago
Original post by WitchLord

The 'age' property is available directly to the application, since it registered it in the first place. Do you really need to retrieve it from the engine?


Actually, yeah. What I would like to do is reegister a couple of variables with the script, load the script, let it change which ones it wants, and read them back again.

CD
Jesus is Lord!!
Advertisement
Well, that is exactly what RegisterGlobalProperty() does. The script will change the real variable in the application so there is no need to read the value from the engine.

The GetGlobalVarIDByName() and GetGlobalVarPointer() would be used by the application to access global variables declared by the scripts, for example for debugging purposes, or for saving the state of a script.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement