PDA

View Full Version : Configuration Scenes



Bob_Gneu
12-03-2007, 07:33 PM
Has anyone else looked into using the ingame server configuration and getting it to work on your own mutators? I have been tossing around the code but to no avail, im assuming there is an editor in UED, but unf. thats crashing out currently.

I am currently working on this.

Bob_Gneu
12-03-2007, 09:23 PM
Just found this... May be of use to you all

http://www.moddb.com/games/169/unreal-tournament-3/tutorials/24645/unreal-learning-2-ut3-configurable-mutators

agentq_71
12-04-2007, 12:13 AM
That's a great find, thanks! I was just struggling understanding UI Scenes and how they fit together with the code.

SwaTz0rs
12-04-2007, 01:23 AM
great find buddy

Azrael77
12-04-2007, 01:55 AM
Thanks Bob_Gneu!! Great find! :)

kisk
12-04-2007, 06:09 PM
Awesome find! We've been asking about this for weeks now. :D

Bob_Gneu
12-04-2007, 11:42 PM
I am going to start a new thread in a couple days keeping track of important links and tutorials, Maybe ill just edit this thread.

http://www.codekisk.com/unreal/ut3/scriptref/ << UNCodex of UT3 Code-base

sinx
12-05-2007, 07:59 AM
I'm having issues at the moment getting my basic mutator config interface to run properly.

I even tried replicating the tutorial at http://www.moddb.com that Bob_Gneu posted a link to above but that fails in exactly the same manner.

What happens is that when I add the mutator (setting up a match to play) and then configure it, the UI Scene opens but the ButtonBar is not shown and when you hit escape, it goes back to a "blank" scene with just the level camera animation. When I hit escape again it goes back to the Instant Action Menu, briefly skipping the mutator section.

UT3 is opening my UI Scene but it appears as though the UScript Menu UTUIFrontEnd class is not being associated correctly, ie not actually being invoked. I've put logs in my UTUIFrontEnd class SceneActivated() function and it looks like it's not even being run as the logs don't appear. The only thing I can guess that associates the UI package and the UScript is the class name and UIScene Tag. Is there anything else that I'm missing???

I've gone through the moddb tutorial over an over again, including the UT3 Weapon Replacement mutator and I just can't get the UI Scene to work properly.

The UT log file is not giving me any info as to any failings.

I have to say that the whole UI thing was much easier when it was all code (eg 2K4), as you could at least debug your code to see where stuff was failing. Now, I feel like one hand is tied behind my back as I'm relying on stuff that the Editor pops out, which feels slow and klunky to operate. As well, I've had the editor crash on me a few times when trying to past things in the UI editor.

Anyone got any thoughts on my problem?

Bob_Gneu
12-06-2007, 12:12 AM
I would gladly help you out but i have to sort out whats wrong with my install. Once its fixed ill be posting far more often.

sinx
12-06-2007, 01:16 AM
I'd appreciate any help I can get. My mod, as in the past, relies heavily on its UI. I can't even get past first base, so I can't even start properly.

Dark[NSF]
12-06-2007, 11:20 AM
I'd appreciate any help I can get. My mod, as in the past, relies heavily on its UI. I can't even get past first base, so I can't even start properly.

so does my code, can you make test exec functions in the mean time? this worked out for me. except now i have most of my code completed and a bunch of gui to write, a little discouraging :(

sinx
12-06-2007, 11:50 AM
I worked it out. When I did, I then proceeded to bang my head against the desk because of how stupid I'd been. My problem was this: I was not selecting my Custom Scene Class in when creating my Scene in the Editor. It's going to take me a while to get over that stupid mistake :) lol

Bob_Gneu
12-08-2007, 05:40 PM
I too got it working, although im now working towards figuring out datasources. I am trying to get a slider to have the default value show up properly. The tutorial above only shows the value as 0 until you move the slider. I am going to get this rolling and ill let you all know what i had to do.

warlord57
12-08-2007, 09:02 PM
I too got it working, although im now working towards figuring out datasources. I am trying to get a slider to have the default value show up properly. The tutorial above only shows the value as 0 until you move the slider. I am going to get this rolling and ill let you all know what i had to do.

I have figured out the solution to this problem.

here is the snippet of code that I added to make it work properly.

event PostInitialize()
{
Super.PostInitialize();

ComboDmg.UpdateCaption();
CoreMomentum.UpdateCaption();
ComboMomentum.UpdateCaption();
ShockMomentum.UpdateCaption();
}
The UpdateCaption() function was found in the UTUISlider.uc file and I just used it to see if it worked and it did.
for the tutorial it would be PlayerSpeed.UpdateCaption(); and so on.

