Announcement

Collapse
No announcement yet.

Any suggestions for how I would output some default values for localized variables?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Any suggestions for how I would output some default values for localized variables?

    I have some Kismet action sequences that tell the HUD to pop up a GFx movie that shows a dialog window. My Kismet action sequence has a string variable DialogText containing what the character says. Later I started working on localization, and I added the localized string DialogText_Localized. Now what I would like to do is a localization export and copy DialogText into DialogText_Localized. As far as I can tell, there's no easy way to do that, and the localization export function is buried deep in native code and I'd rather not mess with it.

    Is there an easy way that you can think of (maybe packing all of the functionality into a brush?) that could iterate through sequences in the current level, and write their info to a text file?
    Check out Himeko Sutori, the upcoming tactical RPG where you control armies of over 100 unique characters.

    #2
    I believe it's easy to just iterate through a level's sequences from unrealscript, it's narrowing it down to exactly the ones you need to target that takes a little more work.

    Code:
        GameSeq = WorldInfo.GetGameSequence();
    
        if(GameSeq != None)
        {
            GameSeq.FindSeqObjectsByClass(class'SeqAct_Interp', true, AllSeqOBJs);
            for(i=0; i<AllSeqOBJs.Length; i++)
            {
                Index = i;
                if (Index != INDEX_NONE) 
                {    
                    tempinterp = SeqAct_Interp(AllSeqOBJs[i]);
    
                    if(tempinterp.ObjComment == "First Path")
                        MatineePath1 = tempinterp;
                    if(tempinterp.ObjComment == "Second Path")
                        MatineePath2 = tempinterp;                
                }                            
            }    
        }    
        }

    Comment


      #3

      We did not use kismet to do what your after. We used the
      GFxMoviePlayer and extenededthat to our own
      WPGFxMovieplayer then we made us a file that extended that.
      class PBGFxSPMenu extends WPGFxMoviePlayer;

      Then in our sp menu PostWidgetInit()
      we could add localized text to the close button or any object in the movie.

      event PostWidgetInit()
      {
      RootMC.GetObject("Close").SetString("label", "<Strings:PaintballUI.SPMenu.Close>");
      MORE EXAMPLES BELOW ;

      RootMC.GetObject("autoassign").SetString("label", "<Strings:PaintballUI.SPMenu.JoinGame>"); RootMC.GetObject("blueteam").SetString("label", "<Strings:PaintballUI.SPMenu.SpecTxt>");

      }

      not sure if this helps but this is one way to get and to use localized text file strings.

      Comment


        #4
        Thank you both for the suggestions.

        gamepainters thanks. I have a system for passing the localized text to the GFxMoviePlayer.

        What I was trying to do was create a few hundred localization files for a few thousand PerObjectLocalized objects. I could do that by opening the editor, selecting the level packages in my game, and doing a localization export. But that would create empty entries for all of the objects, and I want to fill in the localized variables as I create the localization files.

        I ended up doing something similar to what ciox wrote.

        Code:
            AllRootSequences = class'Engine'.static.GetCurrentWorldInfo().GetAllRootSequences();
        
            foreach AllRootSequences(GameSequence)
            {
                GameSequence.FindSeqObjectsByClass(class'RPGTacKismetDialog', true, AllSequenceObjects);
        
                foreach AllSequenceObjects(CurrentSequenceObject)
                {
                    Dialog = RPGTacKismetDialog(CurrentSequenceObject);
                    if(Dialog != none)
                    {
                        // This is a horrible ugly hack.  These should be localized variables, but I change them to config variables to export them to an ini.
                        // Then I copy the data from the ini to the localization file and change them back to localized variables.
                        /*
                        Dialog.Dialog0_Localized = Dialog.Dialog0;
                        Dialog.Dialog1_Localized = Dialog.Dialog1;
                        Dialog.Dialog2_Localized = Dialog.Dialog2;
                        Dialog.Dialog3_Localized = Dialog.Dialog3;
                        Dialog.SaveConfig();
                        */
                    }
                }
            }
        It's ugly, but it works. Thanks for the help!
        Check out Himeko Sutori, the upcoming tactical RPG where you control armies of over 100 unique characters.

        Comment

        Working...
        X