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

my Question about Weapon..!

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

  • 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
    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" ?

    Comment


    • #3
      Use PostBeginPlay() not PreBeginPlay()...

      Comment


      • #4
        Thanks VendorX, it helps...

        Comment

        Working...
        X