[UT1] localization?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

MudBlud

New Member
Mar 7, 2002
21
0
0
38
England, UK
hi, im trying to load a struct from a .int file

Code:
[LocVar]
TotalPlayers=3
Player[0]=(RealName="Mike",Gender="M",Age=18)
Player[1]=(RealName="John",Gender="M",Age=21)
Player[2]=(RealName="Angie",Gender="F",Age=17)

i have a menumod to test it:

Code:
class LocVar extends UMenuModMenuItem localized;

struct Player
{
	var string RealName;
	var string Gender;
	var int Age;
};

var config localized int TotalPlayers;
var config localized Player Players[5];


function Execute ()
{
	local int x;
	x = 0;
	
	for(x = 0;x < TotalPlayers;x++) {
		Log("Name: " $ Players[x].Name $ " Gender: " $ Players[x].Gender $ " Age: " $ Players[x].Age);
	}
}

if i have 'localized' in the class line i get error:
Error, Class 'localized' keyword is no longer required

if i take it out, nothing gets logged :rolleyes:

Any ideas? I'm probably doing it totally wrong :lol:
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
El_Muerte_[TDS] said:
config variable can't be localized afaik
It wouldn't make sense anyway because the engine would have two places (INI and INT files and even three if you count the defaultproperties) to load the default value of a "localized config" property from.
 

Mychaeel

New Member
Well, you could imagine that those three places are internally prioritized: Use the config setting if it exists, otherwise the localized setting, and fall back to the property defaults specified in the class. (Just like either of the "config" or "localized" settings fall back to the defaults unless they're explicitly specified in an .ini or .int file.)

You're missing a "config" attribute in the class declaration though if you want to use config variables.
 

MudBlud

New Member
Mar 7, 2002
21
0
0
38
England, UK
i don't, i just want to be able to load a struct from an int hich u cant do in an ini. still nobody has answered why i get the error when i compile wth the localized class attribute or how to do it :(
 

elmuerte

Master of Science
Jan 25, 2000
1,936
0
36
42
the Netherlands
elmuerte.com
don't use localized as class attrib (it's invalid, it's no longer required since a very very long time, all classes are localized).

don't user `config`and `localized` at the same time for vars