• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
abrken

Suggestion for AngelScript Editors

8 posts in this topic

Hi, Actually, I have well integrated AngelScript in my project. This project consist in two programs : - The viewer that mainly use AngelScript - The editor that let input what the viewer display and also, the scripts that the viewer will execute. The idea that I would like AngelScript author to think about is on the editor part. I would like that asIScriptEngine to expose some new methods that allow to access to registered functions, variables, class, class properties and methods. This way, it could be possible to get AngelScript Editors (not only the one I working on) to get dynamic help for script writers. I have already tested the fact that you can register a function like this :
in_pAsEngine->RegisterObjectMethod("CXPNTree", "bool AskForNavigate(const CString &csWhere /*Page To Navigate To*/)",asMETHOD(CXPNTree, AskForNavigate), asCALL_THISCALL);
The asCScriptFunction object can store this "pure" declaration that include comments that could be presented to the script writter. This is just a wish, Think about it ! AbrKen.
0

Share this post


Link to post
Share on other sites
I think this is beyond the scope of what AS tries to provide. You could probably implement a class yourself that does this. That way you can make it do exactly what you want.
0

Share this post


Link to post
Share on other sites
Quote:

I think this is beyond the scope of what AS tries to provide


Please get to AngelScript intro page and re-read the first paragraph that says :

Quote:

It has been designed from the beginning to be an easy to use component, both for the application programmer and the script writer.


If a script writer must use notepad with and help file, I don't think that the abilities that provide AS to your programm will be used. I'm a programmer, script writers are end users. Personnaly I use MSVC and contextual help is what I was looking for years before.

Quote:

You could probably implement a class yourself that does this


Of course I can reinvent the wheel ! Why referencing two times the same things in a programm ?

Quote:

That way you can make it do exactly what you want


No, there is a big difference between the two solutions. Mine is to provide the script writer exactly what will be understood by AS before compiling.

I remember the times I was programming unix with vi, nowadays, end users use VisualBasic for application with integrated editors that provide contextual help.
0

Share this post


Link to post
Share on other sites
It shouldn't be too hard to be able to store&retrieve the original function-definition for a specific function from AS I think.

Who knows, maybe Andreas is up for it :)
0

Share this post


Link to post
Share on other sites
While your idea is good, I don't think I will include it in the main library.

I really think that this is an application specific thing, and not something that belong in the library. Who better knows how the function documentation should be stored and presented than the application that registered the functions? AngelScript doesn't store the actual declaration of the registered functions, instead it just stores the function name and the parameter types.

The AngelScript library is only a compiler and a virtual machine, the editor is the application that uses this library.

If you should want to make this into a reusable add-on library then I would be more than happy to host it on the angelscript site.

You are correct in pointing out that I've designed AngelScript to be easy to use, but I have to balance this with another goal, which is that the library should be light-weight and not include stuff that most applications might not even use.

Regards,
Andreas
0

Share this post


Link to post
Share on other sites
Back again on the editor ...

I will make most of the things but I need little help.

The idea was to overload the RegisterObjectType and other function of the asIScriptEngine to get a keyword list that would be highlighted in the editor.

How can I do this ?

Other thing, by contextual help you should have read code completion and call tips .
0

Share this post


Link to post
Share on other sites
I suggest that you start with one thing at a time.

If I was to do an editor like this I would store the keywords that need highlighting in a xml. I would also store the system functions that the target application registers in the xml. This would allow each application to provide their own xml, and even let the end user make their own changes as necessary.

With the xml you would also be able to have your editor do all the necessary registration so that the script can actually be compiled.

For your editor you'll need a tokenizer so that you can determine how to colorize each token.

If you want code completion you'll also need a parser, and a semantic checker, that is able to understand the context of the code.

You'll probably be able to take advantage of a lot of the code in AngelScript for this. At least to learn from it.

Regards,
Andreas
0

Share this post


Link to post
Share on other sites
I think I'm very bad in english ...


As you can see the editor is ok !
Syntax, etc...

But to show the list box you can see near the xmlPresenter-> I am using angelscript referenced objects and methods.

I was just wondering how to do it. Ofcourse I have already done it but ... I have build a asCScriptEngine wrapper class that have the same methods name that asIScriptEngine has. This wrapper class internaly reference object types, methods et so on (using AngelScript code :) ). I think there is a better way to do it !.


int CAsScriptEngineWrapperXPN::RegisterObjectMethod(const char *obj, const char *declaration, asUPtr funcPointer, int callConv)
{
asCScriptFunction func;

asCBuilder bld((asCScriptEngine *)GetEngine(), 0);

if(bld.ParseFunctionDeclaration(declaration, &func) == asSUCCESS)
{
CString csType = obj;
_stObjectDef *ptrDef;
if (m_mapTypes.Lookup(csType, (LPVOID&)ptrDef) && ptrDef != NULL) {
ptrDef->lFunc.AddTail(func);
}
}

return m_pAsIScriptEngine->RegisterObjectMethod(obj, declaration, funcPointer, callConv);
}



0

Share this post


Link to post
Share on other sites
I can't think of any way to improve on that.

If it is working already I don't see why you need to change it. Unless the performance isn't good enough for you, of course.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0