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"

Create Property in c++ and let them return different values depending on WITH_SERVER macro

Hey!

I already figured this out once (I still have the node without exec pins referenced in a blueprint) and i remember i used it :&

I want to create a property IsWithEditor that I can use in blueprints. I dont want to make it a function, why does this not work:

     UPROPERTY(BlueprintReadOnly, Category = "ServerHelp")
         #if WITH_EDITOR
             bool IsWithEditor = true;
         #else
             bool IsWithEditor = false;
         #endif

I know I could just make a function but there has to be a way with it being a property...

Product Version: UE 4.14
Tags:
more ▼

asked Feb 19 '17 at 03:29 PM in C++ Programming

avatar image

t0b4cc0
61 13 17 20

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

1 answer: sort voted first

How does it not work what is happening? Try setting this variable in constructor this is where defaults should be set by UE4 convention, maybe this deceleration messing up UHT. btw engine already has this in APIs for this, there is GIsEditor static variable and there also this:

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/UEngine/IsEditor/index.html

more ▼

answered Feb 19 '17 at 05:36 PM

avatar image

Shadowriver
37.1k 935 172 1116

(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