I have an the need to use a scripting language, but I have a horrible list of requirements. The workstations(PS2 Linux) at uni do not let us have admin access and have a very old version of GCC).
Can anybody recommend a script language that ...
The scripts will be doing small amounts of logic for game-objects.
Luabind would be my first choice, but boost makes it impossible, and since the workstations are reset all the time, I would have to reinstall everything :(
I want to recommend Angelscript:
http://www.angelcode.com/angelscript/
It is damn easy to integrate with C++ and has threading and all. Sample integration:
r = engine->RegisterGlobalFunction("void print(const string &in)", asFUNCTION(print), asCALL_CDECL); assert( r >= 0 );
You cannot have it more easy. Classes have the same syntax but asMETHOD instead of asFUNCTION. It also supports exporting classes, having factories and comes with some premades like string and math. The language itself is a mix of C++, Java and Python, but really good.
Try it, I fell in love with it once I understood how to use it.
No scripting language I tried was so easy to integrate like Angelscript. And I tried quite a lot, like Python, LUA, Javascript etc.
edit: Some Code from my program, shows the integration of a class for you:
// Registering the interface to angelscript
void NLBoundingBox::registerWithAngelScript( asIScriptEngine* e )
{
AS_ERR_CHECK(e->RegisterObjectType("NLBoundingBox", 0, asOBJ_REF));
AS_ERR_CHECK(e->RegisterObjectMethod("NLBoundingBox", "bool intersects(const NLBoundingBox@)", asMETHOD(NLBoundingBox, intersects), asCALL_THISCALL));
AS_ERR_CHECK(e->RegisterObjectMethod("NLBoundingBox", "bool isPointInside(f32 x, f32 y)", asMETHODPR(NLBoundingBox, isPointInside, (f32,f32), bool), asCALL_THISCALL));
AS_ERR_CHECK(e->RegisterObjectMethod("NLBoundingBox", "void translate(f32 x, f32 y)", asMETHODPR(NLBoundingBox, translate, (f32,f32), void), asCALL_THISCALL));
AS_ERR_CHECK(e->RegisterObjectMethod("NLBoundingBox", "void translateTo(f32 x, f32 y)", asMETHODPR(NLBoundingBox, translateTo, (f32,f32), void), asCALL_THISCALL));
AS_ERR_CHECK(e->RegisterObjectMethod("NLBoundingBox", "void rotateAroundCenter(f32 angle)", asMETHOD(NLBoundingBox, rotateAroundCenter), asCALL_THISCALL));
// Behaviour: Factory and Refs
AS_ERR_CHECK(e->RegisterObjectBehaviour("NLBoundingBox", asBEHAVE_FACTORY, "NLBoundingBox@ NLBoundingBox()", asFUNCTIONPR(factory, (void), NLBoundingBox*), asCALL_STDCALL));
AS_ERR_CHECK(e->RegisterObjectBehaviour("NLBoundingBox", asBEHAVE_RELEASE, "void NLBoundingBox()", asMETHOD(NLBoundingBox, release), asCALL_THISCALL));
AS_ERR_CHECK(e->RegisterObjectBehaviour("NLBoundingBox", asBEHAVE_ADDREF, "void NLBoundingBox()", asMETHOD(NLBoundingBox, addRef), asCALL_THISCALL));
}
Just use Lua, and don't use their machines. If you must, keep your full dev environment and dependencies on a flash drive. Lua is literally the industry standard for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With