Results 1 to 13 of 13
  1. #1
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Posts
    140

    Default Read config ini file value into Kismet

    Is there a way to read a value from one of the ini files into kismet and if so could someone please point me in the right direction. Most of found is http://udn.epicgames.com/Three/ConfigurationFiles.html but this doesn't indicate whether I can access values from kismet.

  2. #2
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Posts
    140

    Default

    Anybody ... can the config ini files be read from kismet?

  3. #3
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    127

    Default

    you should probably get value from class which variables are saved to .ini, not directly from ini

  4. #4

    Default

    It really depends on which values you want to get into kismet. Custom values are easy to read, since you already have your own class that handles those values. Getting things such as Screen Resolution, or other graphics settings is a bit more complicated.
    I did such a thing to implement a dynamic day and night cycle, that saves the current time of day into the UDKGame.ini file when you terminate the game, and loads it again when you start the map. I also made some kismet nodes to directly get the current time, set it to a different value and to save it.

    Basically what you would have to do is:
    1. Write a class that has access to the values of the .ini file
    2. Write your own SeqAct_* Kismet node, that uses your other class to get the value, and pass this value to one of the output-links
    3. Use your own Kismet node to access those values in Kismet
    4. ??? profit

    If you need more help ask here, I can possibly provide you with a simple example for saving and reading a custom value from an INI file.
    My german game development blog:
    http://blog.2digitalgames.de

  5. #5

  6. #6
    Palace Guard
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    3,940

    Default

    Now if DLLs would be actually included in an UDK installer…
    Our Loop, which art in source code, hallowed be thy keyword.
    Thy condition come, thy instruction be done, in RAM as it is in cache.
    Increment us this day our daily counter,
    and forgive us our typos, as we also have forgiven our compilers.
    And lead us not to the nullpointer but deliver us from bugs.
    For thine is the API, the GUI, and the CLI while(true).
    Semicolon;
    Please don't send me questions about how to do something in the UDK via PM. That is better discussed in the forums and we only have limited PM storage.

  7. #7
    Boomshot

    Join Date
    Feb 2010
    Location
    Portugal
    Posts
    2,162

    Default

    Quote Originally Posted by Crusha K. Rool View Post
    Now if DLLs would be actually included in an UDK installer…
    You mean that when you compile the game that the dlls aren't included in the installation?

  8. #8

    Default

    When you package the game using the Unreal Frontend they are afaik not included. You would have to install the packaged game to a location, put your DLLs inside and repack it using some other tool like Inno Setup
    My german game development blog:
    http://blog.2digitalgames.de

  9. #9
    Boomshot

    Join Date
    Feb 2010
    Location
    Portugal
    Posts
    2,162

    Default

    Quote Originally Posted by Denara View Post
    When you package the game using the Unreal Frontend they are afaik not included. You would have to install the packaged game to a location, put your DLLs inside and repack it using some other tool like Inno Setup
    That sucks o0

  10. #10
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Posts
    140

    Default

    Thanks 100G ... I gather the dll and packaging will cause issues with iOS ?

    Denara if you have a simple example to read and save that would be great !

  11. #11
    Boomshot

    Join Date
    Feb 2010
    Location
    Portugal
    Posts
    2,162

    Default

    Quote Originally Posted by ffow View Post
    Thanks 100G ... I gather the dll and packaging will cause issues with iOS ?

    Denara if you have a simple example to read and save that would be great !
    You better not use the dll...

    Denara's method example:
    Code:
    class MySavingClass extends Object
         config(MySavingFile);
    
    var config int MyCurrentLevel;
    var config string MySavedName;
    
    DefaultProperties
    {
    }
    The 2 variables in that class will be saved to the ini file specified in config.


    To read the value:
    Next you create the kismet node:
    Code:
    class SeqAct_GetMyCurrentLevel extends SequenceAction;
    
    var int Value;
    
    event Activated()
    {
         local MySavingClass MSC;
         
         MSC = new class'MySavingClass';
         Value = MSC.MyCurrentLevel;
    }
    
    DefaultProperties
    {
         ObjName = "Get My Current Level";
         ObjCategory = "MyCategory";
         bCallHandler = false;
         
         VariableLinks(0) = (ExpectedType=class'SeqVar_Int',LinkDesc="Value",PropertyName=Value,bWriteable=true);
    }
    This action node would get the value from the previously created class and pass it onto the linked variable node.
    You'd do the same thing for MySavedName but with ExpectedType being class'SeqVar_String'.


    To write a value:
    Code:
    class SeqAct_SetMyCurrentLevel extends SequenceAction;
    
    var int Value;
    
    event Activated()
    {
         local MySavingClass MSC;
         
         MSC = new class'MySavingClass';
         MSC.MyCurrentLevel = Value;
         MSC.SaveConfig();
    }
    
    DefaultProperties
    {
         ObjName = "Set My Current Level";
         ObjCategory = "MyCategory";
         bCallHandler = false;
         
         VariableLinks(0) = (ExpectedType=class'SeqVar_Int',LinkDesc="Value",PropertyName=Value);
    }

    You could also make nodes to handle all the values instead of a node for each value. I can write an example if you want.
    Last edited by 100GPing100; 06-11-2012 at 10:25 AM. Reason: Finish writing post.

  12. #12
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Posts
    140

    Default

    100G ... thanks alot thats perfect.

    I've got my head around a few things just from that small amount of code.

  13. #13
    Boomshot

    Join Date
    Feb 2010
    Location
    Portugal
    Posts
    2,162

    Default

    Quote Originally Posted by ffow View Post
    100G ... thanks alot thats perfect.

    I've got my head around a few things just from that small amount of code.
    If you need something, we're here to help you.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.