Announcement

Collapse
No announcement yet.

What am I missing here? UFUNCTION(exec), console function

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

    What am I missing here? UFUNCTION(exec), console function

    Hey,

    I just want to mark a function as exec so I can write the function name in the console and have some code executing for testing purposes.
    In UnrealScript you just wrote "exec function ...".
    Now I understand I have to mark my function in the header via
    UFUNCTION(exec)

    So what I did was this:
    - Header file:
    Code:
    UFUNCTION(exec)
    		void TestFunc(bool value);
    - Main file:
    Code:
    void AShooterWeapon::TestFunc(bool value)
    {
    	..do smth with "value"..
    
    }
    So the function "TestFunc" shows up in console but it says it cannot find the function... What am I missing?
    Last edited by Saiboat; 04-14-2014, 10:04 AM.
    https://xmpgame.wordpress.com/

    https://www.xmp.overbounce.de/

    #2
    Only certain classes can contain 'exec' functions. I'm afraid I can't find a full list right now, but I know Pawn, PlayerController, CheatManager, GameMode, PlayerInput & HUD are some of them.
    Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
    Twitter: @EpicJamesG

    Comment


      #3
      Right, it says so on the exec keyword documenation page but no mention of which classes those are. I now remember it was like this with UE3 aswell. Thanks James!
      https://xmpgame.wordpress.com/

      https://www.xmp.overbounce.de/

      Comment

      Working...
      X