Page 1 of 1

Serialization function for custom type.

Posted: Sat Sep 08, 2018 11:43 am
by MarkusGod
Hello guys! Can somebody point me out the signature of Serialize function, or maybe point to docs page?
I can't figure out how to implement it on myself. :oops:
Image
Thanks, everybody!

Re: Serialization function for custom type.

Posted: Sun Sep 09, 2018 11:33 am
by MarkusGod
Also, is it possible to create something like a custom GameTokens? That will correspond user-defined structs?

Re: Serialization function for custom type.

Posted: Tue Sep 18, 2018 2:43 pm
by Cry-Flare
Game Tokens are setup to use the same types as the Flow System, specifically one of EFlowDataTypes values:

Code: Select all

enum EFlowDataTypes
{
eFDT_Any = -1,
eFDT_Void = cry_variant::get_index<SFlowSystemVoid, TFlowInputDataVariant>::value,
eFDT_Int = cry_variant::get_index<int, TFlowInputDataVariant>::value,
eFDT_Float = cry_variant::get_index<float, TFlowInputDataVariant>::value,
eFDT_EntityId = cry_variant::get_index<EntityId, TFlowInputDataVariant>::value,
eFDT_Vec3 = cry_variant::get_index<Vec3, TFlowInputDataVariant>::value,
eFDT_String = cry_variant::get_index<string, TFlowInputDataVariant>::value,
eFDT_Bool = cry_variant::get_index<bool, TFlowInputDataVariant>::value,
};
Regarding the Serialization method in Schematyc components you can take a look at a pre-existing component for reference.
I recommend taking a look at CAreaComponent::SShapeParameters struct. This provides it's own serialize method.
https://github.com/CRYTEK/CRYENGINE/blo ... nent.h#L50

Re: Serialization function for custom type.

Posted: Tue Sep 25, 2018 7:36 pm
by MarkusGod
Thanks for your answers! I still have some questions :oops: ...
How is possible to make a plugin depend on another plugin?
What I mean is how can I for example reference class from some plugin in gamedll, or use functionality from the standard plugin in editor plugin?

Re: Serialization function for custom type.

Posted: Mon Oct 15, 2018 9:55 am
by Cry-Flare
C++ plugins are defined in the cryproject file and loaded in the order they are given there.
To use methods from one dll/plugin in another, you will need to use the plugin manager to get a pointer to your plugin interface;

Code: Select all

CGamePlugin* pMyOtherPlugin = gEnv->pSystem->GetIPluginManager()->QueryPlugin<CGamePlugin>();
Of course, you will need to include your other plugins interface header, eg. the "GamePlugin.h".

I believe editor plugins are loaded before game plugins, so you may need to wait for the game plugin to be loaded by listening to an event in sandbox or modifying the load routine.