Comments (4)
Hi there,
If you disable RTTI, you'll need to add the DEFINE_HSM_STATE() macros in each of your states to inject the custom RTTI info needed by hsm. Check out the info in the documentation:
https://github.com/amaiorano/hsm/wiki/Chapter-1.-Getting-Started#rtti
If you haven't already, I highly recommend reading the doc. Let me know if that works for you! I've shipped UE4 multiple games that use HSM, so it should work out just fine.
from hsm.
Hi, this is what I am doing right now (just leaving 1 state in there) and the baseState in there in case I happen to be using the wrong syntax;
struct MyStates
{
struct BaseState : hsm::StateWithOwner
{
DEFINE_HSM_STATE(BaseState);
};
struct Grabbed : BaseState
{
DEFINE_HSM_STATE(Grabbed);
virtual hsm::Transition GetTransition()
{
if (!Owner().m_pBlackboard->GetValueAsBool(ISGRABBED))
return hsm::SiblingTransition<FallLoop>();
return hsm::NoTransition();
}
virtual void OnEnter()
{
Owner().m_bShouldProcess = true;
Owner().m_Animstate = EAnimEnum::Grabbed;
}
};
};
this throws me all of these erors:
Severity Code Description Project File Line Suppression State
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 33
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 38
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 69
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 108
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 140
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 164
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 196
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 217
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 234
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 250
Error (active) E0135 namespace "hsm" has no member "StateTypeIdStorage" FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 266
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 33
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 33
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 33
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 33
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 33
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 38
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 38
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 38
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 38
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 38
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 69
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 69
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 69
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 69
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 69
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 108
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 108
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 108
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 108
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 108
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 140
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 140
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 140
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 140
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 140
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 164
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 164
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 164
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 164
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 164
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 196
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 196
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 196
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 196
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 196
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 217
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 217
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 217
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 217
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 217
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 234
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 234
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 234
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 234
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 234
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 250
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 250
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 250
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 250
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 250
Error C2039 'StateTypeIdStorage': is not a member of 'hsm' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 266
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 266
Error C2146 syntax error: missing ';' before identifier 'sStateTypeId' FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 266
Error C3861 'sStateTypeId': identifier not found FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 266
Error C2065 'sStateTypeId': undeclared identifier FluffyFactory C:\perf\Grp_Fluffy\Dev\FluffyFactory\Source\FluffyFactory\FluffyCharacter.cpp 266
which are basically the same for every state I Define
I am currently using the latest Release Build I could find on here.
from hsm.
So I downloaded the second latest release (1.5) and had to comment the line //static_assert(std::is_convertible<TargetState, State>::value, "TargetState must derive from hsm::State");
and add this define at the start to make it build
#define HSM_CPP_RTTI 0
Seems to me there must be something missing in the latest release or the syntax of something has changed which I am not aware off.
from hsm.
So I downloaded the second latest release (1.5) and had to comment the line //static_assert(std::is_convertible<TargetState, State>::value, "TargetState must derive from hsm::State");
This assert is important, you should not remove it. If you're triggering it, it means you've probably added a DEFINE_HSM_STATE somewhere you shouldn't. This macro should only really be added to the actual states you transition to, not to base classes for your states. I noticed in the code you pasted above that you had added this macro to your BaseState, which you shouldn't be doing (see this example: https://github.com/amaiorano/hsm/blob/master/samples/hsm_book_samples/source/ch3/drawing_hsms.cpp).
and add this define at the start to make it build
#define HSM_CPP_RTTI 0
This is correct. You are supposed to define this to 0 to disable C++ RTTI, and make use of the custom RTTI. I assume you had already done this even before downgrading.
Seems to me there must be something missing in the latest release or the syntax of something has changed which I am not aware off.
I think you found a bug in the latest version related to custom RTTI. When I get the chance, I'll take a look and see what's up. For now, using 1.5 should be perfectly fine.
from hsm.
Related Issues (20)
- Chapter five of the manual is missing an image HOT 1
- whats wrong with my code which uses hsm? HOT 7
- plotHsm.py hangs HOT 5
- error: 'GetStaticStateType' is not a member of 'MyStates::STATENAME' HOT 3
- Transition from innerstate to sibling of parent state not executing parent OnExit() HOT 3
- How best to parameterize a "return" transition of a state HOT 2
- Publish current state via owner
- How to split a large state machine into several small state machines and put them in different files
- Single header file for entire library HOT 1
- How to split a large state machine into several small state machines and put them in different files HOT 2
- Why is the state stack processed from outermost to innermost? HOT 3
- static code analysis identify issues in HSM_ASSERT_MSG(cond, msg) HOT 1
- C++11/14
- fix potential buffer overflow in StateMachine::Log HOT 1
- Add deprecation macro
- Document C++11/14 StateArgs
- Provide a way to set a user-defined logging function
- Add StateMachine::Initialize that accepts state args to pass to initial state
- Question About State Inheritance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hsm.