Announcement

Collapse
No announcement yet.

Placing a custom pawn spawn in the editor

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

    Placing a custom pawn spawn in the editor

    Hey,
    Tryin' to figure out how to place a spawn point for a custom pawn in the editor. The thing is it's a different pawn than the player uses. Basically, I have a PlayerStart which is where the player starts, and I need spawn points for the different kinds of enemies, as in a single player game. I looked through the PlayerStart actor properties and couldn't find anything about which pawn to use, and didn't find anything like SpawnPoint or something in the Actor Browser. Am I missing something, or can this not be done in the editor? Thanks.

    #2
    To spawn something you need to use the ActorFactory. You can assign many things to spawn including custom made enemies. You choose a controler and pawn and how many and how often and so on. The point where it spawns at can be basically anything, a dummy node like a Note or Trigger or whatever.

    Comment


      #3
      You could even go as simple as to subclass actor (as it has a location) to handle your spawning. It's what we in a prototype I worked on early this year.

      Comment


        #4
        here
        Code:
        //=============================================================================
        // TeglegSpawnPoint.
        //
        // Spawn actors without using navigation points
        //=============================================================================
        class TeglegSpawnPoint extends Actor
            hidecategories(Lighting,LightColor,Force)
            placeable;
        
        var    CylinderComponent        CylinderComponent;
        
        /** Normal editor sprite */
        var const transient SpriteComponent GoodSprite;
        /** Used to draw bad collision intersection in editor */
        var const transient SpriteComponent BadSprite;
        
        defaultproperties
        {
            Begin Object Class=SpriteComponent Name=Sprite
                Sprite=Texture2D'EditorResources.S_KVehFact'
                HiddenGame=true
                HiddenEditor=false
                AlwaysLoadOnClient=False
                AlwaysLoadOnServer=False
            End Object
            Components.Add(Sprite)
            GoodSprite=Sprite
        
            Begin Object Class=SpriteComponent Name=Sprite2
                Sprite=Texture2D'EditorResources.Bad'
                HiddenGame=true
                HiddenEditor=true
                AlwaysLoadOnClient=False
                AlwaysLoadOnServer=False
                Scale=0.25
            End Object
            Components.Add(Sprite2)
            BadSprite=Sprite2
        
            Begin Object Class=ArrowComponent Name=Arrow
                ArrowColor=(R=150,G=200,B=255)
                ArrowSize=1.5
                bTreatAsASprite=True
                HiddenGame=true
                AlwaysLoadOnClient=False
                AlwaysLoadOnServer=False
            End Object
            Components.Add(Arrow)
        
            Begin Object Class=CylinderComponent Name=CollisionCylinder //LegacyClassName=NavigationPoint_NavigationPointCylinderComponent_Class
                CollisionRadius=+0050.000000
                CollisionHeight=+0050.000000
            End Object
            CollisionComponent=CollisionCylinder
            CylinderComponent=CollisionCylinder
            Components.Add(CollisionCylinder)
        
        
            bCollideWhenPlacing=true
        
            bCollideActors=false
        }

        Comment


          #5
          Thanks for the help guys. I tried the ActorFactory stuff following this video, using the regular UT stuff first as a test. It spawns the character but it doesn't do anything, just stands there and gets shot. I tried rebuilding the AI paths like it says in the comments, and I got a warning saying "PathNode_0 has no paths and is not inside the navmesh". I added another path node, didn't do anything to it but place it, and rebuilt the AI paths. That got rid of that warning but he still just stands there.

          Also, tegleg, thanks for the code but I don't really understand what it does I don't think. Nearest I can tell it places a sprite in the editor, but I can't see anything that looks like it would spawn an actor.

          Comment


            #6
            You'd spawn actors in the game mode class, by finding your spawn points, and calling Spawn() using it's location.

            Comment


              #7
              Ok, figured out the issue with the ActorFactory. Apparently you have to set controller to None, because UTBot doesn't work correctly in the February release, or something. In any case, it works now. Thanks everyone.

              Comment

              Working...
              X