I'm Trying to better understand how the game associates string keys with stuff in game.
Like how does the game associate the string key
'weapons.wok.weap.inf_bowcaster'
with the object/thing
'wok_weap_inf_bowcaster'
?
I see that there is an odf file called 'wok_weap_inf_bowcaster', but it doesn't mention anything about what string key to use with it.
Associating strings with in-game objects/things
Moderator: Moderators
- cbadal
- Corporal

- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
- Anakin
- Master of the Force

- Posts: 4817
- Joined: Sat Sep 19, 2009 11:37 am
- Projects :: RC Side Mod - Remastered - SWBF3 Legacy
- Location: Mos Espa (germany)
Re: Associating strings with in-game objects/things
well you are right if you'd rename wok_weap_inf_bowcaster to wok_weap2_inf_bowcaster, you'd need to make a string with the key weapons.wok.weap2.inf_bowcaster. But i think weapons.wok.weap2_inf_bowcaster would do, too
- cbadal
- Corporal

- Posts: 156
- Joined: Sun Jan 18, 2015 5:23 pm
- Projects :: SWBF2 XBOX Mod Environment
- xbox live or psn: No gamertag set
- Contact:
Re: Associating strings with in-game objects/things
I think I get it now.
The logic goes something like this:
The logic goes something like this:
Code: Select all
if( odfFileName.IndexOf("_weap_") > -1)
{
stringKey = "weapons."+odfFileName.Replace("_weap_",".weap.");
}
else if( odfFileName.IndexOf("_hero_") > -1 )
{
stringKey = "entity."+ odfFileName.replace("_hero_",".hero_");
}
else if( odfFileName.IndexOf("_fly_") > -1 )
{
stringKey = "entity."+ odfFileName.Replace("_fly_",".fly_");
}
else if( odfFileName.IndexOf("_inf_") > -1 )
{
stringKey = "entity." + odfFileName.Replace("_inf_", ".inf_");
}
-
Sporadia
- Corporal

- Posts: 152
- Joined: Thu Jan 24, 2019 11:02 pm
- Projects :: No Mod project currently
- xbox live or psn: No gamertag set
Re: Associating strings with in-game objects/things
I think it's for organisation. In the editlocalize tool it uses a . whenever there is a scope (ie it uses the . to group things). So if you have the odf wok_weap_inf_bowcaster, I guess the engine recognizes the object as a weapon and automatically puts it in the scope weapons, making it weapons.wok_weap_inf_bowcaster. Then if you had another weapon that starts with wok_, eg weapons.wok_weap_inf_fusioncutter, and you wanted to make a subgroup for all wookiee weapons, you just make wok into a scope (inside weapons). Then the keys become weapons.wok.weap_inf_bowcaster and weapons.wok.weap_inf_fusioncutter. It's like putting things in folders. To work backwards you just replace every . with an _. But the first scope like weapons or entity probably tells you something about the object itself.
EDIT: It's more likely that the first scope is assigned based on the object's class (inside the odf), not the odf's file name. Things like inf_ and fly_ or even rep_ are all completely arbitrary. On PC, you can see where the game puts scopes by default if you look at objects which haven't been localized. Weapons automatically have 1 scope ie weapons.abc_something_something. But entities seem to have 2 scopes by default ie entity.abc.something_something. Though this changes the moment you start localizing them.
EDIT: It's more likely that the first scope is assigned based on the object's class (inside the odf), not the odf's file name. Things like inf_ and fly_ or even rep_ are all completely arbitrary. On PC, you can see where the game puts scopes by default if you look at objects which haven't been localized. Weapons automatically have 1 scope ie weapons.abc_something_something. But entities seem to have 2 scopes by default ie entity.abc.something_something. Though this changes the moment you start localizing them.
