Hmm, thanks! That's really the issue. Yes, that's UScript 2, 2004 build, but a function like that should be in v1 just as well. And you're all a lot more active than the UScript v2 community
Hmm, now I'm trying to make a GUI drop-down box, and everything works, just that somehow it doesn't like reading variables correctly...
So I've added this line at the top:
Means that the String WMakerOpt is configureable. Is it OK to use strings for drop-down lists?
Now after that I've added this line, it's UT2004 specific:
Code: Select all
PlayInfo.AddSetting(default.RulesGroup, "WMakerOpt", default.GUIDisplayText[5], 0, 6, "Select", "V_BOTH;Both;V_SNIPER;Classic Sniper Rifle;V_LIGHTNING;Lightning Gun;V_NONE;None");
The things after "Select" means: before the first ";" means what property should the string WMakerOpt get, and after it, what the drop-down list will add to the selection, i.e. text. That goes in pairs.
So now, I use these lines to determine what was selected:
Code: Select all
if ( ( (MutXMPWeaps(Other).WMakerOpt) ~= ("V_BOTH") ) || ( (MutXMPWeaps(Other).WMakerOpt) ~= ("V_LIGHTNING") )){ //Lightning to WMaker
if ( string( xWeaponBase(Other).WeaponType ) ~= "XWeapons.SniperRifle" )
{
xWeaponBase(Other).WeaponType = class'XMPWeapons.XMPSniperRifle';
return false;
}
}
if ( ((MutXMPWeaps(Other).WMakerOpt) == ("V_BOTH")) || ((MutXMPWeaps(Other).WMakerOpt) == ("V_SNIPER"))){ //CSniper to WMaker
if ( string( xWeaponBase(Other).WeaponType ) ~= "UTClassic.ClassicSniperRifle" )
{
xWeaponBase(Other).WeaponType = class'XMPWeapons.XMPSniperRifle';
return false;
}
}
You can see that the first line has a ~= symbol, and the second IF has the == symbol. Strangely enough, whatever I select, the IF statement with ~= will always get to TRUE, and the one with == will always get to FALSE. How come? How to make it so it only does the code if the value of WMakerOpt is V_BOTH, V_SNIPER or V_LIGHTNING?