[SOLVED] How to attach entity to player?

#1
Hi,

I'm using the FPS template in 5.3, and I'm trying to attach a Schematyc entity (thats already placed in world) onto my Player when the game starts. I doing this so that I can get sensor volumes to work for the player.

Anyone know how to do this in FlowGraph or C++?

EDIT (Solution):
Got it working finally. Had to create a Joint Attachment in the Character Editor and used it as the "Item" to attach when using the Entity::Attachment FlowGraph node. The node had a selected entity of the Actor::LocalPlayer node.

Thanks,
Josh
Last edited by WhatsThatFunction on Tue Jul 18, 2017 6:09 pm, edited 1 time in total.

Re: How to attach entity to player?

#3
I haven't really done this myself, so inform us if it is successful.
If you have downloaded cryengine's source code, look at this file (don't download it if you don't need it. you can just see it in github):
Code\CryEngine\CryAction\Mannequin\ProceduralClipProps.cpp

In this file, look at CProceduralClipAttachProp's "OnEnter" method (32nd line). In there, you can see how you can see how to attach "cgf" files (using "CCGFAttachment"), "skin" files ("CSKINAttachment") and skeleton files ("CSKELAttachment").

Now look at this file:
Code\CryEngine\CryCommon\CryAnimation\IAttachment.h
In this file, you can see besides the attachments I mentioned (CCGFAttachment, CSKINAttachment and CSKELAttachment), there is also "CEntityAttachment" (line 703).
If you can get your entity's id, using this struct and the code snippet in the previous file, I believe you can attach your entity to the character.

You can get find your entity in c++, by name, like this:

Code: Select all

gEnv->pEntitySystem->FindEntityByName("the_entity");

Re: How to attach entity to player?

#5
Got it working finally. Had to create a Joint Attachment in the Character Editor and used it as the "Item" to attach when using the Entity::Attachment FlowGraph node. The node had a selected entity of the Actor::LocalPlayer node.

Thanks for the help, guys!

Hey, I've been wanting to do the same thing here but I can't figure out how to get it working in flowgraph. I did what you said, I think, but I must be doing something wrong. I've attached pictures of my setup, do you mind looking?
sczddsdsgdaadsgas.JPG
sczddsdsgdaadsgas.JPG (57.03 KiB) Viewed 1000 times
attahcment.JPG
attahcment.JPG (25.76 KiB) Viewed 1000 times

Re: How to attach entity to player?

#6
Schemetik is experimental for now . some function is missing. flowgraph and entity component and Schemetik are all seperated;


this guy know how to write scheymic

https://twitter.com/ahmad0karami

I wonder where you got that this guy knows something?) From his video, it's clear that he just overwrote the original lessons. The only thing that made the jumping ball. A great achievement. Without explaining how or what. And note he moved to Lumberyard
Developer from Russia. Lessons on Schematic and more: https://www.youtube.com/c/PODOBI4

Who is online

Users browsing this forum: No registered users and 2 guests