• Register

This member has provided no bio about themself...

Comment History
xmai
xmai - - 2 comments @ Unreal Learning #2: UT3 Configurable Mutators

This comment has two parts:

SECOND PART

// a part where we read values from our configuration file
PlayerSpeed.SliderValue.CurrentValue = class'PlayerTweak. PlayerTweakMutator'.default.Speed;
PlayerJumpHeight.SliderValue.CurrentValue = class'PlayerTweak. PlayerTweakMutator'.default.JumpHeight;
PlayerStartHealth.SliderValue.CurrentValue = class'PlayerTweak. PlayerTweakMutator'.default.StartHealth;
PlayerMaxHealth.SliderValue.CurrentValue = class'PlayerTweak. PlayerTweakMutator'.default.MaxHealth;

}
}

function SetupButtonBar()
{
ButtonBar.AppendButton( "<Strings:UTGameUI.ButtonCallouts.Back>", OnButtonBar_Back);
}

function bool OnButtonBar_Back(UIScreenObject InButton, int InPlayerIndex)
{
class'PlayerTweak. PlayerTweakMutator'.default.Speed = PlayerSpeed.GetValue();
... like in Ambershee code
}

DefaultProperties
{
}

(Ignore all spaces which I did after some dots after "PlayerTweak." word. Don't do them in your code.)

Basically we just have to load saved values from the configuration file - they are not loaded by the engine itself (I think I am right here but who knows). Also it would be better if after compilation of your code you set the starting default values in your configuration file yourself so they would appear when you first run the game (Configuration file == UTPlayerTweak.ini if somebody has already forgot).
It should work, hopefully :)
Great tutorials Ambershee

Good karma+2 votes
xmai
xmai - - 2 comments @ Unreal Learning #2: UT3 Configurable Mutators

This comment has two parts:
FIRST PART:

Make sure your files look like this to be able to save/load default values to/from the configuration file.

For PlayerTweakMutator.uc

class PlayerTweakMutator extends UTMutator config(PlayerTweak);

the rest exactly like in Ambershee code

For UTUIFrontEnd_PlayerTweakMenu.uc

class UTUIFrontEnd_PlayerTweakMenu extends UTUIFrontEnd;

var transient ... like in Ambershee code

event SceneActivated(bool bInitialActivation)
{
Super.SceneActivated(bInitialActivation);

if (bInitialActivation)
{
PlayerSpeed = ... like in Ambershee code

//PlayerSpeed.SliderValue.CurrentValue = 100.f;
PlayerSpeed.SliderValue.MinValue ... like in Ambershee code

//PlayerJumpHeight.SliderValue.CurrentValue = 100.f;
PlayerJumpHeight.SliderValue.MinValue ... like in Ambershee code

//PlayerStartHealth.SliderValue.CurrentValue = 100;
PlayerStartHealth.SliderValue.MinValue ... like in Ambershee code

//PlayerMaxHealth.SliderValue.CurrentValue = 199;
PlayerMaxHealth.SliderValue.MinValue ... like in Ambershee code

END OF FIRST PART

Good karma+2 votes