I am now almost done with a UT3 version of my UT2004 mutator :D

Bob_Gneu
12-12-2007, 03:45 AM
I just used that in my code and it didnt impact the output at all.


//================================================== ===========================
// 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.iMaxNumJu mps;
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.iMaxJumpB oost;
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.iMaxNumJu mps = uiMaxNumJumps.GetValue();
class'JumpMod.UTMutator_JumpMod'.default.iMaxJumpB oost = uiMaxJumpBoost.GetValue();
class'JumpMod.UTMutator_JumpMod'.static.StaticSave Config();

CloseScene(self);

return true;
}

function bool OnButtonBar_Back(UIScreenObject InButton, int InPlayerIndex)
{
CloseScene(self);

return true;
}

warlord57
12-12-2007, 11:13 AM
I just used that in my code and it didnt impact the output at all.


//================================================== ===========================
// 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.iMaxNumJu mps;
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.iMaxJumpB oost;
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.iMaxNumJu mps = uiMaxNumJumps.GetValue();
class'JumpMod.UTMutator_JumpMod'.default.iMaxJumpB oost = uiMaxJumpBoost.GetValue();
class'JumpMod.UTMutator_JumpMod'.static.StaticSave Config();

CloseScene(self);

return true;
}

function bool OnButtonBar_Back(UIScreenObject InButton, int InPlayerIndex)
{
CloseScene(self);

return true;
}

in this section of 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

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.Core Momentum;
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.Comb oMomentum;
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.Shoc kMomentum;
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_Com boOnly'.default.bRapidFire);

bHealthPickups.SetValue(class'MutComboOnly.Mutator _ComboOnly'.default.bHealthPickups);

bArmorPickups.SetValue(class'MutComboOnly.Mutator_ ComboOnly'.default.bArmorPickups);

bPowerupPickups.SetValue(class'MutComboOnly.Mutato r_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.Comb oDmg = ComboDmg.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.Core Momentum = CoreMomentum.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.Comb oMomentum = ComboMomentum.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.Shoc kMomentum = ShockMomentum.GetValue();

class'MutComboOnly.Mutator_ComboOnly'.default.Comb oMomentum = ComboMomentum.GetValue();
class'MutComboOnly.Mutator_ComboOnly'.default.Shoc kMomentum = ShockMomentum.GetValue();

class'MutComboOnly.Mutator_ComboOnly'.default.bIns tagibCombo = bInstagibCombo.IsChecked();
class'MutComboOnly.Mutator_ComboOnly'.default.bRap idFire = bRapidFire.IsChecked();

class'MutComboOnly.Mutator_ComboOnly'.default.bHea lthPickups = bHealthPickups.IsChecked();
class'MutComboOnly.Mutator_ComboOnly'.default.bArm orPickups = bArmorPickups.IsChecked();
class'MutComboOnly.Mutator_ComboOnly'.default.bPow erupPickups = bPowerupPickups.IsChecked();


class'MutComboOnly.Mutator_ComboOnly'.static.Stati cSaveConfig();

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;
}

Bob_Gneu
12-12-2007, 12:42 PM
That was a typo, sorry about that, I must not have saved properly.

I sorted it out though.

The reason it doesnt update is b/c i didnt call UpdateCaption() immediately after initialization of the values. You dont need the PostInitialize() function at all.

My next question is about the nudge value. Is that supposed to be bound to the slider as i drag? I have changed the nudge value to 20 and its not dragging at 20 point intervals; its still dragging at single points. Any thoughts?

Here is my working UIScene 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 transient UTUISlider uiMaxNumJumps;
var transient UTUISlider uiMaxJumpBoost;

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

if (bInitialActivation)
{
uiMaxNumJumps = UTUISlider (FindChild('sliJumps', true));
uiMaxJumpBoost = UTUISlider (FindChild('sliBoost', true));

uiMaxNumJumps.SliderValue.CurrentValue = class'JumpMod.UTMutator_JumpMod'.default.iMaxNumJu mps;
uiMaxNumJumps.SliderValue.MinValue = 0;
uiMaxNumJumps.SliderValue.MaxValue = 50;
uiMaxNumJumps.SliderValue.NudgeValue = 1;
uiMaxNumJumps.SliderValue.bIntRange = true;
uiMaxNumJumps.UpdateCaption();

uiMaxJumpBoost.SliderValue.CurrentValue = class'JumpMod.UTMutator_JumpMod'.default.iMaxJumpB oost;
uiMaxJumpBoost.SliderValue.MaxValue = 20;
uiMaxJumpBoost.SliderValue.MaxValue = 400;
uiMaxJumpBoost.SliderValue.NudgeValue = 20;
uiMaxJumpBoost.SliderValue.bIntRange = true;
uiMaxJumpBoost.UpdateCaption();
}
}

