Author Topic: Angelscript  (Read 4992 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Angelscript
« on: January 16, 2006, 03:18:28 pm »
i would like to use/test the angelscript scripting features of C::B

can we have some information about how to use,
which functions of C::B could be triggered from a scipt, ...

maybe a few examples would be fine !

thx
--tiwag

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Angelscript
« Reply #1 on: January 16, 2006, 03:31:51 pm »
It hasn't been decided yet where and how it 'll be used :P
Now that you started this thread, I 'd like to ask folks to post their ideas/opinions on how to use scripting. Where would be appropriate to put hooks etc.

I must bring the current bindings up to date (this is easy), since the SDK has changed enough.
Then I 'll give you a couple of examples ;)
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Angelscript
« Reply #2 on: January 16, 2006, 03:44:15 pm »
Well, that was quick ;)
I only had to change one binding, from what I saw.

Update to latest revision (at least 1775).
Create a file, say "test.script".
Paste the following in it:
Code: [Select]
int main()
{
    // adjust the path to one of your projects
    Project@ prj = ProjectManager.LoadProject("C:/Devel/glfw/glfwapp.cbp", true);
    ShowMessage("Project loaded :)");

    ProjectManager.CloseProject(prj);
    // or
    // ProjectManager.CloseActiveProject();

    ShowMessage("Project closed :)\nBye.");
    return 0;
}

Choose "File->Run script".
Select your script :)

I 'll document the already exposed classes, maybe tonight, so you can play some more with it.
The bindings are in sdk/as/scriptbindings.cpp, if you want to take a look yourself :)
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Angelscript
« Reply #3 on: January 16, 2006, 04:16:20 pm »
works nice !
i'll look into the sdk/as/scriptbindings.cpp too

thx

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Angelscript
« Reply #4 on: January 16, 2006, 09:34:31 pm »
Can scripts ran from pre/post build steps?

Like Post-build step: as somescript.script.

Another thing:
Having AngelScripting outside C::B (binding stdlib, stl, and some filesystem portable library only) would be great also, for using as a common python/perl/bash/batch script replace.

It could be used in situations like in C::B own project update.bat/update.sh, and use only one instead update.script.
In that particular case, I don't know if it'll be desirable, but for personal project that will be an improvement (I don't want to learn entirely bash or other languages only to do some basic command line scripting).

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Angelscript
« Reply #5 on: January 17, 2006, 10:54:41 am »
Can scripts ran from pre/post build steps?

Like Post-build step: as somescript.script.

Another thing:
Having AngelScripting outside C::B (binding stdlib, stl, and some filesystem portable library only) would be great also, for using as a common python/perl/bash/batch script replace.

It could be used in situations like in C::B own project update.bat/update.sh, and use only one instead update.script.
In that particular case, I don't know if it'll be desirable, but for personal project that will be an improvement (I don't want to learn entirely bash or other languages only to do some basic command line scripting).

yes that would be great :)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring