The recent changes in cocos2d-2.0-rc2-x-2.0.1 to change all the static node creation methods, like CCRotateTo::actionWithDuration(a,b) to CCRotateTo::create(a,b) has had some bad consequences for lua binding. Now that there are many methods called create(), create(x), create(x,y, …) etc. overloaded there are issues with the tolua binding.
tolua overloading is not smart, it only does overloading by attempting to call the last registered function for a class, if that function has an error then it tries the next one. The issue is that in the LuaCocos2d.cpp it attempts to see if your function signatures are correct by calling tolua_isusertype to determine whether the next overloaded function should be tried.
The easiest way to see this problem is with CCSpawn. In lua if you do something like the following it will crash.
local testSpawn = CCSpawn:create(CCRotateTo:create(1,1), CCScaleTo:create(2,2))
This is because the return types in CCAction.pkg for CCRotateTo and CCScaleTo look like this:
static CCRotateTo* create(float duration, float fDeltaAngle);
static CCScaleTo* create(float duration, float s);
Then for CCSpawn:create in the tolua bindings in LuaCocos2d.cpp when it checks tolua_isusertype, it checks for “CCFiniteTimeAction” because CCSpawn inside of CCAction.pkg looks like this:
static create(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2);
That check fails and then the binding attempt to call the wrong CCSpawn:create function causing a crash.