- Direct execution of script strings without compilation (ExecuteString()), useful for consoles
- Better control over how much is executed in ExecuteStep(), e.g. step into, step over, and step out of
- Modular compilation and recompilation of individual modules
- Saving and loading compiled byte code
- Support for classes with inheritance in script
- Function overloading of script functions
- Support for arrays
- Switch statement
- Namespaces
- Saving/loading context states complete with stack content
- Better support for coroutines
Suggestions for future AngelScript features
#1 Moderators - Reputation: 2312
Posted 21 March 2004 - 06:58 AM
#2 Members - Reputation: 122
Posted 21 March 2004 - 11:46 AM
- Script sections (namespaces) to allow script functions with the same name to be used with different entities - e.g. "Section 1" could contain a function called "Init", which is different to "Section 2"'s "Init" function. Also, it would be helpful to allow support for a global section (namespace).
- Piecewise code recompilation, which allows the recompilation of either an individual function within a namespace, or recompilation of the entire namespace. This will allow for the creation of dynamically scriptable persistent environments.
- The ability to parse and evaluate a script before actual compilation (or being able to perform a dummy compile that compiles the script to a temporary disposable buffer?).
- Saving and loading of compiled byte code.
Regards,
Daniel.
p.s. Keep up the great work!!!
[edited by - Wumpee on March 21, 2004 6:49:07 PM]
#3 Members - Reputation: 158
Posted 21 March 2004 - 06:07 PM
I also !believe that the NOT operator isnt supported...
The only problem that I''ve had to do some serious dancing around is how to deal with my ''Console.Write(string, ...)'' method which uses printf-style formatting. If Angelscript could handle variable argument functions/methods, that would be too cool.
Besides that, the library is pretty slick. Good job!
D
#4 Moderators - Reputation: 2312
Posted 22 March 2004 - 02:53 AM
- script classes with inheritance
- generic arrays, i.e. declaration of arrays in the script like: float[] f;
Wumpee:
quote:
- The ability to parse and evaluate a script before actual compilation (or being able to perform a dummy compile that compiles the script to a temporary disposable buffer?).
You still have to register functions and objects. Though you can register functions with the pointer set to 0 so you don''t have to link with it. Once registered you simple compile the script as usual.
Desdemona:
quote:
I also !believe that the NOT operator isnt supported...
Have you tried the ''not'' operator?
quote:
The only problem that I''ve had to do some serious dancing around is how to deal with my ''Console.Write(string, ...)'' method which uses printf-style formatting. If Angelscript could handle variable argument functions/methods, that would be too cool.
The ellipse token ... isn''t supported by AngelScript. But you should be able to register the printf function using various script declaratations. Example:
engine->RegisterGlobalFunction("void printf(bstr, int)", asFUNCTION(printf), asCALL_CDECL);
engine->RegisterGlobalFunction("void printf(bstr, float, int)", asFUNCTION(printf), asCALL_CDECL);
I''m not sure how I would implement support for the ellipse token in AngelScript as the engine wouldn''t know how much parameter data to copy to the C++ stack.
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library
#5 Members - Reputation: 158
Posted 22 March 2004 - 09:00 AM
bool bMyBool = false;
if (!bMyBool)
Console.Write("Hello World\n");
Building...
Parsing: "..\data\script\main.script"
Error : (27, 8) Expected expression value
Completed. (errors: 1, warnings: 0)
(Where 27,8 is the at the ''!'')
Thanks for the suggestion on the variable argument functions though- I hadnt thought about it that way, I have been making proxy functions instead!
D
#6 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 28 March 2004 - 12:36 PM
This sure would be hugely useful for savegames.
Of course, the "re-registering" of engine (c++) functions would need to be done by the engine creator itself first before the resuming as well as the non-script related engine things save/loading
Probably with this feature you would make a quantum leap step in the save/load game problem, the resuming of scripts at the exact place where (and how) they were running!
Cheers for the great script engine btw
#7 Moderators - Reputation: 2312
Posted 29 March 2004 - 05:19 AM
However useful something like this would be I don''t think it is something I would be able to implement for AngelScript.
Though, since the application developer can put his own restrictions on the use of AngelScript he himself could modify the AngelScript library to allow saving of the context states.
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library
#8 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 29 March 2004 - 07:21 AM
"AngelScript doesn''t know what type of objects it has in its stack thus it cannot go through the stack and save it to disk if it contains pointers to other memory locations. "
What if the programmer can register some kind of serialization(load/save) functions for each own type (or make each type a class with some virtual methods)?
That way AngelScript would only need to do thisobject->Save(output), thisobject->Load(input)
or if using functions
(*ThisUserClassSave)(output, value);
value (*ThisUserClassLoad)(input);
or are there any other problems?
Anyway, thanks for your quick answer.
#9 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 29 March 2004 - 07:25 AM
This could also lead to some cool type ID checkings like Java has if I remember correctly.
Probably the extra-required memory could be argued, but in my humble opinion with machines with 512mb of RAM nowadays, it shouldn''t be much of a problem
#10 Moderators - Reputation: 2312
Posted 29 March 2004 - 12:45 PM
With a type identifier AngelScript could easily call registered callback functions for serializing each object.
Right now I don''t have any plans to add type identifiers to the stack because it would slow down the performance, especially when calling native functions since the engine would have to filter out these identifiers instead of just copying a previously know amount of bytes to the application stack.
Hmm, it might be possible to use a second stack to store the type identifiers, that way the efficiency in calling native functions wouldn''t be affected, and the managing of the second stack could be turned off if the application doesn''t need it.
It''s certainly worth thinking about. Thanks for the idea.
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library
#11 Moderators - Reputation: 2312
Posted 29 March 2004 - 01:19 PM
I will also implement the options step into, step over, and step out of for ExecuteStep().
These will be in the next version I release.
As I work on AngelScript I''m also coming closer and closer to a solution that I like for the problem of modules and piece wise recompilation of script code.
Right now I''m thinking that I''ll do it like this:
AddScriptSection() will have a new parameter specifying which module the section will be added to. Build() will also have a new parameter specifying which module that should be compiled (or all if not specified). If a module name is specified when calling Build() only code in that module will be recompiled allowing contexts not relying on that module to stay alive during recompilation.
You could think of each module as a dll that is manually loaded into your application.
In the beginning I think that modules will not be able to call functions in other modules (except for the global module (without name, representing the main application in the above analogy of dlls)). This would make it a lot easier to implement.
If it is found necessary to allow calling functions across modules this could be implemented in a future version.
What do you guys think of this solution? Would it work?
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library
#12 Members - Reputation: 122
Posted 29 March 2004 - 03:54 PM
The method you mentioned for separate code modules sounds like a great solution to me. I'm fairly confident that it would resolve the majority of issues where namespaces are required. Having one global module available to each private module should be fine, although it would be nice to be able to use something similar to the scope resolution operator to specify which module to call..
e.g.
float fDistance = fSpeed * Global::fTimeDelta;
or
float fX = Math::Cosf(PI);
I think the addition of a scope resolution operator would be a very elegant way of handling multiple code modules.
In C++, functions could be accessed in a similar way by providing the name of the module..
e.g.
asCScriptEngine::GetFunctionID("module name", "function name");
Would it be possible to add additional tokens for the logical operators 'and', 'or', and 'not' ? ( &&, ||, ! )
Regards,
Daniel.
[edited by - Wumpee on March 29, 2004 11:02:10 PM]
#14 Moderators - Reputation: 2312
Posted 30 March 2004 - 06:54 AM
It shouldn''t be too hard to implement the scope resolution operator.
Wumpee and LordVader:
I''ll add these tokens as aliases for the next version, ok? I think it should be just a matter of adding them to the token definitions.
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library
#16 Moderators - Reputation: 2312
Posted 30 March 2004 - 01:04 PM
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library
#19 Moderators - Reputation: 2312
Posted 13 April 2004 - 02:04 AM
I decided to make the only new thing in version 1.7.0 the ExecuteString() feature so that I can release it any time soon, but even that seems difficult at the moment. I have ExecuteString() working to the extent that it can use the registered system functions, but not the currently compiled script.
Currently I think that the next version will only be available in May, but I may surprise myself and release it sooner. In either case I will try to release a beta version earlier with at least partial support for ExecuteString().
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game
#20 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 18 April 2004 - 10:49 AM
Coroutines like in Lua. Pleeeeaaase !!!






