Quote: "Btw, this is probably very similar to what cyber did with the fire breathing dragon"
Yes, and it's a lot easier with an existing in-engine command available by lua, so added it:
limb_number = GetLimbByName(enum,limbstring)
So if call limbs 'smoke' for example in models, limb_number = GetLimbByName(e,"smoke") returns the number to attach the particle to.
The code if anyone wants it:
//DarkLUA.cpp
lua_register(lua, "GetLimbByName", GetLimbByName); //Cogwheel
int GetLimbByName(lua_State *L) //Cogwheel (e, limb name string)
{
lua = L;
int n = lua_gettop(L);
if (n < 2) return 0;
int eID = lua_tointeger(L, 1);
char limbstring[MAX_PATH];
strcpy(limbstring, "");
strcat(limbstring, lua_tostring(L, 2));
int objno = 0;
objno = t.entityelement[eID].obj;
int limbnumber = getlimbbyname(objno, limbstring);
lua_pushinteger(L, limbnumber);
return 1;
}