Announcement

Collapse
No announcement yet.

Accessing a variable questions?

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

    #16
    Thanks for the reply... MSClass is declared as var class<UIScene> MSClass;

    so wouldnt that be the same thing... but yeah i dont know the exact syntax of what i need to do .... still having problems with

    Code:
    C:\Program Files (x86)\Unreal Tournament 3\Development\Src\IronOutlaws\Classes\IronOutlawsPlayerController.uc(76) : Error, Type mismatch in Call to 'OpenUIScene', parameter 1

    still trying to learn as much unreal script that i can

    ajpoter

    Comment


      #17
      Mismatch means your calling the wrong kind of parameter.

      So if your calling a vector in a bool then you get mismatch.

      I remember something like having to declare UiScene with quotes, I'll find the thread.

      EDIT: got it: http://utforums.epicgames.com/showthread.php?t=686077

      Looks like you might have to do:


      Code:
      OpenUIScene('IO_UI_HUD.charsel');

      Comment


        #18
        Ah thank you that seemed to do the trick.... but now i have this problem where when i close the scene it opens the scene up again...

        More help please... and thanks again!

        ajporter

        // some log files

        Code:
        Warning: OpenScene: Duplicate scene tag (charSel) detected: NewScene 'IOUI_CharacterSelect IO_UI_HUD.charSel' ExistingScene 'IOUI_CharacterSelect Transient.charSel_22'
        Warning: OpenScene called with NULL Scene!
        ScriptLog: MyScene =  None
        //bisclosed did get set to true Just need to get the duplicate scene resolved
        Code:
        ScriptLog: bIsClosed =  True
        //ui scene class

        Code:
        class IOUI_CharacterSelect extends UTUIFrontEnd;
        
        var transient UIButton button;
        
        var bool bIsClosed; // only true if uiscene is closed.
        
        event SceneActivated(bool bInitialActivation)
        {
            Super.SceneActivated(bInitialActivation);
        
        if (bInitialActivation)
        {
            ActivateLevelEvent('CharacterSelectionEnter_Garage');
        }
        }
        
        
        
        function SetupButtonBar()
        {
             ButtonBar.AppendButton(" <Strings:UTGameUI.ButtonCallouts.Back> ", OnButtonBar_Back);
        }
        
        function bool OnButtonBar_Back(UIScreenObject InButton, int InPlayerIndex)
        {
             ActivateLevelEvent('CharacterSelectionExit');
             bIsClosed=true;
             CloseScene(self);
             `Log("bIsClosed = "@bIsClosed);
             return true;
        }
        
        DefaultProperties
        {
           bIsClosed = false
        }

        //GetPlayerViewPoint

        Code:
        simulated function GetPlayerViewPoint(out vector POVLocation, out rotator POVRotation)
        {
        	local vector X, Y, Z;
        	//local IronOutlawsGame Game;
                //Game = IronOutlawsGame(WorldInfo.Game);
        
                MyScene = OpenUIScene(UIScene'IO_UI_HUD.charSel');
                `Log("MyScene = "@OpenUIScene(MyScene));
        
                if(MyScene != none && IOUI_CharacterSelect(MyScene).bIsClosed)
                {
               	if (bDebugView)
        	{
        		Super.GetPlayerViewPoint(POVLocation, POVRotation);
        		return;
        	}
        
        	if (ViewTarget != None && ViewTarget != self)
        	{
        		POVLocation = ViewTarget.Location;
        	}
        	else
        	{
        		POVLocation = vect(0,0,0);
        	}
        	POVLocation.Z += CameraZOffset;
        	POVRotation = rotator(vect(0,0,-1));
        
        
        	// add camera shake
        	GetAxes(POVRotation, X, Y, Z);
        	POVRotation = Normalize(POVRotation + ShakeRot);
        	POVLocation += ShakeOffset.X * X + ShakeOffset.Y * Y + ShakeOffset.Z * Z;
                }
                else
                {
                 super.GetPlayerViewPoint(POVLocation, POVRotation);
                }
        }

        Comment


          #19
          My guess is that the GetPlayerViewpoint function is called once per tick which is way you are getting Duplicates, and it keeps opening. Try setting a boolean = true once you have opened the UIScene so it only opens once

          Comment


            #20
            Hey thanks Phoenix,

            yeah you where right... been long day and night working on this stuff so brain is overloaded .... Now the result of the code ... i close the scene then it opens again then i close it then it does what i want ... Mind taking a look at my logic :/

            Thanks
            ajporter

            Code:
            simulated function GetPlayerViewPoint(out vector POVLocation, out rotator POVRotation)
            {
            	local vector X, Y, Z;
            	//local IronOutlawsGame Game;
                    //Game = IronOutlawsGame(WorldInfo.Game);
                    if(MyScene == none)
                    {
                    MyScene = OpenUIScene(UIScene'IO_UI_HUD.charSel');
                    `Log("MyScene = "@OpenUIScene(MyScene));
                    }
                    if(MyScene != none && IOUI_CharacterSelect(MyScene).bIsClosed)
                    {
                   	if (bDebugView)
            	{
            		Super.GetPlayerViewPoint(POVLocation, POVRotation);
            		return;
            	}
            
            	if (ViewTarget != None && ViewTarget != self)
            	{
            		POVLocation = ViewTarget.Location;
            	}
            	else
            	{
            		POVLocation = vect(0,0,0);
            	}
            	POVLocation.Z += CameraZOffset;
            	POVRotation = rotator(vect(0,0,-1));
            
            
            	// add camera shake
            	GetAxes(POVRotation, X, Y, Z);
            	POVRotation = Normalize(POVRotation + ShakeRot);
            	POVLocation += ShakeOffset.X * X + ShakeOffset.Y * Y + ShakeOffset.Z * Z;
                    }
                    else
                    {
                     super.GetPlayerViewPoint(POVLocation, POVRotation);
                    }
            }

            Comment


              #21
              However much i doubt what I'm about to, which means it probably isn't right, but:

              Code:
                      if(MyScene == none)
                      {
              
                and
              
                      if(MyScene != none && IOUI_CharacterSelect(MyScene).bIsClosed)
                      {
              What about if( MyScene != None), without the bIsClosed, maybe look at that, but I'm not sure what I should be looking for. I'm too tired right now to comment much, jus a thought.

              To be honest using a bool true / false would be more efficient I think, such as bIsOpen or bJustClosed.

              Comment


                #22
                I wouldn't put any of the menu code in GetPlayerViewPoint like that. Here's what I do to open the quantum state selection menu for Prometheus. I'll fill in some blanks to add what you need.
                Code:
                var bool bSelectionMenuOpen;
                
                simulated function PostBeginPlay()
                {
                    super.PostBeginPlay();
                    SetTimer(1, false, 'OpenMyMenu');
                }
                
                function OpenMyMenu()
                {
                    // The menu opening code
                    bSelectionMenuOpen = true;
                }
                
                function MyMenuClosed()
                {
                    bSelectionMenuOpen = false;
                }
                
                simulated function GetPlayerViewPoint(out vector POVLocation, out rotator POVRotation)
                {
                    if(bSelectionMenuOpen)
                    {
                        // Menu is open.
                    }
                    else
                    {
                        // Menu is closed.
                    }
                }
                The menu code. This depends on your PlayerController being a subclass of UTPlayerController.
                Code:
                function WhateverFunctionClosesThisMenu()
                {
                    if(MyPlayerController(GetUTPlayerOwner()) != none)
                        MyPlayerController(GetUTPlayerOwner()).MyMenuClosed();
                    // Whatever other code.
                }

                Comment


                  #23
                  Id like to thank all of you for helping... Angel's suggestion worked great.... im sure ill need more help at some point ... soon most likely

                  Im working on this atm and im the only programmer(im very green though) atm...

                  http://www.moddb.com/mods/iron-outlaws

                  thanks again
                  ajporter

                  Comment

                  Working...
                  X