Skip to main content
gamedev.net
🔒 Locked

C++ like Script language

Started by nopcoder 15 replies 4.3k views
Original Post
nopcoder
nopcoder
I have decided to go “Data-Driven”-design with my project and use a script language for game code. I’ve looked at Lua, Python, Ruby, AngelScript and UnrealScript (seems great, shame it’s not free). Except for the annoying lack of inheritance, AngelScript seems good. I’m mainly looking for a C++/Java syntax-like (strongly-typed and object-oriented) language that binds well with C++, suggestions are appreciated. Thank you. [Edited by - nopcoder on January 30, 2007 8:24:47 AM]
sevensevens
sevensevens
Look at the JNI (Java Native Interface). You may actually be able to use Java as a scripting language (I've never done this, nor am I sure it would work, but it would be pretty cool:)
nopcoder
nopcoder
Quote:
Original post by jflanglois
Have you looked at Squirrel with SQPlus?


Squirrel is not strongly-typed. It's a shame there aren't many strongly-typed scripts out there. It gives a great advantage (less error-prone, clearer and potentially faster code).

Quote:
Original post by sevensevens
Look at the JNI (Java Native Interface). You may actually be able to use Java as a scripting language (I've never done this, nor am I sure it would work, but it would be pretty cool:)


That would be cool, I'm looking in to it now =)
umbrae
umbrae
I'm working on a strongly-typed scripting language for games. It has quite a few features that have passed the proof of concept stage (but not too much past that).

But yeah, it's not finished... I just haven't had time to work on it.

Been in development for around 3 years on and off.

Anyway, I'm not really adding to the thread other than agreeing that the strongly typed aspect of scripting languages is lacking. I'm an advocate for strongly typed everything.

[Edited by - umbrae on February 15, 2007 2:03:57 PM]
tldalton1622
tldalton1622
Python. You can integrate c++ seamlessly with it.
Spoonbender
Spoonbender
What I'd like to see is a scripting language with ML-like static typing and type inference... Screw stronly typed... [lol]
nemesisgeek
nemesisgeek
I'm working on a typeless (variables are stored as strings and converted to numbers, pointers, etc. as needed) language for my engine. It's called VulcanScript and seems to be working pretty good so far.

I can't give out source - it's not even finished yet - but I can give you some technical details and partial code samples if you email me at webmaster@t104.org.

//Scripted routines for Clubhouse map//PlayRandomAmbientSound(pTrigger)function PlayRandomAmbientSound{  //Get a pointer to our trigger (spawn point) and verify it  var pTrigger=params[0];  Assert(IsValidPtr(pTrigger));  //Pick a random sound  var num=RandomNumber();  num=num%3;  var sound_id="";  if(num==0)  {    //No sound played in this case    return 0;  }  if(num==1)  {    sound_id="s-clubhouse.ambient.phonering";  }  if(num==2)  {    sound_id="s-clubhouse.ambient.truckpassby1";  }   //Create the actor  var pActor=CreateActor("AmbientSound",pTrigger->pos.x,pTrigger->pos.y,pTrigger->pos.z);  //Set its properties  pActor->sound=sound_id;  pActor->soundvol=0.3;  pActor->looping=0;  pActor->ResetSound();}
hackerkey://v4sw7+8CHS$hw6+8ln6pr8O$ck4ma4+9u5Lw7VX$m0l5Ri8ONotepad++/e3+8t3b8AORTen7+9a17s0r4g8OP
smr
smr
Angelscript. Strongly typed and quite C++ like.
Deranged
Deranged
Quote:
Original post by smr
Angelscript. Strongly typed and quite C++ like.


seconded.
DvDmanDT
DvDmanDT
Or you could use C#..

DirectX SDK\Samples\Managed\Direct3D\Scripting

Scripts are written in C#, engine in C++.. Compiles to machine code on execution so you get speed..


Also, Angelscript is still under development, and inheritance has high priority..
RDragon1
RDragon1
If you want to use 'something like C++' as a script language, why don't you use C++ itself?

Your script compiler will be your trusty dusty C++ compiler.
DvDmanDT
DvDmanDT
BTW, there is accutually some C++ interpreter which you might be able to use..
stormwarestudios
stormwarestudios
Might I suggest GameMonkey Script.

From the site:
  • Small code base. Compiled code may use about 50kb of RAM. Less when tweaking or sharing with application.
  • Compile source code at run time, or link to precompiled libs.
  • Lightweight, native threading.
  • Soft real-time incremental garbage collection. Controllable memory footprint.
  • No painful reference counting.
  • Easy to bind C\C++ functions and call script from C\C++.
  • Runtime debugging and reflexion support.
  • C style syntax.
  • Competitive performance when compared to other scripting languages for both CPU and Memory usage. Speed is a trade off for flexibility and simplicity.
  • Easily modifiable as it is written in C++ and uses Flex and Bison.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.