User avatar
sfernandez
Site Admin
Posts: 2997
Joined: 22 Dec 2011, 19:20

Re: Getting started with Unreal - lots of confusion

27 Mar 2024, 11:22

Hi,

If you have a way to convert the char id number into some text, then you can specify a converter in the style like this:
<Style x:Key="char" TargetType="ContentControl">
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="ContentControl">
          <TextBlock Text="{Binding Path=., Converter={StaticResource CharIdConverter}}" Foreground="DodgerBlue" FontWeight="Bold"/>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
And the log string should specify the number as the content of the style tag: "Day 1, 4h: <char>552</> has spawned"

Could something like this work for you?
 
mprey
Topic Author
Posts: 10
Joined: 22 Jan 2024, 09:58

Re: Getting started with Unreal - lots of confusion

25 Apr 2024, 10:25

Thanks, that seems to be what I need. But how do I get the game world from within TryConvert? For some reason GetWorld() returns null from inside it so I assume I need some other way to get the world context, as I need access to my character subsystem to retrieve the name.

Additionally I am also not quite sure about the type conversions involved - am I supposed to return the FString I would ultimately retrieve from my subsystem as the name like this?
result = Noesis::Boxing::Box<Noesis::String>(TCHAR_TO_UTF8(*charName));

Who is online

Users browsing this forum: Galilman, Google [Bot] and 5 guests