Results 1 to 1 of 1

Thread: Pickup Factorys

  1. #1
    MSgt. Shooter Person
    Join Date
    Dec 2007
    Location
    Staffordshire UK
    Posts
    277
    Gamer IDs

    Gamertag: Meat Bees

    Default Pickup Factorys

    Hi folks,

    Anyone had any joy with coding these on IOS. Just wandering if there is anything to take into when compared to standarad UDK. I.e. because I'm extending from GamePawn / MobilePawn does that knackered up any of the pickp factory stuff?

    I'm pretty much just trying to add a small health vial back in. Which is extending from pickupfactory.

    The result I'm having is that the vial appears but I cannot pick it up.

    Many thanks for your time and help!

    Greg


    SOLVED was missing bCanPickupInventory = true; from the pawn in default properties I'd put it in the wrong place.

    WIP code

    Code:
    class UTPickupFactory_HealthVial extends PickupFactory
    ClassGroup(Pickups,Health);
    
    var		int					HealAmount;
    var DynamicLightEnvironmentComponent LightEnvironment;
    var		SoundCue			PickupSound;
    
    /**
     * Give the benefit of this pickup to the recipient
     */
    function SpawnCopyFor( Pawn Recipient )
    {
    	// Give health to recipient
    	Recipient.Health += HealAmount;
    
    	Recipient.MakeNoise(0.1);
    	PlaySound( PickupSound );
    
    	if ( PlayerController(Recipient.Controller) != None )
    	{
    		PlayerController(Recipient.Controller).ReceiveLocalizedMessage(MessageClass,,,,class);
    	}
    }
    
    defaultproperties
    {
    	HealAmount=10.0
    	//RespawnTime=30.000000
    	PickupSound=""
    	 InventoryType=class'Inventory'
    	 
    		Begin Object Class=DynamicLightEnvironmentComponent Name=PickupLightEnvironmentNerp
    		LightShadowMode=LightShadow_Modulate
    		bSynthesizeSHLight=TRUE
    		bUseBooleanEnvironmentShadowing=FALSE
    		ModShadowFadeoutTime=0.75f
    		bIsCharacterLightEnvironment=TRUE
    		bAllowDynamicShadowsOnTranslucency=TRUE
     	End Object
     	Components.Add(PickupLightEnvironmentNerp)
    	LightEnvironment=PickupLightEnvironmentNerp
    	 
    	Begin Object Class=StaticMeshComponent Name=HealthPickUpMesh
    	    CastShadow=FALSE
    		bCastDynamicShadow=FALSE
    		bAcceptsLights=TRUE
    		bForceDirectLightMap=TRUE
    		LightEnvironment=PickupLightEnvironmentNerp
    		StaticMesh=StaticMesh'Pickups.Health_Small.Mesh.S_Pickups_Health_Small'
    		AlwaysLoadOnClient=true
    		AlwaysLoadOnServer=true
    		CollideActors=false
    		BlockActors=false
    		BlockRigidBody=false
    		MaxDrawDistance=4500
    	End Object
    	PickupMesh=HealthPickUpMesh
    	Components.Add(HealthPickUpMesh)
    	
    	Begin Object Class=DynamicLightEnvironmentComponent Name=PickupLightEnvironment
    		LightShadowMode=LightShadow_Modulate
    		bSynthesizeSHLight=TRUE
    		bUseBooleanEnvironmentShadowing=FALSE
    		ModShadowFadeoutTime=0.75f
    		bIsCharacterLightEnvironment=TRUE
    		bAllowDynamicShadowsOnTranslucency=TRUE
     	End Object
     	Components.Add(PickupLightEnvironment)
    	
    	bMovable=FALSE
    	bStatic=FALSE
    }

    ooh and the pawn code if its needed?

    Code:
    class MAAHDAMNPAWN extends UDKPawn;
    
    var SkeletalMesh defaultMesh;
    var MaterialInterface defaultMaterial0;
    var AnimTree defaultAnimTree;
    var array<AnimSet> defaultAnimSet;
    var AnimNodeSequence defaultAnimSeq;
    var PhysicsAsset defaultPhysicsAsset;
    var()	SkeletalMeshComponent			SkeletalMeshComponent;
    var DynamicLightEnvironmentComponent LightEnvironment;
    
    function AddDefaultInventory()
    {
        InvManager.CreateInventory(class'MAAHN.MaahDamnGun');
    }
    
    defaultproperties
    {
    	InventoryManagerClass=class'MAAHN.MaahInventoryManager'
    
    	Begin Object Name=CollisionCylinder
    		CollisionRadius=65
    		CollisionHeight=50
    		Translation=(X=0.0,Y=0.0,Z=0.0)
    	End Object
       CylinderComponent=CollisionCylinder
    
     	Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
    		LightShadowMode=LightShadow_Modulate
    		bSynthesizeSHLight=TRUE
    		bUseBooleanEnvironmentShadowing=FALSE
    		ModShadowFadeoutTime=0.75f
    		bIsCharacterLightEnvironment=TRUE
    		bAllowDynamicShadowsOnTranslucency=TRUE
     	End Object
     	Components.Add(MyLightEnvironment)
    	LightEnvironment=MyLightEnvironment
    
    
     	Begin Object Class=SkeletalMeshComponent Name=PawnMesh
    		SkeletalMesh=SkeletalMesh'squig.squig'
    		AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human'
    		LightEnvironment=MyLightEnvironment
            AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_BaseMale'
    		PhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Mesh.SK_CH_Corrupt_Male_Physics'
    		HiddenGame=false
    		CastShadow=true //FIXME
    		bUpdateSkelWhenNotRendered=False
    		bTickAnimNodesWhenNotRendered=False
    		bIgnoreControllersWhenNotRendered=True
    		bUpdateKinematicBonesFromAnimation=false
    		bCastDynamicShadow=false
    
     	End Object
     	Mesh=PawnMesh
     	Components.Add(PawnMesh)
    
       GroundSpeed=500.000000
       Health=10
    }
    Last edited by Showster; 04-16-2011 at 05:10 PM. Reason: solved


 

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.