Download

Getting Variable Data From External File?

Hey everyone, I have a people that requested different times for the growing, hatching and levels in my mod. People that play singleplayer or play on a non 24/7 server want shorter growing times and people on a 24/7 server want longer growing times. People also want to set a custom spawn level for the dinos. Is there a way to have a mod configuration file where they can put their own custom values in? Thanks!

Hey, i did this with my xp buff mod. You can specify custom config blocks that users can put in the gameusersettings.ini:

05ce806a4a9f9a03fc4a646ae6b08f6e2dc9c4bd.png

The part that goes in the GameUserSettings.ini would look like this:

[XPBuffSettings]
XPBuffMultiplier=5
XPBuffMaxXP=4350

That’s awesome I’ll test it out! Under what blueprint does the code go?

I think that depends how you want to use it. This is from my custom buff blueprint on the begin play event.

Ok. I will test it out. Thanks!

Ok so I have the blueprint set up to read the data from the ini file:

INIHelp-X3.jpg

This is in the dino blueprint where I want the data to go but for some reason it’s not reading it? Do you have to manually type that information in the ini file or is it generated for you with default values?

Thanks, sorry for being such a noob!

As long as you set the standard value (I can’t remember at this time and my ADK is not open) it should maintain itself, but you can inform those downloading your mod that the value can be customized, and just lay out how they would do that in their .ini

I think you need to cast it to shootergamemode to work.
For the variables in gameusersettings.ini, you would need type them manually or else it returns 0. I just set my variables to some default values in the blueprint if reading the ini returns 0.
I think there are “Set INI Option” nodes too, but i haven’t tried them maybe they would create the missing ini settings.

Thanks guys all I had to do was cast it to the shootergamemode and that fixed it.

Would it be possible to get a HOWTO guide written for this?

I’m getting people asking me “Can I make xxx dino tame-able”… and being able to give server + command line options to:

a) Pull the settings from both gameusersettings.ini and command line
b) Apply the variable to another blueprint (in this case, set “Is Tameable” to [value])
c) Have this all happen on start-up

… would be incredibly useful.

I don’t have the editor open… but I presume the above graph is…

… done in TestGameMode blueprint?
… there is a node prior to Switch has Authority?
… the Set is cast to the Rex_Character_BP (in my example)?

Hey Jason I just wrote up a little tutorial how to do it. https://forums.unrealengine.com/showthread.php?82834-HOWTO-Get-Variable-Data-From-an-Initiation-File

Hey Jason, I think all your presumptions are right. Also for the command line options, take a look at the “Init Option” nodes. Haven’t tried them but i think they take command line as well as .ini options.