Author Topic: Last Engine API informations (scripts)  (Read 13408 times)

Offline Berko

  • Tim Tom Ted
    • http://kabefis.deviantart.com/
Last Engine API informations (scripts)
« on: March 17, 2013, 09:54:31 pm »
A little program to show API of FOnline engine. (As documentation is obsolete)
Program use .Net framework.

program : http://kabefis.free.fr/Fonline/API/FOnline_Engine_API_Viewer.exe
rev-381 file : http://kabefis.free.fr/Fonline/API/ASCompiler-381.txt (last revision of API)

A lot of thing to do but not sure I will do it.

If you see something that isn't in documentation and you want some informations you can look on revision comment (google translate).
http://kabefis.free.fr/Fonline/API/List_ASCompiler_revision_details_EN.txt
~~~ Ashes of Phoenix project --> http://fonline-aop.net/ ~~~

Offline Wipe

  • Rotator
  • Random is god
Re: Last Engine API informations (scripts)
« Reply #1 on: March 17, 2013, 10:18:22 pm »
Isn't it duplication of IntellisenseCreator*.dll?
Games are meant to be created, not played...

Offline Berko

  • Tim Tom Ted
    • http://kabefis.deviantart.com/
Re: Last Engine API informations (scripts)
« Reply #2 on: March 17, 2013, 10:59:45 pm »
Yes maybe, I never success to extract data with it (i got crash but I certainly use it in a bad way) and don't want to use Visual Studio to make scripts if the purpose is intellisense. I'm sure IntellisenseCreator is excellent, especially it look easy to update and API will be integrated in an IDE. My main purpose was to update documentation but finally I will not, not enough time and my tool is enough for me. At least it help me to update Notepad++ on last revision. I share it for people who want to see what they can do and didn't success to use IntellisenseCreator (didn't know it/didn't know how to use it/didn't use MSVS 2005 or 2008/..)
~~~ Ashes of Phoenix project --> http://fonline-aop.net/ ~~~

Offline Wipe

  • Rotator
  • Random is god
Re: Last Engine API informations (scripts)
« Reply #3 on: March 17, 2013, 11:41:52 pm »
Oright, let's leave msvc then :)

I'd add display of few things which aren't part of engine itself, but comes from AngelScript addons (slightly modified) - array / string / any (is anyone using it?) / dictionary / file. I can't imagine foscripting without first two, info about them may be good for people who are just starting their adventure with AS.
Games are meant to be created, not played...

Offline Atom

  • Rotator
Re: Last Engine API informations (scripts)
« Reply #4 on: March 29, 2013, 05:06:34 am »
Yes maybe, I never success to extract data with it (i got crash but I certainly use it in a bad way) and don't want to use Visual Studio to make scripts if the purpose is intellisense. I'm sure IntellisenseCreator is excellent, especially it look easy to update and API will be integrated in an IDE. My main purpose was to update documentation but finally I will not, not enough time and my tool is enough for me. At least it help me to update Notepad++ on last revision. I share it for people who want to see what they can do and didn't success to use IntellisenseCreator (didn't know it/didn't know how to use it/didn't use MSVS 2005 or 2008/..)
IntellisenseCreator isn't strictly speaking a part of MSVC integration, it only generates a header file containing the API of the application used to generate it (server, mapper, client or compiler). To make it work, simply compile the script create_intellisense.fos with any of these applications (the relevant dll must be present in the compilation directory). It will report the creation of a file that looks like this:
http://pastebin.com/j3y8gD0Z

The advantage here is that it will also list all objects, methods, properties etc. registered by the users in other dlls or by using script pragmas bindfunc and bindfield (this provided that create_intellisense.fos is the last script to be compiled).

Note that I just updated the sdk dlls to match the latest AS revision used by the FOnline apps.

Offline Berko

  • Tim Tom Ted
    • http://kabefis.deviantart.com/
Re: Last Engine API informations (scripts)
« Reply #5 on: March 31, 2013, 07:38:33 pm »
I successfully created header file with your new dlls for mapper and server, it crash for client but now I see what it look like :)
Is there something special to do with client? Modules have to be added in scripts.cfg for each application and mapper header is created when launching mapper and both server and client headers are created when starting server, it's that? Or directly compiled with AsCompiler with "-mapper", "-server" or "-client" ?
For information, when it's write "// Arguments for this function have been guessed" it's because AngelScript function return prototype without arguments name?
What I see with my brutal and ugly method is that reading exe file didn't show all information, memory image of program look to have all information using debug tool to dump memory. I think it can be easier (maybe not ..) with dll as AsCompiler will still be running.
~~~ Ashes of Phoenix project --> http://fonline-aop.net/ ~~~

Offline Atom

  • Rotator
Re: Last Engine API informations (scripts)
« Reply #6 on: April 01, 2013, 06:39:06 am »
I updated the IntellisenseCreator files again, fixing the client crash and reworking few things.

The headers can be generated by either
1) compiling create_intellisense.fos by using ASCompiler with -server, -client and -mapper switches, or
2) compiling it as a server, client or a mapper module by either server (for server and client headers) or mapper.

In case of 2), the create_intellisense module should be the last one on the list of modules, in each of server, client and mapper sections.

The advantage of 2) is that the header will be more complete: in addition to API registered by the core fonline applications, it will also contain information about other classes, functions, methods or properties registered by scripts or user dlls (with bindfunc pragma, for instance). Some projects can make an extensive use of this, and IntellisenseCreator is able to generate project-specific files this way.

For information, when it's write "// Arguments for this function have been guessed" it's because AngelScript function return prototype without arguments name?
Yes, and after getting the API information from the AngelScript engine, IntellisenseCreator opens the executable that loaded it and attempts to find within it the strings matching the definitions of the global functions and methods. These strings, being the original ones used to register the API, usually contain argument names.
However, some of the functions did not have the arguments named in the first place (notably certain AS addons), and user-registered functions won't be present in the executable at all. Meaning that few functions won't have their arguments named.