Announcement

Collapse
No announcement yet.

State Design Pattern for a roleplay game

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    State Design Pattern for a roleplay game

    Hey,

    my name is Max and i started working with the Unreal Engine 4 a few days ago and i have some Questions.

    We are currently working on a roleplay game and i have to implement a class selection now(e.g Mage,Warrior...). After searching a little bit i found out that some people use the state design pattern for that kind of problem.
    Would you recommend this? Another problem is the class creation it looks like that i can only create classes by the add code function in the editor. When i add a class in VS 2013 the engine dont recognize it. Do my classes have to inherit from Actor or other classes to work?

    PS: My english isnt the best so please dont be too hard to me :P

    #2
    If you're adding the class file within Visual Studio itself, make sure that you don't save it to the directory that appears by default - instead, navigate to your project's Source/ProjectName directory, where the other source files exist.

    **Edit**
    Alternatively, you can use the "Add Code To Project" option in-editor, which will help you set up some boilerplate to get you started.
    Last edited by Minalien; 04-03-2014, 12:54 PM. Reason: Added an additional note detailing an alternative.
    - Your friendly neighborhood Drow Matriarch.

    Comment


      #3
      Also make sure that you are making the editor aware of your new class by labeling it with the UCLASS() macro. Also if you will to expose other parts of the class like functions or variables you have the UFUNCTION() and UPROPERTY() macros which will allow you to do so. Here is some documentation on those macro's and what functionality they provide you.

      Class - https://docs.unrealengine.com/latest...lassspecifiers
      Function - https://docs.unrealengine.com/latest...tionspecifiers
      Variables - https://docs.unrealengine.com/latest...ies/index.html
      Structs - https://docs.unrealengine.com/latest...cts/index.html
      Interfaces - https://docs.unrealengine.com/latest...ces/index.html

      Comment

      Working...
      X