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"

[BUG] Runtime engine strips spaces from actor's names

Hi,

I noticed that at runtime UE strips the spaces in Actor names. I do a get all actors to find all the player starts, which are named "Player StartX", where X goes from 1 to 4.

In the editor, if I get the actor display name it returns e.g. "Player Start1", which is the expected behaviour.

However, at runtime (i.e. when the game is built to a standalone), the actor names will be stripped of spaces, e.g. "PlayerStart1".

Attached is a small repro.

Platform: OS X & Win

Version: 4.7.4

Repro Steps:

  • Open Level map

  • Hit play, notice how it writes that the length is 13, and when it tries to get a substring of index 12 with 1 length it returns 1 to 4.

  • Build the game for windows

  • Run it, notice how it will print the actor name withtout space and that the length is 12, and it incidently it fails to print the last character like in the editor.

Regards,

Nuno Afonso

Product Version: Not Selected
Tags:
substringtest.zip (379.5 kB)
more ▼

asked Apr 08 '15 at 12:15 PM in Bug Reports

avatar image

nafonso
132 7 13 17

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hi nafonso,

Thanks for the test project! I was able to reproduce this in 4.7.5 as well as our internal build, so I've entered a bug report for the issue (UE-13580). When I see any progress on it, I'll update this post. Thanks again!

more ▼

answered Apr 09 '15 at 04:01 PM

avatar image Michael Noland STAFF Apr 21 '15 at 02:10 AM

As mentioned in the comment for GetDisplayName, it returns a different thing for cooked games versus editor builds, and shouldn't be used for keying or other applications that need a stable name. It's really designed for use with debug printing / during development to give you a more friendly name than the object name. The actor label it is pulling from in editor mode doesn't exist at all in the cooked game.

I've exposed a GetObjectName in CL# 2518476, which will be stable across both cooked and non-cooked builds for things that don't autogenerate their names (e.g., stable for statically placed actors or C++ constructed components but not stable for AddComponent nodes in a UCS, transient objects created using NAME_None, etc...). If you need a name to display to the end user, you should use a FText variable instead of either one of these methods, so it can be localized.

Cheers, Michael Noland

(comments are locked)
10|2000 characters needed characters left
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