UE4SS-RE / RE-UE4SS

Injectable LUA scripting system, SDK generator, live property editor and other dumping utilities for UE4/5 games
http://docs.ue4ss.com/
MIT License
1.38k stars 188 forks source link

[BUG - Release] Lua - FString bad conversion and possibly returning incorrect values from specific object when not returning error #588

Closed rolfosian closed 4 months ago

rolfosian commented 5 months ago

Branch or Release 3.0.1

Game and Engine Version Deep Rock Galactic

Describe the bug

local UEHelpers = require('./mods/shared/UEHelpers/UEHelpers')
local Default__MissionFunctionLibrary = StaticFindObject('/Script/FSD.Default__MissionFunctionLibrary')
local SeedString = Default__MissionFunctionLibrary:GetSeedString(UEHelpers.GetWorld())
local f = io.open('test.txt', 'w')
f:write(SeedString:ToString())
f:close()

ToString Gave me ꒠Ӳʁ at first, I reloaded the script and got 帀䕺ʀ, reloaded again and got 龐㩑ʁ, later got 娰䏈ʀ amongst others. It always seems to be 3 chars, and it seems to like the that R character ending commonly with it either upright or upside down. I had to write to txt file because it couldn't print these to the console. After some more reloads I ended up getting:

image

Video of this occuring unreliably:

Replay 2024-07-03 23-52-03.webm

I suspect the random odd characters aren't correct either.

Mods directory n/a

To Reproduce Steps to reproduce the behavior:

  1. Launch game
  2. Load into space rig
  3. Run above code

Expected behavior Expected SeedString to be static during the 30 minute mission rotation interval between rollovers as it is a parameter for receiving mission seeds via bool GetSeedsFromString(FString seedString, FGlobalMissionSeed& outGlobalSeed, int32& outMissionSeed, int32& outPlsSeed); on the UMissionFunctionLibrary, though i could be easily wrong about this

and of course not return bad conversion.

Screenshots, UE4SS Log, and .dmp file If applicable, add screenshots to help explain your problem, and upload the log and .dmp files located in the Win64 directory.

Desktop (please complete the following information): win10

Additional context I could be using a wrong world object parameter to get the SeedString FString object, idk, but it appears to behave the same whether I'm at the start menu, in the Space Rig, in a mission, or in a Deep Dive, and UEHelpers.GetWorld() worked for other functions that took a WorldContextObject and returned the proper result so i shrug

edit: tested with zDEV-UE4SS_v3.0.1-137-g6867a08 and it's now printing the same thing reliably and appears to be coherent and what id expect: G:-1|M:-1|P:-1|S1 in the space rig, G:84335|M:68423|P:79794|S5 in a mission.

AnnznnA commented 5 months ago

I'm having the same problem, I can use it as a parameter for my construction FString object, but the read FString object prints out the exceptionally conversion value

rolfosian commented 5 months ago

I'm having the same problem, I can use it as a parameter for my construction FString object, but the read FString object prints out the exceptionally conversion value

try the latest version at https://github.com/UE4SS-RE/RE-UE4SS/releases/tag/experimental

it fixed it for me

AnnznnA commented 5 months ago

I'm having the same problem, I can use it as a parameter for my construction FString object, but the read FString object prints out the exceptionally conversion value

try the latest version at https://github.com/UE4SS-RE/RE-UE4SS/releases/tag/experimental

it fixed it for me

thx,It works for me