当在树状结构中存储值时,怪异的虚幻FSTRING行为
因此,我目前正在尝试为UE4分配游戏创建类似树状的结构,我目前正在努力制作基于文本的“选择您自己的冒险”游戏。
这就是存储在树的每个节点中的内容,每个节点都是Eventsystem_event CPP类和与将出现在与该路径有关的按钮上的文本有关的FSTRING。
,并且,随着我逐步介绍变量,它们似乎得到了正确分配。但!
当我检查Testevent的最终结果时,我会得到这个怪异的混乱,当我尝试访问数据时,将其定义为“无效”。 如您所见,顶部节点中的数据正确设置了(“测试事件文本1”),但是任何其他节点似乎都会让他们的文本都伴随着垃圾字符的混乱。我尝试使用FSTRING(text())设置FSTRINGS,但这仍然不起作用。
有什么明显的东西,我缺少C ++明智的明智,还是虚幻的破坏了?
So I'm currently trying to create a tree-like structure for a UE4 assignment game I'm currently working on to make a text based "choose your own adventure" game.
This is what is stored in each node of the tree, with each node being a EventSystem_Event cpp class and an FString relating to the text that will appear on the button relating to that path.
And this is a test tree that simply leads to four dead end events.
Now for the weird part.
This is how I'm populating each node in the tree:
And, as I step through the variables, they seem to get assigned correctly. BUT!
The moment I check the final result of testEvent I get this weird garbled mess, and when I try to access the data is defines it as "invalid".
As you can see, the data in the very top node is set correctly ("Test event text 1"), but any further nodes seem to have their text all jumbled up with garbage characters. I've tried setting the FStrings with FString(TEXT()) but that still didn't work.
Is there something blazingly obvious that I'm missing C++ wise, or is Unreal broken?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论