Announcement

Collapse
No announcement yet.

AS>US errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Ive got my Options menu set-up exactly the same as these posts except my menu is runned by poping views (used the simplified version of UDKFrontEnd) does this still apply? Because every time I try set resolution it sets case(0) :S maybe "_root.options" is the problem?

    Leave a comment:


  • replied
    Ah, something so simple.
    Thanks Matt, you've been a great help!

    Leave a comment:


  • replied
    I believe your problem is that the options variable only exists on frame 10. It should exist on all frames. It should be put on frame 1, at that keyframe, and no subsequent frames should remove it. Like so:

    Leave a comment:


  • replied
    Ok, thanks Matt, I'll send it to you in a private message if that's ok.

    Leave a comment:


  • replied
    Could be in how your code/Flash is set up. I'd need to see it all to know for sure. If you want to put your Flash file somewhere that I can get it, I'll give it a look.

    Leave a comment:


  • replied
    I found the overall problem.
    When I put the option stepper on frame 1 it will work correctly and change the resolution as it should.
    But when I put the option stepper on frame 2 onwards it won't work. Does anyone have any ideas why this could be?

    Leave a comment:


  • replied
    Thanks Matt,

    Your suggestion did work after I tested it in a new scene but will not work in my original menu scene so that must be the problem.

    Thanks for your solution man, it's much appreciated!

    Jon

    Leave a comment:


  • replied
    Bump.
    Anyones help on this would be much appreciated

    Leave a comment:


  • replied
    Ok, I've tried this and unfortunately its had no affect. The same thing is still happening.

    I'm really confused about this, any ideas?

    Leave a comment:


  • replied
    Maybe try something like this:

    Code:
    var GFxClikWidget MyResolutionOption;
    
    function OnResolutionChange(GFxClikWidget.EventData ev)
    {
    	local int selectedRes;
            MyOptions.SetFloat("selectedResolution", MyResolutionOption.GetFloat("selectedIndex"));
    	selectedRes = MyOptions.GetFloat("selectedResolution");
            switch (selectedRes)
    	{
    		case(0):
                    // etc....
    
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
    {
          switch(WidgetName)
     {
          case ('resolutionOption'): 
                MyResolutionOption = GFxClikWidget(Widget);
                break;
          // etc...
    
    defaultproperties
    {
      WidgetBindings.Add((WidgetName="resolutionOption",WidgetClass=class'GFxClikWidget'))
    // etc...
    And thus remove this (red) stuff from your AS:

    Code:
    /* -----------OK & Cancel Buttons------------------ */
    function ReturnToMainMenu() {
    	options.selectedResolution = resolutionOption.selectedIndex;
    	gotoAndPlay("mainMenu");
    }

    Leave a comment:


  • replied
    Wow, that's intense.

    How do I solve this issue?

    Leave a comment:


  • replied
    Ok, I see a potential conflict. The UnrealScript has priority over your ActionScript events:

    1. You change the resolution to 1280x768 (index 4)

    2. You hit the OK button...

    3. UnrealScript immediately fires OnResolutionChange which looks into MyOptions to find the current value of selectedResolution, and set the resolution with setres. As the selectedIndex does not yet exist, it defaults to 0 (640x480).

    4. ActionScript then sets options.selectedResolution to the selectedIndex of resolutionOption. In this case, you chose 1280x768 (index 4).

    5. You return to the options menu, and the resolution is in fact listed as 1280x768, but the actual game resolution is 640x480.

    6. If you change the resolution again to something else, then hit OK, I suspect the game will setres to 1280x768, but list the new resolution when you return to options.

    So, the index is being set AFTER your UnrealScript does its thing.

    One solution would be to move all the ActionScript into UnrealScript, and order it so that the index is set before the setres stuff happens.

    Leave a comment:


  • replied
    When I goto options and select for example 1280x720 and hit OK, the resolution changes to 640x480. But when I go back to options, the option stepper states that i'm still on 1280x720.

    Heres my US:

    Code:
    var GFxClikWidget StartButton;
    var GFxClikWidget bloomBtn;
    var GFxClikWidget dofBtn;
    var GFxClikWidget OKButton;
    var GFxClikWidget vsyncBtn;
    var GFxClikWidget shadowsBtn;
    var GFxClikWidget lightsBtn;
    var GFxClikWidget occBtn;
    var GFxClikWidget envBtn;
    var GFxClikWidget decalsBtn;
    var GFxObject MyOptions;
    var GFxObject MyAdvanced;
    var bool MyOption;
    
    
    
    function bool Start(optional bool StartPaused = false)
    {
             super.Start();
             Advance(0);
             MyOptions = GetVariableObject("_root.options");
             MyAdvanced = GetVariableObject("_root.advanced");
             return true;
    }

    Code:
    function OnResolutionChange(GFxClikWidget.EventData ev)
    {
    	local int selectedRes;
    	selectedRes = MyOptions.GetFloat("selectedResolution");
            switch (selectedRes)
    	{
    		case(0):
    			ConsoleCommand("setres 640x480");
    			break;
    		case(1): 
    			ConsoleCommand("setres 800x600");
    			break;
    		case(2): 
    			ConsoleCommand("setres 1024x760");
    			break;
    		case(3): 
    			ConsoleCommand("setres 1152x864");
    			break;
    		case(4):
    			ConsoleCommand("setres 1280x768");
    			break;
    		case(5): 
    			ConsoleCommand("setres 1280x800");
    			break;
    		case(6): 
    			ConsoleCommand("setres 1280x960");
    			break;
    		case(7):
    			ConsoleCommand("setres 1280x1024");
    			break;
    		case(8):
    			ConsoleCommand("setres 1360x768");
    			break;
    		case(9):
    			ConsoleCommand("setres 1366x768");
    			break;
    		case(10):
    			ConsoleCommand("setres 1440x900");
    			break;
    		case(11):
    			ConsoleCommand("setres 1600x900");
    			break;
    		case(12):
    			ConsoleCommand("setres 1600x1200");
    			break;
    		case(13):
    			ConsoleCommand("setres 1680x1050");
    			break;
    		case(14):
    			ConsoleCommand("setres 1920x1080");
    			break;
    		case(15):
    			ConsoleCommand("setres 1920x1200");
    			break;
    		default:
    			break;
    	}
    }
    Code:
    defaultproperties
    {
      WidgetBindings.Add((WidgetName="bloomBtn",WidgetClass=class'GFxClikWidget'))
      WidgetBindings.Add((WidgetName="dofBtn",WidgetClass=class'GFxClikWidget'))
      WidgetBindings.Add((WidgetName="okBtn",WidgetClass=class'GFxClikWidget'))
      WidgetBindings.Add((WidgetName="vsyncBtn",WidgetClass=class'GFxClikWidget'))
      WidgetBindings.Add((WidgetName="shadowsBtn",WidgetClass=class'GFxClikWidget'))
      WidgetBindings.Add((WidgetName="lightsBtn",WidgetClass=class'GFxClikWidget'))
      WidgetBindings.Add((WidgetName="occBtn",WidgetClass=class'GFxClikWidget'))
      WidgetBindings.Add((WidgetName="envBtn",WidgetClass=class'GFxClikWidget'))
      WidgetBindings.Add((WidgetName="decalsBtn",WidgetClass=class'GFxClikWidget'))
      MovieInfo = SwfMovie'MainMenuQube.MainMenuQube'
    }

    Heres my options objects in a separate Vars layer:

    Code:
    if (!options) {
    	var options:Object = {};
    }
    Thanks

    Leave a comment:


  • replied
    Not sure about that one. The code you listed looks ok. So you select a resolution (say 1280x720) then hit the ok button to go back to the main menu, and when you return to options, it does not have 1280x720 selected?

    Could mean your options object doesn't exist. How is your options object setup? Where does it live?

    Leave a comment:


  • replied
    Ah Matt Doyle! You are the king!
    Thanks a lot man, that worked a treat.

    Ok, so it works now right, but now when I change the resolution to anything it defaults to 640x480 and my mouse cursor disappears. Any idea why this is?

    AS Code:
    Code:
    /* -----------Video & Audio Settings------------------ */
    resolutionOption.dataProvider = ["640x460", "800x600", "1024x768", "1152x864", "1280x768", "1280x800", "1280x960", "1280x1024", "1360x768", "1366x768", "1440x900", "1600x900", "1600x1200", "1680x1050", "1920x1080", "1920x1200"];
    resolutionOption.selectedIndex = (options.selectedResolution) ? options.selectedResolution : 0

    Code:
    /* -----------OK & Cancel Buttons------------------ */
    function ReturnToMainMenu() {
    	options.selectedResolution = resolutionOption.selectedIndex;
    	gotoAndPlay("mainMenu");
    }

    Leave a comment:

Working...
X