5.4 C++ Spawn schematyc entity in c++

Hi! Do you know any way to spawn schematyc entity in c++? I know how to spawn entities and I know how to create components and assign it to the entities, but I am asking about schematyc-made entity (you know.. the entity that is in legacy entities and was made clearly in schematyc) .
I tried to find a class of it

Code: Select all

IEntityClass *pClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("rifle1")l
But no matter what it always returns null.
I don't know how to find class of that entity. Well.. I know schematyc uses BasicEntity and all we do is just assigning components to it, but in the end I want to spawn this setup I made. Any ideas?

Found the solution. For anyone who is trying to spawn schematyc entity there is what I did:

1.I found all entities that my engine has like that:

Code: Select all

IEntityClassRegistry *pClassReg = gEnv->pEntitySystem->GetClassRegistry(); IEntityClass *pClass = nullptr; pClassReg->IteratorMoveFirst(); for (int i = 0; i < pClassReg->GetClassCount(); i++) { if (pClass = pClassReg->IteratorNext()) { CryLogAlways("CLASS NAME = %s", pClass->GetName()); } }
This will show even schematyc entities. It will log them into console. So thanks to that loop, I found how to access schematyc entities.

Code: Select all

IEntityClass *pClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("schematyc::yourfolder::anotherfolder::entityName);
I think it is not case sensitive.
In my case it was :

Code: Select all

IEntityClass *pClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("schematyc::items::weapons::rifle1);
Cryengine tutorial videos on my Youtube channel! Check it out !

Who is online

Users browsing this forum: No registered users and 1 guest