
Originally Posted by
Bob_Gneu
I just used that in my code and it didnt impact the output at all.
Code:
//=============================================================================
// JumpMod
//
// This mutator allows a server to configure the abilities for players to jump
// around as well as how much boost they receive with each jump.
//=============================================================================
class UTUIFrontEnd_JumpMod extends UTUIFrontEnd;
var UTUISlider uiMaxNumJumps;
var UTUISlider uiMaxJumpBoost;
event SceneActivated(bool bInitialActivation)
{
Super.SceneActivated(bInitialActivation);
if (bInitialActivation)
{
uiMaxNumJumps = UTUISlider (FindChild('sliJumps', true));
uiMaxJumpBoost = UTUISlider (FindChild('sliBoost', true));
// uiMaxNumJumps.SetDataStoreBinding("5");
uiMaxNumJumps.SliderValue.CurrentValue = class'JumpMod.UTMutator_JumpMod'.default.iMaxNumJumps;
uiMaxNumJumps.SliderValue.MinValue = 0.0f;
uiMaxNumJumps.SliderValue.MaxValue = 50.0f;
uiMaxNumJumps.SliderValue.NudgeValue = 1.0f;
uiMaxNumJumps.SliderValue.bIntRange = true;
// uiMaxJumpBoost.SetDataStoreBinding("50");
uiMaxJumpBoost.SliderValue.CurrentValue = class'JumpMod.UTMutator_JumpMod'.default.iMaxJumpBoost;
uiMaxJumpBoost.SliderValue.MaxValue = 0.0f;
uiMaxJumpBoost.SliderValue.MaxValue = 400.0f;
uiMaxJumpBoost.SliderValue.NudgeValue = 1.0f;
uiMaxJumpBoost.SliderValue.bIntRange = true;
}
}
/** Sets up the scene's button bar. */
function SetupButtonBar()
{
ButtonBar.Clear();
ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Back>", OnButtonBar_Back);
ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Accept>", OnButtonBar_Accept);
}
event PostInitialize()
{
Super.PostInitialize();
uiMaxJumpBoost.UpdateCaption();
uiMaxJumpBoost.UpdateCaption();
}
function bool OnButtonBar_Accept(UIScreenObject InButton, int InPlayerIndex)
{
class'JumpMod.UTMutator_JumpMod'.default.iMaxNumJumps = uiMaxNumJumps.GetValue();
class'JumpMod.UTMutator_JumpMod'.default.iMaxJumpBoost = uiMaxJumpBoost.GetValue();
class'JumpMod.UTMutator_JumpMod'.static.StaticSaveConfig();
CloseScene(self);
return true;
}
function bool OnButtonBar_Back(UIScreenObject InButton, int InPlayerIndex)
{
CloseScene(self);
return true;
}
in this section of code
Code:
event PostInitialize()
{
Super.PostInitialize();
uiMaxJumpBoost.UpdateCaption();
uiMaxJumpBoost.UpdateCaption();
}
uiMaxJumpBoost is listed twice, is there a reason 1 of them is not uiMaxNumJumps? I am not sure why it doesn't work since it looks the same as my code.
2 things different though the UTUISlider variables needs to be set as transient (just like how they did it in the tutorial). Also when looking at the Configuration Scene for the weapon replacement mutator I noticed the scene was depending on the mutator class. Maybe if you change those in your code it may work.
Here is the code for my Configuration Scene
Code:
class UTUIFrontEnd_ComboShockMenu extends UTUIFrontEnd
dependson(Mutator_ComboOnly);
var transient UTUISlider ComboDmg;
var transient UTUISlider CoreMomentum;
var transient UTUISlider ComboMomentum;
var transient UTUISlider ShockMomentum;
var transient UTUICollectionCheckBox bInstagibCombo;
var transient UTUICollectionCheckBox bRapidFire;
var transient UTUICollectionCheckBox bHealthPickups;
var transient UTUICollectionCheckBox bArmorPickups;
var transient UTUICollectionCheckBox bPowerupPickups;
event PostInitialize()
{
Super.PostInitialize();
ComboDmg.UpdateCaption();
CoreMomentum.UpdateCaption();
ComboMomentum.UpdateCaption();
ShockMomentum.UpdateCaption();
}
/** Actiated event for the scene. */
event SceneActivated(bool bInitialActivation)
{
Super.SceneActivated(bInitialActivation);
ComboDmg = UTUISlider(FindChild('sliComboDmg', true));
CoreMomentum = UTUISlider(FindChild('sliCoreMomentum', true));
ComboMomentum = UTUISlider(FindChild('sliComboMomentum', true));
ShockMomentum = UTUISlider(FindChild('sliShockMomentum', true));
bInstagibCombo = UTUICollectionCheckBox (FindChild('cbInstagib', true));
bRapidFire = UTUICollectionCheckBox (FindChild('cbRapidFire', true));
bHealthPickups = UTUICollectionCheckBox (FindChild('cbHealthPickups', true));
bArmorPickups = UTUICollectionCheckBox (FindChild('cbArmorPickups', true));
bPowerupPickups = UTUICollectionCheckBox (FindChild('cbPowerupPickups', true));
ComboDmg.SliderValue.CurrentValue = class'Mutator_ComboOnly'.default.ComboDmg;
ComboDmg.SliderValue.MinValue = 25;
ComboDmg.SliderValue.MaxValue = 250;
ComboDmg.SliderValue.NudgeValue = 5;
ComboDmg.SliderValue.bIntRange = true;
ComboDmg.UpdateCaption();
CoreMomentum.SliderValue.CurrentValue = class'MutComboOnly.Mutator_ComboOnly'.default.CoreMomentum;
CoreMomentum.SliderValue.MinValue = 10000;
CoreMomentum.SliderValue.MaxValue = 300000;
CoreMomentum.SliderValue.NudgeValue = 500;
CoreMomentum.SliderValue.bIntRange = true;
CoreMomentum.UpdateCaption();
ComboMomentum.SliderValue.CurrentValue = class'MutComboOnly.Mutator_ComboOnly'.default.ComboMomentum;
ComboMomentum.SliderValue.MinValue = 100000;
ComboMomentum.SliderValue.MaxValue = 500000;
ComboMomentum.SliderValue.NudgeValue = 1000;
ComboMomentum.SliderValue.bIntRange = true;
ComboMomentum.UpdateCaption();
ShockMomentum.SliderValue.CurrentValue = class'MutComboOnly.Mutator_ComboOnly'.default.ShockMomentum;
ShockMomentum.SliderValue.MinValue = 5000;
ShockMomentum.SliderValue.MaxValue = 250000;
ShockMomentum.SliderValue.NudgeValue = 250;
ShockMomentum.SliderValue.bIntRange = true;
ShockMomentum.UpdateCaption();
bInstagibCombo.SetValue(class'MutComboOnly.Mutator_ComboOnly'.default.bInstagibCombo);
bRapidFire.SetValue(class'MutComboOnly.Mutator_ComboOnly'.default.bRapidFire);
bHealthPickups.SetValue(class'MutComboOnly.Mutator_ComboOnly'.default.bHealthPickups);
bArmorPickups.SetValue(class'MutComboOnly.Mutator_ComboOnly'.default.bArmorPickups);
bPowerupPickups.SetValue(class'MutComboOnly.Mutator_ComboOnly'.default.bPowerupPickups);
}
/** Sets up the scene's button bar. */
function SetupButtonBar()
{
ButtonBar.Clear();
ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Back>", OnButtonBar_Back);
ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Accept>", OnButtonBar_Accept);
}
/** Callback for when the user wants to back out of this screen. */
function OnBack()
{
CloseScene(self);
}
/** Callback for when the user accepts the changes. */
function OnAccept()
{
class'MutComboOnly.Mutator_ComboOnly'.default.ComboDmg = ComboDmg.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.CoreMomentum = CoreMomentum.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.ComboMomentum = ComboMomentum.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.ShockMomentum = ShockMomentum.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.ComboMomentum = ComboMomentum.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.ShockMomentum = ShockMomentum.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.bInstagibCombo = bInstagibCombo.IsChecked();
class'MutComboOnly.Mutator_ComboOnly'.default.bRapidFire = bRapidFire.IsChecked();
class'MutComboOnly.Mutator_ComboOnly'.default.bHealthPickups = bHealthPickups.IsChecked();
class'MutComboOnly.Mutator_ComboOnly'.default.bArmorPickups = bArmorPickups.IsChecked();
class'MutComboOnly.Mutator_ComboOnly'.default.bPowerupPickups = bPowerupPickups.IsChecked();
class'MutComboOnly.Mutator_ComboOnly'.static.StaticSaveConfig();
CloseScene(self);
}
/** Buttonbar Callbacks. */
function bool OnButtonBar_Back(UIScreenObject InButton, int InPlayerIndex)
{
OnBack();
return true;
}
function bool OnButtonBar_Accept(UIScreenObject InButton, int InPlayerIndex)
{
OnAccept();
return true;
}
Bookmarks