Coding new STANCE using C++ in gamesdk

#1
Hello fellow coders at cryengine,

Thank you for the many useful tutorials on youtube that you have posted. Really appreciate all the effort you have put in to teach the community in Cryengine coding.

Recently I have come across a problem with coding new STANCE in C++. I coded a new stance through editing

1.playerinput.cpp, playerinput.h

Code: Select all

EStance CPlayerInput::FigureOutStance() { if (m_actions & (ACTION_CROUCH | ACTION_FORCE_CROUCH)) return STANCE_CROUCH; else if (m_actions & (ACTION_PRONE | ACTION_FORCE_PRONE)) return STANCE_PRONE; else if (m_actions & ACTION_GENERIC) return STANCE_GENERIC; else if (m_pPlayer->GetStance() == STANCE_NULL) return STANCE_STAND; return STANCE_STAND;
2.player.cpp,
3.Iagent.h

Code: Select all

enum EStance { STANCE_NULL = -1, STANCE_STAND = 0, STANCE_CROUCH, STANCE_PRONE, STANCE_RELAXED, STANCE_GENERIC, STANCE_STEALTH, STANCE_LOW_COVER, STANCE_ALERTED, STANCE_HIGH_COVER, STANCE_SWIM, STANCE_ZEROG, //! This value must be last. STANCE_LAST };
4.defaultprofile.xml
5.Basicactor.lua
6.player.lua
7.included SCRIPT_REG_GLOBAL(STANCE_MYSTANCE); in scriptbind_game.cpp/ scriptbind_actor.cpp/ GoalOp.cpp
8.included "m_dictStance.Add("Crouch", STANCE_MYSTANCE);" n Goalop.cpp


However, when I try to initiate the stance with my assigned key, I just a get a slight bob, exactly like the one referred to here:
h[url]ttps://www.cryengine.com/community_archive/vie ... 4&t=117356[/url]

or

the video here:

[youtubeID]https://youtu.be/JM8GM9u7Ffw[/youtubeID]



It seems like the stance information just does not get passed on, and the player would always default to STANCE_NULL
Does anyone by any chance, know the solution to this issue of coding and implementing a new STANCE?


The problem is really putting a stop to my game development here:
[vimeo]https://vimeo.com/314940693[/vimeo]

Really appreciate any help or glues anyone could provide!

Thank you ever so much.

Best regards,
Mike

Who is online

Users browsing this forum: No registered users and 0 guests

cron