/** 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);
}

function bool OnButtonBar_Accept(UIScreenObject InButton, int InPlayerIndex)
{
class'JumpMod.UTMutator_JumpMod'.default.iMaxNumJu mps = uiMaxNumJumps.GetValue();
class'JumpMod.UTMutator_JumpMod'.default.iMaxJumpB oost = uiMaxJumpBoost.GetValue();
class'JumpMod.UTMutator_JumpMod'.static.StaticSave Config();

CloseScene(self);

return true;
}

function bool OnButtonBar_Back(UIScreenObject InButton, int InPlayerIndex)
{
CloseScene(self);

return true;
}

warlord57
12-12-2007, 04:00 PM
My next question is about the nudge value. Is that supposed to be bound to the slider as i drag? I have changed the nudge value to 20 and its not dragging at 20 point intervals; its still dragging at single points. Any thoughts?

Nudge Value is when you use left or right arrow keys. A and D keys may also work since they are considered left and right also.

Nice you found out that I don't need PostInitialize for updating the caption.

Bob_Gneu
12-12-2007, 04:02 PM
=) You are quite welcome.

I am actually kind of irritated by the lack of being able to make it click by 20 points. there isnt any noticable difference between the jump mutators amplification at such a fine grained level so it looks weird.

agentq_71
12-12-2007, 04:46 PM
=) You are quite welcome.

I am actually kind of irritated by the lack of being able to make it click by 20 points. there isnt any noticable difference between the jump mutators amplification at such a fine grained level so it looks weird.

I also found it odd that the nudge value only applied to keystrokes and not clicking/dragging.

One idea is that you can make the slider a scale rather than the raw value. So say you want the raw value to be 1-100, you could make the UI slider 1-5 and then multiply by 20 to get the actual data value..

Bob_Gneu
12-12-2007, 05:17 PM
Yes, that is correct but it was just much easier to let the user manipulate raw data. I think ill implement your idea in order to simplify things. Good suggestion!

ambershee
12-13-2007, 08:26 AM
Just read through the thread - great find guys. I'll make sure to update my tutorial accordingly :)

peterfaj
01-06-2008, 07:22 AM
I followed this tutorial: http://www.moddb.com/tutorials/24645/unreal-learning-2-ut3-configurable-mutators
and I've got a problem. The button bar does not appear. Well, it does appear, but just a small button on the right with no text.

Bob_Gneu
01-06-2008, 02:08 PM
I would suggest you start again, The buttonbar is pretty finicky but it does work as he described. If you get into a bind open up my package or one of the ones that comes with UT3.

talon84
01-15-2008, 05:31 PM
I have tried and tried several times but now I'm at my wits end.:mad::mad::mad: How the hell do you get the buttons to show up in the UI mutator menu? All I've gotton is that they are slightly offscreen so I can not press them. The sliders work just find. I've even tried copying the buttons from someone's else's mod but still it does not work. So how do I get the dam buttons to work? Also in the UTEditor, how do you change the size and position of buttons contained in a button bar?

Drimiad
01-15-2008, 06:27 PM
I have had the problem where pasting into a scene doesn't preserve the correct placement. So in the editor you will have to adjust the button location, or just delete it and place a new button bar.

Once you've got a button bar you should be able to move the individual buttons by selecting the widgets from the hierarchical list in the bottom right corner. Expand the button bar, select a button, then move it in the main view. I found this rather tedious, though. Deleting the button bar and adding a new button bar will place the buttons and button bar automatically, and place it better than pasting it from somewhere else seemed to.

Good luck! :)

talon84
01-15-2008, 07:14 PM
Well now the buttons are snapping in one position and can only be manipulated in the y direction. I cannot scale or move any of the buttons in the x directions. Is there a locking function hidden in the buttons or bar that I've not seen yet?

Drimiad
01-15-2008, 08:11 PM
Yep. The left,right,top,bottom can be "locked" to another part of the interface. This is supposed to help you line stuff up better, though I've found it a bit frustrating. The dots that have Xs through them are locked to something else. You can right click on the locked dots and choose to break those links.

Note: I tried to make a vertical button bar by moving the buttons around, but this did not work. I think something is hardcoded to expect the buttons to be lined up horizontally.

Bob_Gneu
01-15-2008, 09:38 PM
I would highly suggest you guys dont tweak the bar at the bottom much. I too had issues with it, but if you consult the other scenes you will see that they are all pretty standardized. Changing the locations of buttons and so forth is only going to become disorienting and confusing to users of your mutator. Everyone in the community is keeping their buttons in the proper locations in order to help keep things standardized.

ambershee
01-16-2008, 04:58 AM
It depends what you use it for. I wrote a vertical button bar (although admittedly for a TC UI), and it works quite nicely :)

talon84
01-16-2008, 06:28 PM
I've tried recreating the button bar and keeping the default positions, scales, etc, but I still see only the slight edge of a button in the bottom right hand corner of my screen. Here's a screenshot of what my mutator looks like when I try to configure it.
http://img.photobucket.com/albums/v280/talon84/Buttonless_UI.jpg

Bob_Gneu
01-16-2008, 08:08 PM
I had this issue once. I solved it by restarting and looking at the other scenes. Take a look at mine and check for differences. My package is based off the other two scenes (weapon replacement and... i dont remember) it is available with either of my mutator releases (jump mod or speed mod)

talon84
01-17-2008, 10:06 AM
I had this issue once. I solved it by restarting and looking at the other scenes. Take a look at mine and check for differences. My package is based off the other two scenes (weapon replacement and... i dont remember) it is available with either of my mutator releases (jump mod or speed mod)

Thats what I thought I might have to do. Thanks for the advice.

pingfreak
03-01-2008, 03:17 AM
I also found it odd that the nudge value only applied to keystrokes and not clicking/dragging.

One idea is that you can make the slider a scale rather than the raw value. So say you want the raw value to be 1-100, you could make the UI slider 1-5 and then multiply by 20 to get the actual data value..


How do you go about doing this in code? I'm trying to get adjustments in 0.01 numbers

EDIT: bIntRange = false; is one way but slider only displays intergers 1,2,3 ect..
I'm using a numeric option list now seems to work better.

Bob_Gneu
03-01-2008, 03:01 PM
Do you mean, how do you edit the slider to be float and nudge by .01? You can, and probably should still take his suggestion and use the slider to adjust scale against a value of your own choosing. the sliders are not the most fun item in the UI inventory.

PercocetPenguin
08-09-2008, 04:12 PM
Hello all,
I'm just entering into the world of Unreal Scripting, and I can't seem to figure out what I'm doing wrong here.

I've been following the Tutorial posted earlier to try and make a Mutator with a config screen; but, I'm having a series of problems.
1) My config menu sliders default to 0.
2) When I adjust my sliders the values are not saved into my mutator's config file.
3) My config screen is not scaling to my screen size at all. It ends up just being in the top left corner of my screen.

Here is my config screen source:

class UTUIFrontEnd_PlayerTweakMenu extends UTUIFrontEnd;
var transient UTUISlider PlayerSpeed;
var transient UTUISlider PlayerJumpHeight;
var transient UTUISlider PlayerStartHealth;
var transient UTUISlider PlayerMaxHealth;



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

if(bInitialActivation)
{
PlayerSpeed=UTUISlider(FindChild('sliSpeed',true)) ;
PlayerJumpHeight=UTUISlider(FindChild('sliJumpHeig ht',true));
PlayerStartHealth=UTUISlider(FindChild('sliStartHe alth',true));
PlayerMaxHealth=UTUISlider(FindChild('sliMaxHealth ',true));

PlayerSpeed.SliderValue.CurrentValue=100.f;
PlayerSpeed.SliderValue.MinValue=25.f;
PlayerSpeed.SliderValue.MaxValue=400.f;
PlayerSpeed.SliderValue.NudgeValue=25.f;
PlayerSpeed.SliderValue.bIntRange=true;
PlayerSpeed.UpdateCaption();

PlayerJumpHeight.SliderValue.CurrentValue=100.f;
PlayerJumpHeight.SliderValue.MinValue=0.f;
PlayerJumpHeight.SliderValue.MaxValue=400.f;
PlayerJumpHeight.SliderValue.NudgeValue=25.f;
PlayerJumpHeight.SliderValue.bIntRange=true;
PlayerJumpHeight.UpdateCaption();

PlayerStartHealth.SliderValue.CurrentValue=100;
PlayerStartHealth.SliderValue.MinValue=25;
PlayerStartHealth.SliderValue.MaxValue=250;
PlayerStartHealth.SliderValue.NudgeValue=25;
PlayerStartHealth.SliderValue.bIntRange=true;
PlayerStartHealth.UpdateCaption();

PlayerMaxHealth.SliderValue.CurrentValue=199;
PlayerMaxHealth.SliderValue.MinValue=25;
PlayerMaxHealth.SliderValue.MaxValue=1000;
PlayerMaxHealth.SliderValue.NudgeValue=25;
PlayerMaxHealth.SliderValue.bIntRange=true;
PlayerMaxHealth.UpdateCaption();
}}

event PostInitialize()
{
super.PostInitialize();
PlayerSpeed.UpdateCaption();
PlayerJumpHeight.UpdateCaption();
PlayerStartHealth.UpdateCaption();
PlayerMaxHealth.UpdateCaption();
}



function SetupButtonBar()
{
ButtonBar.AppendButton("Apply",OnButtonBar_Back);
}
function bool OnButtonBar_Back(UIScreenObject InButton,int InPlayerIndex)
{
class'PlayerTweak.PlayerTweakMutator'.default.Spee d=PlayerSpeed.GetValue();
class'PlayerTweak.PlayerTweakMutator'.default.Jump Height=PlayerJumpHeight.GetValue();
class'PlayerTweak.PlayerTweakMutator'.default.Star tHealth=PlayerStartHealth.GetValue();
class'PlayerTweak.PlayerTweakMutator'.default.MaxH ealth=PlayerMaxHealth.GetValue();
class'PlayerTweak.PlayerTweakMutator'.static.Stati cSaveConfig();
CloseScene(self);
return true;
}


DefaultProperties
{
}

And here is the source for the Mutator:

class PlayerTweakMutator extends UTMutator
config(PlayerTweak);

var config float Speed;
var config float JumpHeight;
var config int StartHealth;
var config int MaxHealth;

function ModifyPlayer(Pawn Other)
{
Other.GroundSPeed*=(Speed/100);
Other.JumpZ*=(JumpHeight/100);
Other.Health=StartHealth;
Other.HealthMax=MaxHealth;
Super.ModifyPlayer(Other);
}



DefaultProperties
{
}

Thank you for any help that you can provide.

Jaguar343
10-17-2008, 06:06 PM
Please read the thread as your first query has been answered.

However i am having the same problem with the background not scaling properly. I assume this is to do with a mistake in the SafeRegion widget. Could someone get back to me with an answer?

Thanks, Jaguar

Lokken
10-20-2008, 11:31 AM
Please read the thread as your first query has been answered.

However i am having the same problem with the background not scaling properly. I assume this is to do with a mistake in the SafeRegion widget. Could someone get back to me with an answer?

Thanks, Jaguar


I am having an issue with this too.

I completed this tutorial without too much hassel. I noticed that my default values entered in the config files were present on my sliders when i loaded the screen up the first time, and they were saved to the config file when i checked it after exiting UT3.

Odd thing though was after i left the UI screen with my changes in tact and went back in, my custom entries were not there any more. However if i loaded the game they would take effect.

Maybe I just need to write a function that applies the settings entered to the config file and add an accept button instead of just a back button?

TKBS
07-07-2012, 03:31 PM
UI_Scenes and configurable mutators
-after 5 years this is the only post regarding UI Scenes.:(
- Surely i am missing some threads right?

- Can anyone please point me to someone who has experience with UI_Scenes and configurable mutators.

- I have the code done; the ui scene done; but the "configure mutator" menu 'In-game' has no effect
mutator contains this ...


var config bool SpawnWithLightningGun;

UI_code contains this


var transient UTUICollectionCheckBox SpawnWithLightningGun;

is it possible to have this..

.
var transient bool....
?
- i followed all tutorials read all known work on the subject; and made a comparison to a 'similar mutator', but the Button still has no effect true or false ?!!!
- I will be happy to provide all source and files if someone can help me .


Note:this thread
http://forums.epicgames.com/threads/747838-Transient-variable
- explains how a transient variable is not saved; and reverts to its default state
- i use a transient to select my bool.. could this be the problem ?


Advanced. Declares that the variable is for temporary use, and isn't part of the object's persistent state. Transient variables are not saved to disk. Transient variables are initialized to the class's default value for that variable when an object is loaded.

- Lol [do i really think i will get a reply for this??// ah well, worth a shot]