legracer Posted May 15 Posted May 15 (edited) As the title say i can't get the message function to print a variable with "%g" or "%.0f" in the oblivion construction kit for the remaster. For example: scn MyScript short MyShort begin OnEquip set MyShort to Player.GetAV Alchemy message "Your Alchemy skill is level %.0f", MyShort end In game this will just show the message "Your Alchemy skill is level %.0f" instead of replacing the %.0f with the value of MyShort. I even tried copy pasting some official script into my script just as a test and for some reason even that doesn't work. I'm not sure if i'm somehow doing something wrong or if maybe it doesn't work with the remaster for some reason? Any help would be appreciated, thanks. Edited May 15 by legracer
rolloLG Posted June 3 Posted June 3 I've found the game seems to use different tags now with UE5... For example the string in the Oblvion.esm: Message "Fee to get rid of bounty: %.0f gold", TGInfo.TGPayFines, 10 extracted from UE4 Localization Tool became: Message "Fee to get rid of bounty: {Arg01}|obvArgDecimals(2) gold", TGInfo.TGPayFines Old %.0f became {Arg01}|obvArgDecimals(2). ... but my problem is even using vanilla game localization placeholder (in game will be shown as the UE5 localized string above): Message "LOC_AD_Dialogue_Notification_FeeToGetRidOfBounty", TGInfo.TGPayFines ...well, the problem is the game WON'T SHOW given calculated var values, but will always display 0: Quote Fee to get rid of bounty: 0 gold Expand Needs "a new refid also on the UE5 side" maybe? Please, can someone explain how to display messages with correct values in Message(Box) strings with Remastered?
rolloLG Posted June 6 Posted June 6 Made some tests, and with xEdit I compared compiled bytes (AltarESPMain.esp VS identical script recompiled), and found differences (in pink-red): As you can see the original compiled code from AltarESPMain.esp adds unknown bytes after "LOC_AD_Dialogue_Notification_FeeToGetRidOfBounty"... So Construction Set compiler compiled a different byte code for the script. This means we can't reliably recompile scripts using Message function displaying a variable (like {Arg01}|obvArgDecimals(2) which is the new %.0f), with current TES Construction Set for Oldblivion
rolloLG Posted June 6 Posted June 6 Oh, recompiling adding ALSO %.0f or %.2f: Message "LOC_AD_Dialogue_Notification_FeeToGetRidOfBounty %.0f", TGInfo.TGPayFines does generate the same* byte code found in the AltarESPMain.esp indeed! The problem is that the game will still display: Fee to get rid of bounty: 0 gold * "0100 7203 0066 0B" instead of "0100 7201 0066 0B" to be exact, but I guess is because I used %.0f instead of %.2f this time
rolloLG Posted June 6 Posted June 6 SOLVED A bit tricky (a hack?) but it worked... ... for example to recompile without issues default localized string "LOC_AD_Dialogue_Notification_FeeToGetRidOfBounty" in my case (read above): From the TES Construction Set use "LOC_AD_Dialogue_Notification_FeeToGetRidOfB %.2f" (same exact byte length but replaced last bytes): will compile without errors Message "LOC_AD_Dialogue_Notification_FeeToGetRidOfB %.2f", TGInfo.TGPayFines From an hex-editor, search for the string at point 1, and replace it with the original wanted string: "LOC_AD_Dialogue_Notification_FeeToGetRidOfBounty" re-correcting last chars This way I could finally see the string in game as I wanted: Fee to get rid of bounty: x gold [where x = calculated result from var TGInfo.TGPayFines] Same method should work also if you use custom strings, f.e.: "My own string: {Arg01}|obvArgDecimals(2) gold". Replace it with "My own string: {Arg01}|obvArgDecimals(2) %.2f", then compile it with TES Construction Set without errors, and in the final .esp re-correct the last bytes of the string --> "My own string: {Arg01}|obvArgDecimals(2) gold". Did not test this myself, but should work Good luck! 1
lavigne77 Posted June 17 Posted June 17 Thanks for sharing this brother... absolutely incredible find!
rolloLG Posted June 18 Posted June 18 Yeah, it took me some days and a headache but finally sorted it out... Of course if you need more vars, with new UE5 layer, you'll have to use for example: Message "This is my string and my value1 %.2f is: {Arg01}|obvArgDecimals(2), and %.2f value2 is: {Arg02}|obvArgDecimals(2)", value1, value2 ... and so on (notice Arg01, 02, ...). The part "...obvArgDecimals(n)" obviously defines decimals, so f.e.: %.0f is now {Arg01}|obvArgDecimals(0).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now