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"

Can’t Exec function in packaged game

My code look like this: .h

 UFUNCTION(BlueprintCallable, Exec, Category = "MissionConditionBPLibrary")
 static bool RandInPercentage(float Val, bool bIsEqual = true);

I add this function to call it

 void UMissionConditionBPLibrary::ExecMissionCondition(FString FuncString)
 {
     GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("ExecMissionCondition")));
     if (WorldContext == nullptr || !WorldContext->IsValidLowLevel()) {
         GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("cant ExecMissionCondition")));
     }
 
     FOutputDeviceNull ar;
     UMissionConditionBPLibrary *MissionConditionBPLib = NewObject<UMissionConditionBPLibrary>(WorldContext, UMissionConditionBPLibrary::StaticClass());
     MissionConditionBPLib->CallFunctionByNameWithArguments(*FuncString, ar, nullptr, true);
 }

When I play game in editor it is worked! but After I package it can't exec this function.I don't know why.Can you help me?

Product Version: UE 4.19
Tags:
more ▼

asked Dec 01 '18 at 12:10 PM in C++ Programming

avatar image

ZhengChengxuan
6 2 5

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

1 answer: sort voted first

Hello,

What package configuration are you running? If you are running Shipping or Test, debug functions (like Console Exec commands) are disabled.

This is hardcoded so the only way to get debug functions working in Shipping or Test is to switch to Development or change the engine code.

~ Dennis "MazyModz" Andersson

more ▼

answered Dec 02 '18 at 01:24 AM

avatar image

MazyModz
266 4 5 6

avatar image ZhengChengxuan Dec 03 '18 at 02:44 AM

Is there a way to Exec commands?Because we fill some function or condition in the datatable,we need the game can read function name and exec it.

(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