In looking through various *.uc files from UT, I notice that some variable declarations use "var " and some "var()" sometimes in the very same *. uc file so it doesn't seem like it is merely a stylistic difference between the two. So, what is the difference between "var()" and simply "var"?
On a related note, what is the difference between "config" and "globalconfig" when used in a variable declaration, e.g. "var() globalconfig int MinPlayers;" versus "var() config int MinPlayers;"?
For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com
Differences in variable declarations?
-
JD
- OldUnreal Member
- Posts: 23
- Joined: Wed Dec 26, 2007 4:48 pm
Differences in variable declarations?
Last edited by JD on Thu Jan 17, 2008 4:09 am, edited 1 time in total.
-
fxsr789
Re: Differences in variable declarations?
var() means it will be configurable through the main Class rather than None, if a var is not declared as var() you cant edit the "Default Properties" unless you rebuild the script using .UCC.
For example, var bool bSomething will show up under "None" when you EditActor Class=WhateverYouCalledTheClass
But if you declare it as var() it will show up in Default Properties under the category with the same name as the class, putting a name inside the () puts it under a different category or under a existing one, like var(Sounds) sound SomeSounds[5]; var(Display) bool bStupidLooking, etc ,etc.
However, None can be accessed through the EditActor command while in-game, and still be dynamically set.
I'm guessing GlobalConfig means the configurable settings are saved in your main Unreal.INI file rather than it's own .INI file. I'm not sure.
- Fenix
For example, var bool bSomething will show up under "None" when you EditActor Class=WhateverYouCalledTheClass
But if you declare it as var() it will show up in Default Properties under the category with the same name as the class, putting a name inside the () puts it under a different category or under a existing one, like var(Sounds) sound SomeSounds[5]; var(Display) bool bStupidLooking, etc ,etc.
However, None can be accessed through the EditActor command while in-game, and still be dynamically set.
I'm guessing GlobalConfig means the configurable settings are saved in your main Unreal.INI file rather than it's own .INI file. I'm not sure.
- Fenix
-
Raven
- OldUnreal Member
- Posts: 311
- Joined: Fri Jun 10, 2005 5:10 am
Re: Differences in variable declarations?
quote from UDN
config
This variable will be made configurable. The current value can be saved to the ini file and will be loaded when created. Cannot be given a value in default properties. Implies const.
globalconfig
Works just like config except that you can't override it in a subclass. Cannot be given a value in default properties. Implies const.

-
JD
- OldUnreal Member
- Posts: 23
- Joined: Wed Dec 26, 2007 4:48 pm
Re: Differences in variable declarations?
If that is from UDN, is that only applicable to UT2004 and/or UT3 since UDN doesn't appear to have Unreal Engine 1 information in it any more? I ask because after reading Fenix's post, I used declarations like "var() config bool bSetting" and then placed "bSetting=" in the "defaultproperties" of my mod's *.uc files, and the variables declared that way did show up as saved, configurable settings in UnrealTournament.ini under my [mod's package.object] heading with the values I specified in default properties.quote from UDN
config
This variable will be made configurable. The current value can be saved to the ini file and will be loaded when created. Cannot be given a value in default properties. Implies const.
-
TCP_Wolf
- Administrator
- Posts: 1078
- Joined: Sun Mar 03, 2002 12:04 pm
Re: Differences in variable declarations?
To put that last one in simpler words:
globalconfig is saved ONCE in the ini and then affects all objects of that class it was declared in and all subclasses thereof. For example player controls would be globalconfig in PlayerPawn, because you will want the same controls no matter if you play as Male2 or Female1 or whatever, whereas CONFIG would save an individual value for Male1,2,3,Female1,2,Skaarj...
globalconfig is saved ONCE in the ini and then affects all objects of that class it was declared in and all subclasses thereof. For example player controls would be globalconfig in PlayerPawn, because you will want the same controls no matter if you play as Male2 or Female1 or whatever, whereas CONFIG would save an individual value for Male1,2,3,Female1,2,Skaarj...
-=]HONESTY PAYS[=-
-
Raven
- OldUnreal Member
- Posts: 311
- Joined: Fri Jun 10, 2005 5:10 am
Re: Differences in variable declarations?
Most of this docs at UDN does apply to UT2004/UT3. But you have to remember, that default variables/specifiers doesn't change their functions since UE1. That's why those basic specifiers does apply to UE1 alsoIf that is from UDN, is that only applicable to UT2004 and/or UT3 since UDN doesn't appear to have Unreal Engine 1 information in it any more? I ask because after reading Fenix's post, I used declarations like "var() config bool bSetting" and then placed "bSetting=" in the "defaultproperties" of my mod's *.uc files, and the variables declared that way did show up as saved, configurable settings in UnrealTournament.ini under my [mod's package.object] heading with the values I specified in default properties.

-
.:..:
- OldUnreal Member
- Posts: 1637
- Joined: Tue Aug 16, 2005 4:35 am
Re: Differences in variable declarations?
Well thats some stupid thing they added on UT3 (but was changed on UT3 patch), that you can't define config/localized variables on defaultproperties.quote from UDN
config
This variable will be made configurable. The current value can be saved to the ini file and will be loaded when created. Cannot be given a value in default properties. Implies const.
globalconfig
Works just like config except that you can't override it in a subclass. Cannot be given a value in default properties. Implies const.
(ಠ_ಠ)1823223D2A33224B0 wrote:...and now im stuck trying to fix everything you broke for the next 227 release xD