AngelScript 1.7.0 beta 4 released
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Up until this point, my command console could only execute global functions by their name w/o any arguments (well, a lie, I put some makeshift code in there to allow me to pass integers and floats).
Anyways, nice work
Joe
My engine is single-threaded and the only time I seem to have a problem with ExecuteString is when the statements being executed take a long time to finish. Or, even worse, it enters a never ending loop.
It would be nice if ExecuteString took a parameter that started the context suspended so that the call to ExecuteString returned immediately. I could then use GetContextForExecuteString and timeshare it with the engine and all the other script contexts with ExecuteStep as I normally do.
Will get back with comments. i would like to know if the full 1.7.0 can contain customizable strings for compiler output. would help a lot.
Jayanth.K
[edited by - EddHead on April 27, 2004 1:13:31 AM]
Good idea, I''ll add that flag to the call.
EddHead:
I''m not sure what you mean with ''environment variable'' style global variables. Could you explain?
Currently the only way of having your own customized error messages are to open the source code and change the texts found in the as_texts.h file. If you have an idea for how to do this dynamically at run-time I''m ready to listen.
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
1) ExecuteString() has a new parameter, a flag that can be either 0 or asEXECSTRING_ONLY_PREPARE. With asEXECSTRING_ONLY_PREPARE ExecuteString() compiles the string and prepares the context but doesn''t execute it. To execute the string the application must use GetContextForExecuteString() and then call Execute() or ExecuteStep() on the context received. (thanks goes to Andrew "Desdemona" Wright for that idea)
2) ExecuteString() can now access global variables declared in the script.
3) I''ve transformed global script constants into read-only global script variables. This simplified the code a lot, however it may bring some compilation errors to your scripts in case you use global constants to initialize other global constants or variables. This also means that the compiler is no longer able to optimize operations with these global constants.
I will redo the broken funcionality before the final release, but I think you would be interested in this interim release anyway because of the added funcionality.
Regards,
Andreas Jönsson
Author of AngelScript
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
why not a global pointers for this release. I like to store my globals objects to share with the rest of my functions. For example:
[on globals]
cGUI* gMainMenu;
cGUI* gError;
void OnCallbackMenu( int iMsg )
{
if( iMsg == -1 ) // On error.
{
gMainMenu->Freeze( true );
gError->Show( true );
}
}
void OnCallbackError( int iMsg )
{
if( iMsg==0 ) // Close error.
{
gMainMenu->Freeze( false );
gError->Show( flase );
}
}
Thanks,
Gunder Wulde.
Thanks, for spotting that.
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
or something like that
Jayanth.K
Raptor Entertainment Pvt. Ltd.
http://www.raptorentertainment.com
Global variables can also be initialized with expressions using the condition operator ?:, the only thing that cannot be done is using the incremental operators, assignments, nor function calls.
I''ve fixed a bug that prevented scripts from declaring global variables as pointers. Thanks Gunder Wulde for spotting that.
A slight design flaw has been discovered Andrew "Desdemona" Wright, and that is related to function overloading. The problem is that a literal integer constant do not decide to use a function taking an int as parameter if there is also another function taking a float, in this case it gives an error reporting the two functions as multiple matches. Currently the solution is to manually cast to int, but I''ll change AngelScript to give preference to a cast between int and uint over a cast between integer and floating point.
There is yet another flaw where a pointer cannot be assigned a 0, if the pointer type is using behaviour functions. The problem is that the 0 isn''t a reference. AngelScript will resolve this by placing the 0 in a temporary variable for the assignment.
The next version fixing these two problems should be out any day now.
Regards,
Andreas Jönsson
Author of AngelScript
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game