Jump to content

Recommended Posts

Posted (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 by legracer
  • 2 weeks later...
Posted

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?

Posted

Made some tests, and with xEdit I compared compiled bytes (AltarESPMain.esp VS identical script recompiled), and found differences (in pink-red): 

image.thumb.png.a17f3681c40eb5ca0e5e50023f22e112.png

 

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 â˜šī¸

Posted

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!

image.thumb.png.dd2f28800ce8d7ac9ab0cca281aa4d19.png

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

Posted

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):

  1. 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

     

  2. 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!

  • Like 1
  • 2 weeks later...
Posted

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).

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...