Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Setting up script projects (easy guide)

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

    Setting up script projects (easy guide)

    hello there.

    i see people struggling and making silly mistakes setting up their script projects, or just doing it plain wrong.
    the official docs here are not all that easy to follow.
    so heres a quick step by step.

    1. navigate to UDK/Development/Src/
    make a new folder, call it what you want but here ill call it 'TegIsAce'.
    make another new folder inside that and call it 'Classes'
    now you have something like this
    UDK/Development/Src/TegIsAce/Classes
    this is where all your custom script files will live.


    2. to make the engine know about your project we need to tell it.
    open UDK/UDKGame/Config
    find DefaultEngine.ini and double click to open it.

    find this bit, [UnrealEd.EditorEngine] is the section to find, it might not say UTGame ect, but add yours at the end
    Code:
    [UnrealEd.EditorEngine]
    +EditPackages=UTGame
    +EditPackages=UTGameContent
    add the name of your new script folder here like this
    Code:
    [UnrealEd.EditorEngine]
    +EditPackages=UTGame
    +EditPackages=UTGameContent
    +EditPackages=TegIsAce
    if you try and start udk now it will moan at you because the script folder is empty.

    3. add a script file of your own.
    heres a simple gametype to get you started.
    create a file called MyGame.uc and paste this into it. then Save it in Your Script Folder ei. UDK/Development/Src/TegIsAce/Classes
    Code:
    class MyGame extends UTGame;
    
    /**
      * Allows overriding of which gameinfo class to use.
      * Called on the DefaultGameType from the ini, or the one specified on the command line (?game=xxx)
      */
    static event class<GameInfo> SetGameType(string MapName, string Options, string Portal)
    {
    
    	return default.class;
    }
    
    defaultproperties
    {
       //define default hud, pawn and player controller and other stuff for this gametype here
       HUDType=class'UTGame.UTHUD'
       PlayerControllerClass=class'UTGame.UTPlayerController'
       DefaultPawnClass=class'UTPawn'
    }
    you now have your own gametype, to make udk use this as default...
    4. navigate to UDK/UDKGame/Config and open DefaultGame.ini
    find these lines
    Code:
    DefaultGame=UDKBase.SimpleGame
    DefaultServerGame=UDKBase.SimpleGame
    ....
    DefaultGameType="UDKBase.SimpleGame";
    change it to point to your gametype
    Code:
    DefaultGame=TegIsAce.MyGame
    DefaultServerGame=TegIsAce.MyGame
    ....
    DefaultGameType="TegIsAce.MyGame";
    so thats "YourScriptFolderName.YourGameType"

    you can also define the default player controller in that section
    PlayerControllerClassName=

    and thats it.
    open the frontend and click 'Script' then 'Full Recompile'

    any problems or anything let me know
    Happy Coding

    edit:
    5. (optional)
    one other thing,
    to make the game just start on your map open UDKGame/Config/DefaultEngine.ini
    and change these lines to point to your map
    Code:
    Map=YourMap.udk
    LocalMap=YourMap.udk

    #2
    You have been a huge help to this forum tegleg! Thanks again for making life a little easier

    Steven

    Comment


      #3
      I am coming back to the engine after a long break and I dont seem to be able to get the editor or game to load my package by following this tutorial. Can anyone confirm that this is still the way to do it?

      Comment


        #4
        afaik thats still uptodate , just make sure your graphical content is in the UDK\UDK-2012-05\UDKGame folder.

        i show this in my videos

        Comment


          #5
          LOL, I was just watching your (Geodav) Youtube channel to try and figure it out and I was so happy to see you had updated your vidoes. Its funny that you were the first to reply.
          I had just started your second gametype video and then I had to go away before getting through to do my job and now its time to leave.
          I have my folder setup as:
          C:\UDK\UDK-2011-11\UDKGame\Content\JohNLA\Content\Characters
          BTW, you truly deserve that MVP badge

          Comment


            #6
            thanks geodav
            did you get it sorted JohNLA?

            Comment


              #7
              EDIT : i was trying to compile the Aeroplane man code
              after several retreis and looking over the code carefully i still can't get UDK to compile the code you gave here. I think i did it excatly as im supposed to.
              Do you have any idea what it might be? i was thinking i made a pathing error but ....it just can't find the mistake
              here's the error

              Comment


                #8
                you have copied it wrong, please look at what the error actually says.
                unexpected 'sstatic'
                should be static with 1 s

                Comment


                  #9
                  Originally posted by tegleg View Post
                  you have copied it wrong, please look at what the error actually says.
                  unexpected 'sstatic'
                  should be static with 1 s
                  Your right. how did it get there? anyways thanks a lot now i can continue.

                  Comment


                    #10
                    Hi tegleg,

                    I tried looking in the DefaultGame.ini file for those lines so I can put my controller and game info in there but I can't find them.

                    hyper

                    Comment


                      #11
                      Hi tegleg,

                      Also, if we want to have more than one custom game mode or controller, can we put more than one gametype and controller in the DefaultEngine.ini?

                      Thanks,

                      hyper

                      Comment


                        #12
                        the controller and gametype in DefaultEngine.ini is the default one, you can only have 1 default.
                        you can however have as many game modes as you want, just put the games controller and pawn in its DefaultProperties
                        just dont forget to add the SetGameType() function like in my example or it will fall back to the one in DefaultEngine.ini.

                        you can then either define a maps gametype in the editor - world properties - game type
                        or use a console command in script ie
                        YourPlayerController.ConsoleCommand("open MapName?Game=YourScriptFolder.YourGameType");

                        Comment


                          #13
                          Hi tegleg,

                          I went in the DefaultGame file and the only thing I saw that was close to the lines that I had to replace were:

                          [Engine.GameInfo]
                          DefaultGame=UDKBase.SimpleGame
                          DefaultServerGame=UDKBase.SimpleGame
                          PlayerControllerClassName=UDKBase.SimplePC
                          GameDifficulty=+1.0
                          MaxPlayers=32
                          DefaultGameType="UTGame.UTDeathmatch";

                          Other than those I can't find those lines to replace.

                          hyper

                          Originally posted by tegleg View Post
                          the controller and gametype in DefaultEngine.ini is the default one, you can only have 1 default.
                          you can however have as many game modes as you want, just put the games controller and pawn in its DefaultProperties
                          just dont forget to add the SetGameType() function like in my example or it will fall back to the one in DefaultEngine.ini.

                          you can then either define a maps gametype in the editor - world properties - game type
                          or use a console command in script ie
                          YourPlayerController.ConsoleCommand("open MapName?Game=YourScriptFolder.YourGameType");

                          Comment


                            #14
                            yes thats right Hyperdude thanks for pointing it out, i did this tutorial a while ago and its changed.
                            first post updated

                            Comment


                              #15
                              Hi Tegleg,

                              Thanks for fixing that! Unfortunately, my main goal was to fix my problem with my pawn not spawning with the custom controller. I still got the same effect. Thanks though!

                              hyper

                              Originally posted by tegleg View Post
                              yes thats right Hyperdude thanks for pointing it out, i did this tutorial a while ago and its changed.
                              first post updated

                              Comment

                              Working...
                              X