Results 1 to 4 of 4
  1. #1
    MSgt. Shooter Person
    Join Date
    Dec 2010
    Posts
    316

    Default my Question about Weapon..!

    Hi;

    I want to give my (Projectile) weapon to my AI-Pawn. This AI-Pawn, will not change/pickup it's weapon by PickupFactory. How could I add this (permanent) weapon to my AI_Pawn ?
    (Is there any function that gives the weapon to pawn directly...?)

    Here is my related classes:

    AI-Pawn class:
    Code:
    class EnemyA_AIPawn  extends Pawn
    placeable;
    
    
    // Socket to use for attaching weapons
    var(Pawn) const Name WeaponSocketName;
    
    //-----------------------------------------------
    function AddDefaultInventory()
    {
        InvManager.CreateInventory(class'BotA_Weapon', false);
    }
    
    
    simulated function PreBeginPlay()
    {
    	AddDefaultInventory(); 
    	Super.PreBeginPlay();
    }
    
    ...
    
    DefaultProperties
    {
    
    
    Begin Object class=SkeletalMeshComponent name=EnemyA_Pawn
        ...
    End Object
        ...
    
    	ControllerClass = class 'theAIController_1'
    	InventoryManagerClass = class 'AIPawnInvManager'	
    }
    AI Inventory Manager:
    Code:
    class AIPawnInvManager  extends InventoryManager;
    
    defaultproperties
    {
    	// Create the pending fire array
    	PendingFire(0)=0
    	PendingFire(1)=0
    }

  2. #2
    MSgt. Shooter Person
    Join Date
    Dec 2010
    Posts
    316

    Default

    Any Idea?

    A "player-controlled Pawn" can pickup a weapon from a PickupFactory node, how could I give a weapon to an "AI-controled Pawn" ?

  3. #3
    Banned
    Join Date
    Feb 2011
    Location
    BXL/Paris
    Posts
    2,169

    Default

    Use PostBeginPlay() not PreBeginPlay()...

  4. #4
    MSgt. Shooter Person
    Join Date
    Dec 2010
    Posts
    316

    Default

    Thanks VendorX, it helps...


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.