Announcement

Collapse
No announcement yet.

Getting a HOLD on Objects

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

    Getting a HOLD on Objects

    I'm trying to get a hold on the GameEngine Object, so far it has failed using these two methods:
    Code:
    function PostBeginPlay()
    {
        local int i;
        Super.PostBeginPlay();
        ForEach AllObjects(Class'GameEngine',GE);
        if( GE != None )
        {
            for(i=0;i<GE.ServerPackages.Length;i++)
            {
                if( GE.ServerPackages[i] ~= "MyPackage" )
                    IsAServerPackage = True;
                Log("ServerPackage["$i$"]: "$GE.ServerPackages[i],'GameEngine');
            }
            Log("Is a ServerPackage: "$IsAServerPackage,'GameEngine');
        }
        else
            Log("Couldn't Find the GameEngine!",'GameEngine');
    }
    and the,
    Level.ObjectPool.AllocateObject();
    says: Access None 'ObjectPool'

    why wont it work? or how do i make it work?

    #2
    BUMP

    Comment


      #3
      Shouldnt that be GE.IsAServerPackage = True? Or am I missing the point of what you are doing?

      Comment


        #4
        im trying to set a var, IsAServerPackage in my class that i put in, i need to get the GameEngine and look thru the ServerPackages to see if my package is in there because most commadns work not being added as a serverpackage and i want to disable the ones that wont work when its not added, but i cant find the ge and if i say new() it crashes about the destory thing with objects i dont understand the error

        Comment


          #5
          BUMP Masta, i havent bumped in so long, BUT I NEED THIS >.<

          Comment


            #6
            Ok I found a way to read the server packages internally...

            Here's the kick, you can alter them, but it will do no good. By the time you can read the server packages, they are already in game and cannot be altered, though there is the possibility if the code is in the GameInfo.InitGame(string options, Out String Error) function...

            How?

            like so:
            Code:
            {
                local int i;
            
                for(i=0;i<class'GameEngine'.default.ServerPackages.length;++i)
                    log(class'GameEngine.Default.ServerPAckages[i]);
            }
            Now if you alter these in the init game of GameInfo, it might work, cause that is where they are set natively...


            note you may want to use config.ServerPackages...

            Comment


              #7
              well the thing is i should have tried it that way, AND my question should have been will the settings in the UT2004.ini count as defaults?

              Comment


                #8
                Yes. You can even change the settings (by changing the class'GameEngine'.default.whatever) in the ini file with StaticSaveConfig(). (if you wanted to)

                class'GameEngine'.default.moose = "weeeee!";
                class'GameEngine.static.StaticSaveConfig();

                It saves the values in the "default" to the ini file.

                Comment


                  #9
                  omg the whole problem was with the default, i tried the class'.var and it didnt work so thats another reason why i didnt try it, thx

                  Comment


                    #10
                    you know, you can add packages to the serverpackages list dynamically via Actor.AddToPackageMap(optional string PackageName);

                    Comment


                      #11
                      Wait I though he was disabling server packacages that crash his... DOh!

                      Comment


                        #12
                        lol i had that b4 then later finding out that it was a code i used >.<

                        Comment

                        Working...
                        X