x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Error : In CodedThirdPersonTestGameMode: Unrecognized type 'ECodedThirdPersonTestPlayState'

Hello all, I have just got started with C++ and UE4, following the tutorials that Epic have put on their YouTube channel, but I keep getting this error.

Error 1 error : In CodedThirdPersonTestGameMode: Unrecognized type 'ECodedThirdPersonTestPlayState' C:\Users\James Moran\Documents\Unreal Projects\CodedThirdPersonTest\Source\CodedThirdPersonTest\Public\CodedThirdPersonTestGameMode.h 32 1 CodedThirdPersonTest

This is the tutorial I am following: Introduction to UE4 Programming - 16 - Setting the Rules in the GameMode

Here is my code:

 // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
 #pragma once
 #include "GameFramework/GameMode.h"
 #include "Pickup.h"
 #include "CodedThirdPersonTestGameMode.generated.h"
 
 
 // enum to store the current state of gameplay
 /*UENUM(BlueprintType)
 I get a different error when this line is in, regarding missing a '{' in 'Enum'
 */
 enum class ECodedThirdPersonTestPlayState : uint8
 {
     EPlaying,
     EGameOver,
     EUnknown
 };
 
 
 UCLASS(minimalapi)
 class ACodedThirdPersonTestGameMode : public AGameMode
 {
     GENERATED_UCLASS_BODY()
 
     virtual void Tick(float DeltaSeconds) override;
 
     
     
     /** The rate of power decay*/
     UPROPERTY(EditAnywhere, BluePrintReadWrite, Category = Power)
     float DecayRate;
 
     /** Gets the current state of the game*/
     UFUNCTION(BlueprintCallable, Category = Power)
     ECodedThirdPersonTestPlayState GetCurrentGameState() const;
 
     /** Sets the current state of the game*/
     UFUNCTION(BlueprintCallable, Category = Power)
     void SetCurrentState(ECodedThirdPersonTestPlayState NewState);
 
 private:
 
     ECodedThirdPersonTestPlayState CurrentGameState;
 
     void HandleNewState(ECodedThirdPersonTestPlayState NewState);
 };
 
 FORCEINLINE ECodedThirdPersonTestPlayState ACodedThirdPersonTestGameMode::GetCurrentGameState() const
 {
     return CurrentGameState;
 }


Can anyone please tell me what the problem is? My thanks.

Product Version: Not Selected
Tags:
more ▼

asked Oct 14 '14 at 10:57 AM in C++ Programming

avatar image

FioKron
22 9 10 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first
 UENUM(BlueprintType)
 namespace ECodedThirdPersonTestPlayState
 {
     enum Type
     {
         EPlaying,    
         EGameOver,    
         EUnknown,    
     };
 
 }
 
 ...
 
      UFUNCTION(BlueprintCallable, Category = "Power")
      void SetCurrentState(ECodedThirdPersonTestPlayState::Type NewState);

more ▼

answered Oct 15 '14 at 05:13 AM

avatar image

ScottSpadea
9.6k 320 205 449

avatar image FioKron Oct 15 '14 at 10:52 AM

Thanks for the answer @Omnicypher I will be sure to try this out soon, having problems with my headset atm :S

avatar image FioKron Oct 15 '14 at 03:55 PM

It works, thank you so very much for this @Omnicypher, I appreciate it greatly :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question