Announcement

Collapse
No announcement yet.

Tutorial: UnrealScript and Kismet - Basic Integration

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

    Tutorial: UnrealScript and Kismet - Basic Integration

    Author: Renan Lopes (Ayalaskin).

    Basic UnrealScript Integration with Kismet

    Am a Brazilian, so I ask sorry about my English in advance.

    In this tutorial, i will cover some basics about integrating an UnrealScript code with the Kismet.
    The intent is to make a basic inventory code, where you will be able to add some basics items to your character. The items will not show up, its just an logical item, made with an ID and a Name.
    Note that i will not use any inventory system already made, we will work in our very own class to do the job, this may not be the most sophisticated way, and this inst intended to be total functionally,
    its a programming tutorial that meant to expose the process and the code involved, so don't expect to just copy and use it with no changes.

    We will code 3 classes:
    • MyPawn.uc
    • SeqAct_AddToMyPlayerInventory.uc
    • SeqVar_MyInventoryItem.uc

    The first class extends the UTPawn functionality, so we can control our player without any problems. In this class we will hold an array of items, that array will be known as the player inventory.
    The second one extends the SequenceAction class, with this, we can later see this class in the Kismet Editor as an Action, by right clicking at any point and choosing New Action > Add an Item to MyPlayer Inventory.
    The last class extends the SeqVar_Object class, and with this we also can see this class within the Kismet Editor as an variable, by right clicking at any point and choosing New Variable > Object > MyInventory Item.

    To this tutorial works, you must already have your game working with your custom game info, controller and pawn, if you don’t have, check the Appendix A after this tutorial, were I reproduce whats is necessary to do.
    You should have now the following folder structure:
    • (UDK)\Development\Src\MyGame\Classes\

    The ‘Classes’ folders is where we will put all the code, the UDK identify these files automaticaly.
    Now create two txt files in there, remove the .txt extension and rename each one with the following names:
    • SeqAct_AddToMyPlayerInventory.uc
    • SeqVar_MyInventoryItem.uc

    We will start with the SeqAct_AddToMyPlayerInventory.uc file.
    This class will be visible in the Kismet Editor as soon we finish it.

    Tip: Caution while paste and copying the code, because the single quotes can be sometimes converted to backticks in the text editors, ' converted to `.

    Code:
    // Declaring the class and extend the SequenceAction functionality//
    class SeqAct_AddToMyPlayerInventory extends SequenceAction;
    
    // Declaring two variables, the ID and the Name of the Item //
    var() int ItemID;
    var() string ItemName;
    
    // Here we set the default values of the variables //
    defaultproperties
    {
      // This is the name that will apear in the Kismet Editor
       ObjName="Add Item to PlayerInventory"
    
      // This is the name of the event that will be triggered when this action is called //
       HandlerName="AddItem"
    
       // Here we set the default value to the item //
       ItemID = -1
       ItemName = "NoName"
    
       // There we create slots in the Kismet Editor, linking the slots with this class variables //
       // We create a link to the ItemID variable //
       VariableLinks(1)=(ExpectedType=class'SeqVar_Int', LinkDesc="ID", bWriteable=true, PropertyName=ItemID)
    
       // And we create a link to the ItemName variable //   
       VariableLinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Name", bWriteable=true, PropertyName=ItemName)
    }
    Now you have to compile this file, just open the Frontend Tool again and run the Full-Recompile. Note that you can’t compile it while the UDK Editor is open.
    This is not the best way to test your applications, in the Appendix B i will show how to configure a simple and free editor.

    If you open the UDK Editor now and then open the Kismet Editor, you will notice that it now have an aditional Action, just right click at any point and choose New Action > Add Item to MyPlayerInventory.

    Here some pictures:




    Whenever we call this Action, it will trigger a Function called ‘AddItem’ that must be implemented inside the class of the object pointed in the pink square ‘Target’.
    This target will be our player, so we have to implement the AddItem function inside it, and this goes in the MyPawn.uc file, so open it.
    We have to add these lines inside the file, after the class declaration an before the defaultproperties:

    Code:
    function AddItem(SeqAct_AddToMyPlayerInventory MyAction)
    {
    }
    This parameter is a convention, it must be an variable with any name but the type has to be the one that has called it.
    Now lets create the class that will hold the item information, so open the SeqVar_MyInventoryItem.uc file.


    Code:
    // The class declaration, we extend it from the SeqVar_Object class//
    class SeqVar_MyInventoryItem extends SeqVar_Object;
    
    // This is the item information, we have only two properties //
    var() int ItemID;
    var() string ItemName;
    
    // Here we set the default values to the properties //
    defaultproperties
    {
        // Here is the name that will appear in the Kismet Editor // 
        ObjName="MyInventory Item"
    
        // Here is the color of the circle that represents the variable in the Kismet Editor //
        ObjColor=(R=0,G=0,B=255,A=255)
    
        // And finally here is the default value for the item property //
        ItemID = -1
        ItemName = "NoName"
    }
    After you save and compile this class you will be able to crate variables types of this class.

    Here more pictures:





    Note that the variables that we declared in the code are exposed in the Properties Viewer.

    We now have to made the final touches in the MyPawn.uc file.
    Lets declare an array of inventory items, and then add the functionality to the AddItem function:

    Code:
    // The array of items that we will refer as the inventory //
    var() array<SeqVar_MyInventoryItem> PlayerCustomInventory;
    function AddItem(SeqAct_AddToMyPlayerInventory MyAction)
    {
       // Lets create a new inventory item to hold the values passed //
      local SeqVar_MyInventoryItem ItemBuffer;
      // Instantiate it //
      ItemBuffer = new class’MyGame.SeqVar_MyInventoryItem’;
      // And fill with the information passed //
      ItemBuffer.ItemID = MyAction.ItemID;
      ItemBuffer.ItemName = MyAction.ItemName;
     // And finaly, insert it into the array of itens //
      PlayerCustomInventory.AddItem(ItemBuffer);
    }
    The MyPawn class and the SeqAct_AddToMyPlayerInventory class have a variable of the type SeqVar_MyInventoryItem, so it is dependent from it, and we have to tell it for the UDK, so in the class definition we add
    • DependsOn(SeqVar_MyInventoryItem);


    Here is a Kismet that add an item to the player inventory:



    ================================================== ======

    Final Codes:

    MyPawn.uc:
    Code:
    class MyPawn extends UTPawn DependsOn(SeqVar_MyInventoryItem);
    
    // The array of items that we will refer as the inventory //
    var() array<SeqVar_MyInventoryItem> PlayerCustomInventory;
    function AddItem(SeqAct_AddToMyPlayerInventory MyAction)
    {
       // Lets create a new inventory item to hold the values passed //
      local SeqVar_MyInventoryItem ItemBuffer;
      // Instantiate it //
      ItemBuffer = new class’MyGame.SeqVar_MyInventoryItem’;
      // And fill with the information passed //
      ItemBuffer.ItemID = MyAction.ItemID;
      ItemBuffer.ItemName = MyAction.ItemName;
     // And finaly, insert it into the array of itens //
      PlayerCustomInventory.AddItem(ItemBuffer);
    }
    
    defaultproperties
    {
        Name="Default__MyPawn"
    }

    SeqAct_AddToMyPlayerInventory.uc:
    Code:
    // Declaring the class and extend the SequenceAction functionality//
    class SeqAct_AddToMyPlayerInventory extends SequenceAction DependsOn(SeqVar_MyInventoryItem);
    
    // Declaring two variables, the ID and the Name of the Item //
    var() int ItemID;
    var() string ItemName;
    
    // Here we set the default values of the variables //
    defaultproperties
    {
      // This is the name that will apear in the Kismet Editor
       ObjName="Add Item to MyPlayer Inventory"
    
      // This is the name of the event that will be triggered when this action is called //
       HandlerName="AddItem"
    
       // Here we set the default value to the item //
       ItemID = -1
       ItemName = "NoName"
    
       // There we create slots in the Kismet Editor, linking the slots with this class variables //
       // We create a link to the ItemID variable //
       VariableLinks(1)=(ExpectedType=class'SeqVar_Int', LinkDesc="ID", bWriteable=true,         PropertyName=ItemID)
       // And we create a link to the ItemName variable //   
       VariableLinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Name", bWriteable=true, PropertyName=ItemName)
    }
    SeqVar_MyInventoryItem.uc:
    Code:
    // The class declaration, we extend it from the SeqVar_Object class//
    class SeqVar_MyInventoryItem extends SeqVar_Object;
    
    // This is the item information, we have only two properties //
    var() int ItemID;
    var() string ItemName;
    
    // Here we set the default values to the properties //
    defaultproperties
    {
        // Here is the name that will appear in the Kismet Editor // 
        ObjName="MyInventory Item"
    
        // Here is the color of the circle that represents the variable in the Kismet Editor //
        ObjColor=(R=0,G=0,B=255,A=255)
    
        // And finally here is the default vallue for the item property //
        ItemID = -1
        ItemName = "NoName"
    }
    Complementation:
    Just to be sure that this tutorial cover a good part of creating a sequence in the kismet, am adding this part where you can add and active an output slot.
    The bellow code was not tested, it is just to tell how to add an output slot.
    The relevant addictions are the event Activating() and, in the default properties, the definition of the output slot.

    SeqAct_AddToMyPlayerInventory.uc:
    Code:
    // Declaring the class and extend the SequenceAction functionality//
    class SeqAct_AddToMyPlayerInventory extends SequenceAction DependsOn(SeqVar_MyInventoryItem);
    
    // Declaring two variables, the ID and the Name of the Item //
    var() int ItemID;
    var() string ItemName;
    
    // This event will occur when the In slot became stimulated //
    event Activated()
    {
       if (true) // You have to put your condition inside here, checking if the item was added successfully
           ActivateOutputLink(1); // Activating the slot "Item Added" //
    
       else // Something went wrong while adding the item //
           ActivateOutputLink(2); // Activating the slot "Item Not Added" //
    
       // Activing the out slot //
       ActivateOutputLink(0); // We always activate the Out slot after completing the process //
    }
    
    // Here we set the default values of the variables //
    defaultproperties
    {
      // This is the name that will apear in the Kismet Editor
       ObjName="Add Item to MyPlayer Inventory"
    
      // This is the name of the event that will be triggered when this action is called //
       HandlerName="AddItem"
    
       // Here we set the default value to the item //
       ItemID = -1
       ItemName = "NoName"
    
       // There we create slots in the Kismet Editor, linking the slots with this class variables //
       // We create a link to the ItemID variable //
       VariableLinks(1)=(ExpectedType=class'SeqVar_Int', LinkDesc="ID", bWriteable=true,         PropertyName=ItemID)
       // And we create a link to the ItemName variable //   
       VariableLinks(2)=(ExpectedType=class'SeqVar_String', LinkDesc="Name", bWriteable=true, PropertyName=ItemName)
    
       // This is the outputs slots that will appear in the kismet, LinkDesc refers to the label shown in the kismet //
       OutputLinks(0)=(LinkDesc="Out")
       OutputLinks(1)=(LinkDesc="Item Added")
       OutputLinks(2)=(LinkDesc="Item Not Added")
    }

    #2
    APPENDIX – A

    If tou have any problem doing this part of the tutorial, you can found a good working one here:
    http://tutorial.toltecstudios.com/

    We will configure the basic UDK structure, so we can have our game running with an different behavior than the default one.

    Go to the folder:
    • (UDK)\Development\Src\

    Now create a folder named ‘MyGame’, and inside it create another folder named ‘Classes’.
    Inside the ‘Classes’ folder create three txt files and remove the .txt extension.
    Rename these files to:
    • MyGameInfo.uc
    • MyPawn.uc
    • MyPlayerController.uc

    Here is the content that must be inside each one:
    MyPawn.uc:
    Code:
    class MyPawn extends UTPawn;
    defaultproperties
    {
        Name="Default__MyPawn"
    }
    MyPlayerController.uc:
    Code:
    class MyPlayerController extends UTPlayerController;
    defaultproperties
    {
    	Name="Default__MyPlayerControlle"
    }
    MyGameInfo.uc
    Code:
    class MyGameInfo extends UTDeathmatch;
    defaultproperties
    {
        Acronym="CH"	
        MapPrefixes.Empty
        MapPrefixes(0)="CH"
        DefaultMapPrefixes.Empty
        DefaultMapPrefixes(0)=(Prefix="CH",GameType="MyGame.MyGameInfo")
        PlayerControllerClass=class'MyPlayerController'
        DefaultPawnClass=class'MyPawn'
        Name="Default__MyGameInfo"
    }
    With the code done, we now have to tell UDK to adopt it like the default ones.

    Go to:
    • UTGame\Config\DefaultGame.ini

    Right click it and dismark the Read-Only property and open it.
    Search the ‘[Engine.GameInfo]’.
    Then replace
    • DefaultGame=UTGame.UTDeathmatch
    With:
    • DefaultGame=MyGame.MyGameInfo

    Also replace
    • PlayerControllerClassName=UTGame.UTPlayerControlle r
    With
    • PlayerControllerClassName=MyGame.MyPlayerControlle r

    Don’t forgot to save the file.

    Now go to:
    • UTGame\Config\DefaultEngine.ini.

    Remove its Read-only property too and open it, then find the section:
    • [UnrealEd.EditorEngine]

    Add the following line
    • +EditPackages=MyGame

    This line have to be inserted BELLOW ALL the others ‘+EditPackages=’, because the order matters for the engine.
    Now lets these delete two files, so the UDK will generate new ones with our configuration, delete these ones:
    • UTGame.ini
    • UTEngine.ini

    Close the UDK Editor if it is open, then run the Unreal FrontEnd tool, choose:
    • Make > Full Recompile.

    Comment


      #3
      APPENDIX - B


      Here i will show hot to set up the simple ConText editor.

      If you have problems with this part of the tutorial you can find a good and working one here:
      http://hiteffect.com/xs/xyx/ut/xs/ra...rt4context.htm


      The ConText its very good to work, has highlight, can call the UDK to parse your script, but don't have the auto-complete feature =(.

      First download ConText here:
      http://www.contexteditor.org/

      Go for the stand alone one, because we cant configure very well the portable one.

      Let's configure it, go to the folder:
      • (ConText)\Highlighters\

      And create a txt file, remove the txt extension and name the file this way UnrealScrip.chl

      Open it and add all these codes:

      Code:
      // -----------------------------------------------------------------------------
      //                  UnrealScript syntax highlighter for ConTEXT
      //
      //        Taken from the Unreal Wiki and modified for personal use by Xyx
      // -----------------------------------------------------------------------------
      
      // Language name (user language name)
      Language:            UnrealScript 3
      
      // default file filter
      // note: if more than one extension is associated, eg:
      // C/C++ files (*.c,*.cpp,*.h,*.hpp)|*.c;*.cpp;*.h;*.hpp
      Filter:                 UnrealScript (*.uc,*.uci,*.emt)|*.uc;*.uci;*.emt
      
      // help file which will be invokend when F1 is pressed
      HelpFile:
      
      // language case sensitivity
      //                   0  - no
      //                   1  - yes
      CaseSensitive:       0
      
      // comment type:
      // LineComment - comment to the end of line
      // BlockCommentBeg - block comment begin, it could be multiline
      // BlockCommentEnd - block comment end
      LineComment:         //
      BlockCommentBeg:     /*
      BlockCommentEnd:     */
      
      // identifier characters
      // note: characters shouldn't be delimited, except arrays
      // array of chars could be defined as from_char..to_char
      // IdentifierBegChar - Identifier begin characters
      IdentifierBegChars:  a..z A..Z _
      IdentifierChars:     a..z A..Z _ 0..9
      
      // numeric constants begin characters
      // note: characters shouldn't be delimited, except arrays
      // array of chars could be defined as from_char..to_char
      // number always starts with 0..9 except when NumConstBeg
      // defines other
      NumConstBegChars:    0..9
      
      // numeric constants characters
      // note: characters shouldn't be delimited, except arrays
      // array of chars could be defined as from_char..to_char
      // number always starts with 0..9 except when NumConstBeg
      // defines other
      NumConstChars:       0..9 .abcdefhABCDEFH
      
      // escape character
      EscapeChar:          \
      
      // keyword table
      // note: delimited with spaces, lines could be wrapped
      // you may divide keywords into tree groups which can be
      // highlighted differently
      KeyWords1:
      // Keywords.
      abstract
      array
      arraycount
      assert
      auto
      automated
      begin
      bool
      break
      byte
      case
      class
      coerce
      collapsecategories
      config
      const
      continue
      default
      defaultproperties
      delegate
      dependson
      deprecated
      do
      dontcollapsecategories
      edfindable
      editconst
      editinline
      editinlinenew
      editinlinenotify
      editinlineuse
      else
      end
      enum
      enumcount
      event
      exec
      expands
      export
      exportstructs
      extends
      false
      final
      float
      for
      foreach
      function
      getstatename
      global
      globalconfig
      goto
      gotostate
      guid
      hidecategories
      if
      ignores
      implements
      import
      input
      interface
      insert
      instanced
      int
      intrinsic
      isinstate
      iterator
      latent
      length
      local
      localized
      name
      native
      nativereplication
      new
      noexport
      none
      noteditinlinenew
      notplaceable
      nousercreate
      operator
      optional
      out
      perobjectconfig
      placeable
      pointer
      postoperator
      preoperator
      private
      property
      protected
      public
      reliable
      remove
      replication
      repnotify
      return
      safereplace
      self
      showcategories
      simulated
      singular
      skip
      state
      static
      stop
      string
      struct
      super
      switch
      transient
      travel
      true
      unreliable
      until
      var
      while
      within
      
      // Preprocessor keywords.
      define
      elif
      else
      endif
      if
      include
      isdefined
      
      KeyWords2:
      // Structs.
      box
      color
      coords
      intbox
      plane
      range
      rangevector
      rot
      rotator
      vect
      vector
      
      KeyWords3:
      // Framework classes.
      Actor
      ActorComponent
      AIController
      AudioComponent
      BlockingVolume
      Canvas
      CascadeParticleSystemComponent
      CheatManager
      ColorScaleVolume
      Commandlet
      Component
      Controller
      CullDistanceVolume
      CylinderComponent
      DamageType
      DecalComponent
      DefaultPhysicsVolume
      DemoDamageType
      DemoPawn
      DirectionalLightComponent
      DmgType_Crushed
      DmgType_Fell
      DmgType_Suicided
      DmgType_Telefragged
      DynamicBlockingVolume
      DynamicLightEnvironmentComponent
      DynamicPhysicsVolume
      DynamicTriggerVolume
      Emitter
      FailedConnect
      FoliageFactory
      ForcedDirVolume
      GameInfo
      GameMessage
      GamePawn
      GameProjectile
      GameReplicationInfo
      GameRules
      GameVehicle
      GameWeapon
      GravityVolume
      HelpCommandlet
      Info
      Inventory
      Inventory
      KillZDamageType
      LadderVolume
      LevelStreamingVolume
      LeviathanBlockingVolume
      LightComponent
      LightEnvironmentComponent
      LightVolume
      LocalMessage
      LocalPlayer
      MapInfo
      MaterialEditorInstanceConstant
      MaterialEditorInstanceTimeVarying
      MaterialInterface
      MeshComponent
      MorphTarget
      Mutator
      NavigationPoint
      Object
      Objective
      ParticleEmitter
      ParticleSpriteEmitter
      ParticleSystem
      ParticleSystemComponent
      Pawn
      PhysicsVolume
      Player
      PlayerController
      PlayerReplicationInfo
      PointLightComponent
      PortalVolume
      PostProcessVolume
      PrimitiveComponent
      Projectile
      RB_ForceFieldExcludeVolume
      ReplicationInfo
      ReverbVolume
      Scout
      SkeletalMeshComponent
      SoundCue
      SpotLightComponent
      StaticMeshComponent
      SVehicle
      SVehicleSimBase
      SVehicleSimCar
      SVehicleSimTank
      SVehicleWheel
      TankBlockingVolume
      TeamInfo
      Teleporter
      TestCommandlet
      TestCommandletBase
      TriggerVolume
      UISceneManager
      UTAirVehicle
      UTAreaNamingVolume
      UTAutoCrouchVolume
      UTBeamWeapon
      UTBerserk
      UTBerserk
      UTBot
      UTCarriedObjectMessage
      UTCheatManager
      UTCinematicGame
      UTClientSideWeaponPawn
      UTCountdownNodeMessage
      UTCTFBase
      UTCTFBase_Content
      UTCTFBlueFlagBase
      UTCTFGame
      UTCTFGame_Content
      UTCTFHUDMessage
      UTCTFMessage
      UTCTFRedFlagBase
      UTCTFSquadAI
      UTDamageType
      UTDeathmatch
      UTDeathMessage
      UTDecoy
      UTDeployable
      UTDeployableEMPMine
      UTDeployableEnergyShield
      UTDeployableMessage
      UTDeployableShapedCharge
      UTDeployableSlowVolume
      UTDeployableSpiderMineTrap
      UTDeployedActor
      UTDmgType_AvrilRocket
      UTDmgType_BioGoo
      UTDmgType_BioGoo_Charged
      UTDmgType_BioGooGib
      UTDmgType_Burning
      UTDmgType_CicadaLaser
      UTDmgType_CicadaRocket
      UTDmgType_DarkWalkerBolt
      UTDmgType_DarkWalkerTurretBeam
      UTDmgType_Drowned
      UTDmgType_DualEnforcer
      UTDmgType_EMP
      UTDmgType_Encroached
      UTDmgType_Enforcer
      UTDmgType_FailedTranslocation
      UTDmgType_Fire
      UTDmgType_FlakShard
      UTDmgType_FlakShell
      UTDmgType_FuryBeam
      UTDmgType_FuryBolt
      UTDmgType_GoliathMachineGun
      UTDmgType_Grenade
      UTDmgType_HellBenderPrimary
      UTDmgType_ImpactHammer
      UTDmgType_Instagib
      UTDmgType_Lava
      UTDmgType_LeviathanBeam
      UTDmgType_LeviathanBolt
      UTDmgType_LeviathanCollision
      UTDmgType_LeviathanExplosion
      UTDmgType_LeviathanRocket
      UTDmgType_LeviathanShard
      UTDmgType_LeviathanShockBall
      UTDmgType_LinkBeam
      UTDmgType_LinkPlasma
      UTDmgType_MantaBolt
      UTDmgType_NemesisBeam
      UTDmgType_NightshadeBeam
      UTDmgType_NodeDestruction
      UTDmgType_OrbReturn
      UTDmgType_PaladinEnergyBolt
      UTDmgType_PaladinProximityExplosion
      UTDmgType_Pancake
      UTDmgType_RanOver
      UTDmgType_RaptorBolt
      UTDmgType_RaptorRocket
      UTDmgType_Redeemer
      UTDmgType_Rocket
      UTDmgType_ScavengerBallCollision
      UTDmgType_ScavengerBolt
      UTDmgType_ScavengerStabbed
      UTDmgType_ScorpionBlade
      UTDmgType_ScorpionGlob
      UTDmgType_ScorpionGlobRed
      UTDmgType_ScorpionSelfDestruct
      UTDmgType_SeekingRocket
      UTDmgType_ShapedCharge
      UTDmgType_ShockBall
      UTDmgType_ShockCombo
      UTDmgType_ShockPrimary
      UTDmgType_Slime
      UTDmgType_SniperHeadShot
      UTDmgType_SniperPrimary
      UTDmgType_SpaceDeath
      UTDmgType_SpiderMine
      UTDmgType_SpiderMineDirectHit
      UTDmgType_SPMACameraCrush
      UTDmgType_SPMAShell
      UTDmgType_SPMAShockBall
      UTDmgType_SPMAShockBeam
      UTDmgType_SPMAShockChain
      UTDmgType_SPMASmallShell
      UTDmgType_StealthbenderBeam
      UTDmgType_StingerBullet
      UTDmgType_StingerShard
      UTDmgType_TankShell
      UTDmgType_Telefrag
      UTDmgType_TurretPrimary
      UTDmgType_TurretRocket
      UTDmgType_TurretShard
      UTDmgType_TurretShockBall
      UTDmgType_VehicleCollision
      UTDmgType_VehicleExplosion
      UTDmgType_VehicleShockBall
      UTDmgType_VehicleShockBeam
      UTDmgType_VehicleShockChain
      UTDmgType_ViperBolt
      UTDmgType_ViperSelfDestruct
      UTDMRoster
      UTDMSquad
      UTDuelGame
      UTDuelMessage
      UTDuelPRI
      UTDummyPawn
      UTDynamicWaterVolume
      UTEMPMine
      UTEnergyShield
      UTEntryGame
      UTExplosionLight
      UTExplosionLight
      UTFirstBloodMessage
      UTGame
      UTGameObjective
      UTGameReplicationInfo
      UTHoverVehicle
      UTHoverWheel
      UTIdleKickWarningMessage
      UTInventory
      UTInvisibility
      UTInvulnerability
      UTJumpBoots
      UTJumpPad
      UTKillerMessage
      UTKillingSpreeMessage
      UTKillsRemainingMessage
      UTKillZVolume
      UTKismetAnnouncement
      UTLastSecondMessage
      UTLavaVolume
      UTLeviathanShield
      UTLinkedReplicationInfo
      UTLocalMessage
      UTLockWarningMessage
      UTMapInfo
      UTMissionGRI
      UTMissionSelectionGame
      UTMissionSelectionPRI
      UTMultiKillMessage
      UTMutator
      UTMutator
      UTObjectiveAnnouncement
      UTObjectiveSpecificMessage
      UTOnslaughtBlueCoreMessage
      UTOnslaughtCountdownNode
      UTOnslaughtFlagBase
      UTOnslaughtFlagBase_Content
      UTOnslaughtGame
      UTOnslaughtGame_Content
      UTOnslaughtGRI
      UTOnslaughtHUDMessage
      UTOnslaughtMapInfo
      UTOnslaughtMessage
      UTOnslaughtNodeEnhancement
      UTOnslaughtNodeObjective
      UTOnslaughtNodeTeleporter
      UTOnslaughtNodeTeleporter_Content
      UTOnslaughtObjective
      UTOnslaughtOrbMessage
      UTOnslaughtPanelNode
      UTOnslaughtPowernode
      UTOnslaughtPowernode_Content
      UTOnslaughtPRI
      UTOnslaughtRedCoreMessage
      UTOnslaughtSpecialObjective
      UTOnslaughtSquadAI
      UTPaladinShield
      UTParticleSystemComponent
      UTPawn
      UTPickupInventory
      UTPickupMessage
      UTPlayerReplicationInfo
      UTPowerupRewardMessage
      UTProj_AvrilRocket
      UTProj_AvrilRocketBase
      UTProj_BioGlob
      UTProj_BioGlobling
      UTProj_BioShot
      UTProj_CicadaRocket
      UTProj_DarkWalkerBolt
      UTProj_FlakShard
      UTProj_FlakShardMain
      UTProj_FlakShell
      UTProj_FuryBolt
      UTProj_Grenade
      UTProj_LeviathanBolt
      UTProj_LeviathanRocket
      UTProj_LeviathanShard
      UTProj_LeviathanShockBall
      UTProj_LinkPlasma
      UTProj_LinkPowerPlasma
      UTProj_LoadedRocket
      UTProj_MantaBolt
      UTProj_PaladinEnergyBolt
      UTProj_RaptorBolt
      UTProj_RaptorBoltRed
      UTProj_RaptorRocket
      UTProj_RaptorRocketRed
      UTProj_Redeemer
      UTProj_RedeemerBase
      UTProj_RedeemerRed
      UTProj_Rocket
      UTProj_ScavengerBolt
      UTProj_ScavengerBoltBase
      UTProj_ScavengerBoltBlue
      UTProj_ScorpionGlob
      UTProj_ScorpionGlob_Base
      UTProj_ScorpionGlob_Red
      UTProj_SeekingRocket
      UTProj_ShockBall
      UTProj_SpiderMine
      UTProj_SpiderMineBase
      UTProj_SpiderMineBlue
      UTProj_SPMACamera
      UTProj_SPMACamera_Content
      UTProj_SPMAShell
      UTProj_SPMAShell_Content
      UTProj_SPMAShellChild
      UTProj_SPMAShockBall
      UTProj_StingerShard
      UTProj_TankShell
      UTProj_TransDisc
      UTProj_TransDisc_ContentBlue
      UTProj_TransDisc_ContentRed
      UTProj_TurretRocket
      UTProj_TurretShard
      UTProj_TurretShockBall
      UTProj_VehicleShockBall
      UTProj_VehicleShockBallBase
      UTProj_ViperBolt
      UTProjectile
      UTRemoteRedeemer
      UTRemoteRedeemer_Content
      UTSayMsg
      UTScavengerMessage
      UTScout
      UTScriptedBotVolume
      UTScriptedVoiceMessage
      UTShapedCharge
      UTShapedCharge_Blue
      UTShapedCharge_Red
      UTSlimeVolume
      UTSlowVolume
      UTSlowVolume_Content
      UTSlowVolume_Content
      UTSpaceVolume
      UTSpecialObjectiveStatusMessage
      UTSpiderMineTrap
      UTSpiderMineTrapBlue
      UTSpiderMineTrapRed
      UTSPMAMessage
      UTSquadAI
      UTStartupMessage
      UTStealthVehicle
      UTStealthVehicleMessage
      UTTeamDeathMessage
      UTTeamGame
      UTTeamGameMessage
      UTTeamInfo
      UTTeamSayMsg
      UTTeamScoreMessage
      UTTeleporter
      UTTeleporterBase
      UTTimedPowerup
      UTTimerMessage
      UTUDamage
      UTUDamage
      UTVehicle
      UTVehicle_Cicada
      UTVehicle_Cicada_Content
      UTVehicle_DarkWalker
      UTVehicle_DarkWalker_Content
      UTVehicle_Deployable
      UTVehicle_Fury
      UTVehicle_Fury_Content
      UTVehicle_Goliath
      UTVehicle_Goliath_Content
      UTVehicle_HellBender
      UTVehicle_HellBender_Content
      UTVehicle_Hoverboard
      UTVehicle_Leviathan
      UTVehicle_Leviathan_Content
      UTVehicle_Manta
      UTVehicle_Manta_Content
      UTVehicle_Nemesis
      UTVehicle_NightShade
      UTVehicle_NightShade_Content
      UTVehicle_Paladin
      UTVehicle_Raptor
      UTVehicle_Raptor_Content
      UTVehicle_Scavenger
      UTVehicle_Scavenger_Content
      UTVehicle_Scorpion
      UTVehicle_Scorpion_Content
      UTVehicle_ShieldedTurret
      UTVehicle_ShieldedTurret_Rocket
      UTVehicle_ShieldedTurret_Shock
      UTVehicle_ShieldedTurret_Stinger
      UTVehicle_SPMA
      UTVehicle_SPMA_Content
      UTVehicle_TrackTurretBase
      UTVehicle_Turret
      UTVehicle_Viper
      UTVehicle_Viper_Content
      UTVehicle_Walker
      UTVehicleBase
      UTVehicleCantCarryFlagMessage
      UTVehicleCTFGame
      UTVehicleCTFGame_Content
      UTVehicleHellbenderWheel
      UTVehicleKillMessage
      UTVehicleMessage
      UTVehicleScorpionWheel
      UTVehicleShield
      UTVehicleSimCar
      UTVehicleSimChopper
      UTVehicleSimHellbender
      UTVehicleSimHover
      UTVehicleSimHoverboard
      UTVehicleSimHoverTank
      UTVehicleSimTank
      UTVehicleWeapon
      UTVehicleWheel
      UTVictimMessage
      UTVictoryMessage
      UTVoteReplicationInfo
      UTVWeap_CicadaMissileLauncher
      UTVWeap_CicadaTurret
      UTVWeap_DarkWalkerPassGun
      UTVWeap_DarkWalkerTurret
      UTVWeap_FuryGun
      UTVWeap_GoliathMachineGun
      UTVWeap_GoliathTurret
      UTVWeap_HellBenderPrimary
      UTVWeap_LeviathanPrimary
      UTVWeap_LeviathanTurretBase
      UTVWeap_LeviathanTurretBeam
      UTVWeap_LeviathanTurretRocket
      UTVWeap_LeviathanTurretShock
      UTVWeap_LeviathanTurretStinger
      UTVWeap_MantaGun
      UTVWeap_NemesisTurret
      UTVWeap_NightshadeGun
      UTVWeap_NightshadeGun_Content
      UTVWeap_PaladinGun
      UTVWeap_RaptorGun
      UTVWeap_RocketTurret
      UTVWeap_ScavengerGun
      UTVWeap_ScorpionTurret
      UTVWeap_ShockTurret
      UTVWeap_ShockTurretBase
      UTVWeap_SPMACannon
      UTVWeap_SPMACannon_Content
      UTVWeap_SPMAPassengerGun
      UTVWeap_StealthbenderGun
      UTVWeap_StealthGunContent
      UTVWeap_TowCable
      UTVWeap_TurretPrimary
      UTVWeap_TurretShock
      UTVWeap_TurretStinger
      UTVWeap_ViperGun
      UTWarfareBarricade
      UTWarfareBarricade_Concrete
      UTWarfareBarricadeMessage
      U****erVolume
      UTWeap_Avril
      UTWeap_Avril_Content
      UTWeap_BioRifle
      UTWeap_BioRifle_Content
      UTWeap_Enforcer
      UTWeap_FlakCannon
      UTWeap_ImpactHammer
      UTWeap_InstagibRifle
      UTWeap_LinkGun
      UTWeap_Physicsgun
      UTWeap_Redeemer
      UTWeap_Redeemer_Content
      UTWeap_RocketLauncher
      UTWeap_ShockRifle
      UTWeap_SniperRifle
      UTWeap_Stinger
      UTWeap_Translocator
      UTWeap_Translocator_Content
      UTWeapon
      UTWeaponKillMessage
      UTWeaponKillRewardMessage
      UTWeaponPawn
      UTWeaponRewardMessage
      UTWeaponShield
      UTWeaponSwitchMessage
      Vehicle
      Vehicle
      Volume
      WaterVolume
      Weapon
      WorldInfo
      
      KeyWords4:
      // EAxis
      AXIS_NONE
      AXIS_X
      AXIS_Y
      AXIS_BLANK
      AXIS_Z
      
      // EInputEvent
      IE_Pressed
      IE_Released
      IE_Repeat
      IE_DoubleClick
      IE_Axis
      
      // EInterpCurveMode
      CIM_Linear
      CIM_CurveAuto
      CIM_Constant
      CIM_CurveUser
      CIM_CurveBreak
      
      // EInterpMethodType
      IMT_UseFixedTangentEval
      IMT_UseBrokenTangentEval
      
      // ETickingGroup
      TG_PreAsyncWork
      TG_DuringAsyncWork
      TG_PostAsyncWork
      
      // EPhysics
      PHYS_None
      PHYS_Walking
      PHYS_Falling
      PHYS_Swimming
      PHYS_Flying
      PHYS_Rotating
      PHYS_Projectile
      PHYS_Interpolating
      PHYS_Spider
      PHYS_Ladder
      PHYS_RigidBody
      PHYS_SoftBody
      PHYS_Unused
      
      // EMoveDir
      MD_Stationary
      MD_Forward
      MD_Backward
      MD_Left
      MD_Right
      MD_Up
      MD_Down
      
      // ENetRole
      ROLE_None
      ROLE_SimulatedProxy
      ROLE_AutonomousProxy
      ROLE_Authority
      
      // ECollisionType
      COLLIDE_CustomDefault
      COLLIDE_NoCollision
      COLLIDE_BlockAll
      COLLIDE_BlockWeapons
      COLLIDE_TouchAll
      COLLIDE_TouchWeapons
      COLLIDE_BlockAllButWeapons
      COLLIDE_TouchAllButWeapons
      
      // ETravelType
      TRAVEL_Absolute
      TRAVEL_Partial
      TRAVEL_Relative
      
      // EDoubleClickDir
      DCLICK_None
      DCLICK_Left
      DCLICK_Right
      DCLICK_Forward
      DCLICK_Back
      DCLICK_Active
      DCLICK_Done
      
      KeyWords5:
      
      // string delimiter:
      // StringBegChar - string begin char
      // StringEndChar - string end char
      // MultilineStrings - enables multiline strings,
      // as perl has it
      StringBegChar:       "
      StringEndChar:       "
      MultilineStrings:    0
      
      // use preprocessor:
      // 0 - no
      // 1 - yes
      // note: if yes, '#' and statements after it will be
      // highlighted with Preprocessor defined colors
      UsePreprocessor:     1
      
      // highlight line:
      // 0 - no
      // 1 - yes
      // note: if yes, current line will be highlighted
      CurrLineHighlighted:    0
      
      // colors
      // note:             first value is foreground, second is
      //                   background color
      //                     and third (optional) is font attribute:
      //                     B - bold
      //                     I - italic
      //                     U - underline
      //                     S - strike out
      //                     attributes can be combined: eg. B or BI
      //                   as value, it could be used any standard
      //                   windows color:
      //                     clBlack, clMaroon, clGreen, clOlive,
      //                     clNavy, clPurple, clTeal, clGray,
      //                     clSilver, clRed, clLime, clYellow,
      //                     clBlue, clFuchsia, clAqua, clLtGray,
      //                     clDkGray, clWhite, clScrollBar,
      //                     clBackground, clActiveCaption,
      //                     clInactiveCaption, clMenu, clWindow,
      //                     clWindowFrame, clMenuText, clWindowText,
      //                     clCaptionText, clActiveBorder,
      //                     clInactiveBorder, clAppWorkSpace,
      //                     clHighlight, clHighlightText, clBtnFace,
      //                     clBtnShadow, clGrayText, lBtnText,
      //                     clInactiveCaptionText, clBtnHighlight,
      //                     cl3DDkShadow, cl3DLight, clInfoText,
      //                     clInfoBk
      //                   as value, it could be used hex numeric
      //                   constant too:
      //                     $BBGGRR - BB: blue, GG: green, RR: red,
      //                               eg: $FF6A00
      SpaceCol:               clWindowText clWindow
      Keyword1Col:            clBlue clWindow B
      Keyword2Col:            clMaroon clWindow
      Keyword3Col:            $00CC0000 clWindow
      IdentifierCol:          clWindowText clWindow
      CommentCol:             clGreen clWindow
      NumberCol:              $00CC00CC clWindow
      StringCol:              $00CC00CC clWindow
      SymbolCol:              clWindowText clWindow
      PreprocessorCol:        clRed clWindow I
      SelectionCol:           clHighlightText clBlue
      
      // If CurrLineHighlighted: 1
      CurrentLineCol:         clBlack clYellow
      
      OverrideTxtFgColor:     0
      BlockAutoindent:        1
      BlockBegStr:            {
      BlockEndStr:            }
      MatchedBracesCol:       $004040FF clWindow
      Keyword4Col:            $00666666 clWindow
      Keyword5Col:            $00CC00CC clWindow

      Now we will bind a key so when we press it, the ConText will call the UDK parser and compile our code, and also will show any message errors detected in the code.

      In the main menu open:
      Options > Environment Options

      Now find the Execute Keys tab, and choose the 'Add' button.
      The file extension should be .uc.
      Under User exec keys listing the uc extension can be found and the keys F9, F10, F11 and F12.

      Select one of the keys then fill the necessary information:
      Code:
      Execute:	C:\UDK\UDK-2009-11-2\Binaries\Win32\UT3.com
      Start in:	C:\UDK\UDK-2009-11-2\Binaries\Win32\
      Parameters:	make
      Hint:	Compile
      Save:	All files before execution
      Capture console output:	Yes
      Scroll console to the last line:	Yes
      Picture:


      You can create a new file now, then select the UnrealScript in the combobox,
      to compile just press the key that you have chosen in the last step.

      Comment


        #4
        thanks for sharing

        Comment


          #5
          you are awesome, thank you

          Comment


            #6
            Thanks so much. Great commenting.

            Comment


              #7
              You can ready my mind man. Just what I needed.

              Comment


                #8
                Thank you very much!

                Comment


                  #9
                  Great job bro!

                  Comment


                    #10
                    Thank you so much for a great tutorial....just what we needed!...and your English is fine!

                    Comment


                      #11
                      First of all; thanks for this tutorial. This is just the amount of info I needed to get started...

                      I'm getting an error compiling the MyPawn.uc:
                      Code:
                      --------------------SuperFunGame - Release--------------------
                      Analyzing...
                      I:\UDK\UDK-2009-11-2\Development\Src\SuperFunGame\Classes\MyPawn.uc(8) : Error, 'SeqVar_MyInventoryItem': Bad command or expression
                      Compile aborted due to errors.
                      
                      Warning/Error Summary
                      ---------------------
                      I:\UDK\UDK-2009-11-2\Development\Src\SuperFunGame\Classes\MyPawn.uc(8) : Error, 'SeqVar_MyInventoryItem': Bad command or expression
                      
                      Failure - 1 error(s), 0 warning(s)
                      
                      Execution of commandlet took:  3.92 seconds
                      > Execution finished.
                      I was thinking you needed:

                      local SeqVar_MyInventoryItem ItemBuffer;

                      which seems to fix that problem, but gives a different error now:

                      Warning/Error Summary
                      ---------------------
                      I:\UDK\UDK-2009-11-2\Development\Src\SuperFunGame\Classes\MyPawn.uc(1 0) : Error, 'new': Class 'MyPawn' is an Actor subclass, use 'Spawn' instead

                      Any help?

                      Comment


                        #12
                        Thanks for reporting it.
                        You realy have to put the 'local' keyword in the declaration of the ItemBuffer.
                        Se second error may occur if you don't put you package name in the class especification when instantiating the ItemBuffer, try this correction:

                        Code:
                        local SeqVar_MyInventoryItem ItemBuffer;
                        ItemBuffer = new class'MyGame.SeqVar_MyInventoryItem';
                        If it doenst fix the problem let me know.

                        Obs: post the part where do you are making the 'new' command, the error that you reported indicates an different kind of instance of which is expected.

                        Comment


                          #13
                          This was exactly the tutorial I have been needing. Thanks for posting!

                          Comment


                            #14
                            Thanks!

                            Valeu Renan, estava precisando dessa integração

                            Comment


                              #15
                              Originally posted by Ayalaskin View Post
                              Thanks for reporting it.
                              You realy have to put the 'local' keyword in the declaration of the ItemBuffer.
                              Se second error may occur if you don't put you package name in the class especification when instantiating the ItemBuffer, try this correction:

                              Code:
                              local SeqVar_MyInventoryItem ItemBuffer;
                              ItemBuffer = new class'MyGame.SeqVar_MyInventoryItem';
                              If it doenst fix the problem let me know.

                              Obs: post the part where do you are making the 'new' command, the error that you reported indicates an different kind of instance of which is expected.
                              Thanks for the help. Still get the error. Here is my code:

                              Code:
                              class MyPawn extends UTPawn DependsOn(SeqVar_MyInventoryItem);
                              
                              // The array of items that we will refer as the inventory //
                              var() array<SeqVar_MyInventoryItem> PlayerCustomInventory;
                              function AddItem(SeqAct_AddToMyPlayerInventory MyAction)
                              {
                                 // Lets create a new inventory item to hold the values passed //
                                local SeqVar_MyInventoryItem ItemBuffer;
                                // Instantiate it //
                                ItemBuffer = new class’SuperFunGame.SeqVar_MyInventoryItem’;
                                // And fill with the information passed //
                                ItemBuffer.ItemID = MyAction.ItemID;
                                ItemBuffer.ItemName = MyAction.ItemName;
                               // And finaly, insert it into the array of itens //
                                PlayerCustomInventory.AddItem(ItemBuffer);
                              }
                              
                              defaultproperties
                              {
                                  Name="Default__DefaultPawn"
                              }
                              and the make/compile output:

                              Code:
                              > Executing: I:\Program Files\ConTEXT\ConExec.exe "I:\UDK\UDK-2009-11-2\Binaries\Win32\UDK.com" make
                              
                              Init: Version: 5860
                              Init: Epic Internal: 0
                              Init: Compiled (32-bit): Nov 12 2009 14:51:59
                              Init: Command line:  -DEFENGINEINI=..\..\UTGame\Config\DefaultEngineUDK.ini
                              Init: Base directory: I:\UDK\UDK-2009-11-2\Binaries\Win32\
                              Init: Character set: Unicode
                              Log: Executing Class UnrealEd.MakeCommandlet
                              --------------------Core - Release--------------------
                              --------------------Engine - Release--------------------
                              --------------------GameFramework - Release--------------------
                              --------------------UnrealEd - Release--------------------
                              --------------------UnrealScriptTest - Release--------------------
                              --------------------IpDrv - Release--------------------
                              --------------------OnlineSubsystemPC - Release--------------------
                              --------------------UTGame - Release--------------------
                              --------------------UTEditor - Release--------------------
                              --------------------UTGameContent - Release--------------------
                              --------------------SuperFunGame - Release--------------------
                              Analyzing...
                              I:\UDK\UDK-2009-11-2\Development\Src\SuperFunGame\Classes\MyPawn.uc(10) : Error, 'new': Class 'MyPawn' is an Actor subclass, use 'Spawn' instead
                              Compile aborted due to errors.
                              
                              Warning/Error Summary
                              ---------------------
                              I:\UDK\UDK-2009-11-2\Development\Src\SuperFunGame\Classes\MyPawn.uc(10) : Error, 'new': Class 'MyPawn' is an Actor subclass, use 'Spawn' instead
                              
                              Failure - 1 error(s), 0 warning(s)
                              
                              Execution of commandlet took:  4.20 seconds
                              > Execution finished.
                              Thank you!

                              Comment

                              Working...
                              X