Results 1 to 14 of 14
  1. #1
    MSgt. Shooter Person
    Join Date
    Aug 2011
    Posts
    62

    Default Creating a timer

    I need help in creating a Timer countdown of say 30 seconds after which the player dies.Probably kismet would be suitable for this objective

    I tried doing it using "play announcements" event and then attaching the last announcement to "Modify health" event but it doesn't seem to work. Any inputs on this would be appreciable.

    Thank you

  2. #2

    Default

    kismet
    event/ function ...misc > start delay {30 secs} > output -- <your event/ function/ health modification>

  3. #3
    MSgt. Shooter Person
    Join Date
    Sep 2009
    Location
    Arlington, TX
    Posts
    394

    Default

    you can add an activation delay to any input link our output link via right-clicking on the link (the black squares.) or you can add a Delay action between sequences. You state that it does not work: Make sure to target which player(s)/pawn(s) to modify health, the modify health action cannot "guess." also be sure to know the difference between event and action. Actions are not going to activate alone, you need a triggering Event.

  4. #4
    MSgt. Shooter Person
    Join Date
    Aug 2011
    Posts
    62

    Default

    I tried doing what you said but i cant get to kill the player after setting a delay of 5 seconds.


  5. #5

    Default

    The "Player 0" variable needs a input.
    If you want to modify the health of the guy who touches the trigger, connect the Instigator node of the Touch event with the "Player 0" object.

  6. #6

    Default

    Trigger_1 Touch [Instigator];

    ^^ add a variable; Variable > Object > [Object]
    - change your Target to the above variable [object]

    connect the [object]
    - Conversely try what RattleSN4K3 said.

    - Basically; you need the instigator

    - also you need to go to the UDK forum - because easy stuff like this is already fully explained

  7. #7

    Default

    Hmm. Didn't test the "Modify health" action as it depends on the action wether to use a Object or a Player (or any other) variable.

    The following kismet will cause a damage to the player who's touched the trigger.


    Using a Object variable may cause a problem when any objects touching the trigger (like Particles, InterpActors etc.). This would modify the health of particles as well.

  8. #8
    MSgt. Shooter Person
    Join Date
    Aug 2011
    Posts
    62

    Default

    I tried creating exactly what you all said but with no success. Is there any Cause Damage event other then modify health?
    Is there any other way to kill the player??

  9. #9

    Default

    As you are posting in UT3 forum section, i used the UT3 engine/editor. There is no Modify Health kismet action in UT3, therefore i used the Cause damage action.
    Speaking of UT3, there are several options/possibilities to kill a enemy. But there will be a slightly difference to the solutions for UDK as it doesn't feature all things shipped with UT3.

    The following kismet example is the most similar one to yours. It will "remove" the health points of the player's pawn after several seconds (the player will die).


    Copy-Paste-snippet for the example above:
    Code:
    Begin Object Class=SeqEvent_Touch Name=SeqEvent_Touch_0
       Originator=Trigger'Trigger_0'
       MaxTriggerCount=0
       MaxWidth=118
       OutputLinks(0)=(Links=((LinkedOp=SeqAct_Log'SeqAct_Log_0'),(LinkedOp=SeqAct_Delay'SeqAct_Delay_0')))
       VariableLinks(0)=(LinkedVariables=(SeqVar_Object'SeqVar_Object_0'))
       ObjInstanceVersion=2
       ObjPosX=176
       ObjPosY=144
    End Object
    Begin Object Class=SeqAct_ModifyHealth Name=SeqAct_ModifyHealth_0
       InputLinks(0)=(DrawY=218,OverrideDelta=11)
       OutputLinks(0)=(Links=((LinkedOp=SeqAct_Log'SeqAct_Log_2')))
       VariableLinks(0)=(LinkedVariables=(SeqVar_Object'SeqVar_Object_0'))
       VariableLinks(1)=(LinkedVariables=(SeqVar_Float'SeqVar_Float_0'))
       ObjInstanceVersion=2
       ObjPosX=1056
       ObjPosY=184
    End Object
    Begin Object Class=SeqAct_Log Name=SeqAct_Log_0
       LogMessage="Touched"
       ObjInstanceVersion=3
       ObjPosX=336
       ObjPosY=88
       ObjComment="Touched"
    End Object
    Begin Object Class=SeqAct_Delay Name=SeqAct_Delay_0
       Duration=5.000000
       OutputLinks(0)=(Links=((LinkedOp=SeqAct_Log'SeqAct_Log_4'),(LinkedOp=SeqAct_GetProperty'SeqAct_GetProperty_0')))
       ObjInstanceVersion=1
       ObjPosX=336
       ObjPosY=176
    End Object
    Begin Object Class=SeqAct_Log Name=SeqAct_Log_2
       LogMessage="Modified"
       ObjInstanceVersion=3
       ObjPosX=1328
       ObjPosY=184
       ObjComment="Modified"
    End Object
    Begin Object Class=SeqAct_GetProperty Name=SeqAct_GetProperty_0
       PropertyName="Health"
       OutputLinks(0)=(Links=((LinkedOp=SeqAct_Log'SeqAct_Log_3'),(LinkedOp=SeqAct_CastToFloat'SeqAct_CastToFloat_0')))
       VariableLinks(0)=(LinkedVariables=(SeqVar_Object'SeqVar_Object_0'))
       VariableLinks(2)=(LinkedVariables=(SeqVar_Int'SeqVar_Int_0'))
       ObjInstanceVersion=1
       ObjPosX=504
       ObjPosY=192
    End Object
    Begin Object Class=SeqAct_Log Name=SeqAct_Log_3
       LogMessage=" hp"
       VariableLinks(4)=(LinkedVariables=(SeqVar_Int'SeqVar_Int_0'),bHidden=False)
       ObjInstanceVersion=3
       ObjPosX=848
       ObjPosY=96
       ObjComment=" hp"
    End Object
    Begin Object Class=SeqVar_Object Name=SeqVar_Object_0
       ObjInstanceVersion=1
       ObjPosX=264
       ObjPosY=352
    End Object
    Begin Object Class=SeqVar_Int Name=SeqVar_Int_0
       ObjInstanceVersion=1
       ObjPosX=816
       ObjPosY=352
    End Object
    Begin Object Class=SeqAct_CastToFloat Name=SeqAct_CastToFloat_0
       OutputLinks(0)=(Links=((LinkedOp=SeqAct_ModifyHealth'SeqAct_ModifyHealth_0')))
       VariableLinks(0)=(LinkedVariables=(SeqVar_Int'SeqVar_Int_0'))
       VariableLinks(1)=(LinkedVariables=(SeqVar_Float'SeqVar_Float_0'))
       ObjInstanceVersion=1
       ObjPosX=912
       ObjPosY=184
    End Object
    Begin Object Class=SeqVar_Float Name=SeqVar_Float_0
       ObjInstanceVersion=1
       ObjPosX=976
       ObjPosY=344
    End Object
    Begin Object Class=SeqAct_Log Name=SeqAct_Log_4
       LogMessage="Finished"
       ObjInstanceVersion=3
       ObjPosX=472
       ObjPosY=80
       ObjComment="Finished"
    End Object

  10. #10
    MSgt. Shooter Person
    Join Date
    Aug 2011
    Posts
    62

    Default

    Okay i found out why my kismet events are not working. I tried it on default udk map with UTdeathmatch game type and its working fine. But if i use my custom game type and my new built levels that event is not working. All the other kismet events like door open and trigger touch events are working fine but i dont understand why is there a problem in delay and modify health events cause the exact same sequence works fine in default udk maps and game types.

  11. #11
    MSgt. Shooter Person
    Join Date
    Aug 2011
    Posts
    62

    Default

    Okay i delved more into the problem and the real cause is my Enemy class named "Badguy1". Surprisingly if i delete all the "badGuy1" pawns from my level the delay event works fine but if i add "Badguy1" pawns into my level the delay event doesn't seem to work. I have no clue on why this is happening , maybe you guys might know more about the issue, kindly help !

  12. #12
    MSgt. Shooter Person
    Join Date
    Aug 2011
    Posts
    62

    Default

    Here is my badguy1 and badguy1Controller classes. Thanks to the owner for providing this on the internet.

    Code:
    class Badguy1 extends UTPawn placeable;
    
    // members for the custom mesh
    var SkeletalMesh defaultMesh;
    //var MaterialInterface defaultMaterial0;
    var AnimTree defaultAnimTree;
    var array<AnimSet> defaultAnimSet;
    var AnimNodeSequence defaultAnimSeq;
    var PhysicsAsset defaultPhysicsAsset;
    
    var Badguy1Controller MyController;
    
    var float Speed;
    var int BumpDamage;
    var SkeletalMeshComponent MyMesh;
    var bool bplayed;
    var Name AnimSetName;
    
    
    var bool AttAcking;
    
    var () array<NavigationPoint> MyNavigationPoints;
    
    defaultproperties
    {    
        BumpDamage = 3.0;
        Speed=75
    	//AnimSetName="ZombieAttackBiteSeq"
    	AttAcking=false
    
    	defaultMesh=SkeletalMesh'Mypackage2.Zombie'
    	defaultAnimTree=AnimTree'Mypackage2.ZombieAnimTree'
    	defaultAnimSet(0)=AnimSet'Mypackage2.ZombieAnimSetFinal'
    	defaultPhysicsAsset=PhysicsAsset'EternalCrisis_Characters.Female.Human_Athletic_Physics'
    
    
    	Begin Object Name=WPawnSkeletalMeshComponent
    		bOwnerNoSee=false
    		CastShadow=true
    
    		//CollideActors=TRUE
    		BlockRigidBody=true
    		BlockActors=true
    		BlockZeroExtent=true
    		//BlockNonZeroExtent=true
    
    		bAllowApproximateOcclusion=true
    		bForceDirectLightMap=true
    		bUsePrecomputedShadows=false
    		LightEnvironment=MyLightEnvironment
    		//Scale=0.5
    		SkeletalMesh=SkeletalMesh'Mypackage2.Zombie'
            AnimSets(0)=AnimSet'Mypackage2.ZombieAnimSetFinal'
    		AnimTreeTemplate=AnimTree'Mypackage2.ZombieAnimTree'
    
    	End Object
    
    	mesh = WPawnSkeletalMeshComponent
    
    	Begin Object Name=CollisionCylinder
    		CollisionRadius=+0041.000000
    		CollisionHeight=+0044.000000
    		BlockZeroExtent=false
    	End Object
    	CylinderComponent=CollisionCylinder
    	CollisionComponent=CollisionCylinder
    
    	bCollideActors=true
    	bPushesRigidBodies=true
    	bStatic=False
    	bMovable=True
    
    	bAvoidLedges=true
    	bStopAtLedges=true
    
    	LedgeCheckThreshold=0.5f
    	
    }
    
    simulated function PostBeginPlay()
    {
    	super.PostBeginPlay();
    	//if (Controller == none)
    	//	SpawnDefaultController();
    	SetPhysics(PHYS_Walking);
    	if (MyController == none)
    	{
    		MyController = Spawn(class'Badguy1Controller', self);
    		MyController.SetPawn(self);		
    	}
    
        //I am not using this
    
    }
    
    function SetAttacking(bool atacar)
    {
    	AttAcking = atacar;
    }
    
    
    
    simulated event Tick(float DeltaTime)
    {
    	local AITestPawn gv;
    
    	super.Tick(DeltaTime);
    	MyController.Tick(DeltaTime);
    
    	
    	foreach CollidingActors(class'AITestPawn', gv, 200)
    	foreach VisibleCollidingActors(class'AITestPawn', gv, 100)
    	{
    		if(AttAcking && gv != none)
    		{
    			if(gv.Health > 0)
    			{
    				//Worldinfo.Game.Broadcast(self, "Colliding with player : " @ gv.Name);
                              gv.Bump(self,CollisionComponent,vect(0,0,0));
    			}
    		}
    	}
    }
    
    
    
    simulated function SetCharacterClassFromInfo(class<UTFamilyInfo> Info)
    {
    	Mesh.SetSkeletalMesh(defaultMesh);
    	//Mesh.SetMaterial(0,defaultMaterial0);
    	Mesh.SetPhysicsAsset(defaultPhysicsAsset);
    	Mesh.AnimSets=defaultAnimSet;
    	Mesh.SetAnimTreeTemplate(defaultAnimTree);
    
    }
    And badguy1Controller class

    Code:
    class Badguy1Controller extends AIController;
    
    var Badguy1 MyBadguy1Pawn;
    var Pawn thePlayer;
    var Actor theNoiseMaker;
    var Vector noisePos;
    
    var () array<NavigationPoint> MyNavigationPoints;
    var NavigationPoint MyNextNavigationPoint;
    
    var int actual_node;
    var int last_node;
    
    var float perceptionDistance;
    var float hearingDistance;
    var float attackDistance;
    var int attackDamage;
    
    var float distanceToPlayer;
    var float distanceToTargetNodeNearPlayer;
    
    var Name AnimSetName;
    
    var bool AttAcking;
    var bool followingPath;
    var bool noiseHeard;
    var Float IdleInterval;
    
    defaultproperties
    {
        attackDistance = 50
        attackDamage = 10
        perceptionDistance = 2000
    
    	//AnimSetName ="ATTACK"
    	actual_node = 0
    	last_node = 0
    	followingPath = true
    	IdleInterval = 2.5f
    
    }
    
    function SetPawn(Badguy1 NewPawn)
    {
        MyBadguy1Pawn = NewPawn;
    	Possess(MyBadguy1Pawn, false);
    	MyNavigationPoints = MyBadguy1Pawn.MyNavigationPoints;
    }
    
    function Possess(Pawn aPawn, bool bVehicleTransition)
    {
        if (aPawn.bDeleteMe)
    	{
    		`Warn(self @ GetHumanReadableName() @ "attempted to possess destroyed Pawn" @ aPawn);
    		 ScriptTrace();
    		 GotoState('Dead');
        }
    	else
    	{
    		Super.Possess(aPawn, bVehicleTransition);
    		Pawn.SetMovementPhysics();
    		
    		if (Pawn.Physics == PHYS_Walking)
    		{
    			Pawn.SetPhysics(PHYS_Falling);
    	    }
        }
    }
    
    
    state Idle
    {
    
        event SeePlayer(Pawn SeenPlayer)
    	{
    	    thePlayer = SeenPlayer;
            distanceToPlayer = VSize(thePlayer.Location - Pawn.Location);
            if (distanceToPlayer < perceptionDistance)
            {
            	// Worldinfo.Game.Broadcast(self, "I can see you!!");
                GotoState('Chaseplayer');
            }
        }
    
    Begin:
       // Worldinfo.Game.Broadcast(self, "!!!!!!!  idle  !!!!!!!!");
    
    	Pawn.Acceleration = vect(0,0,0);
    	MyBadguy1Pawn.SetAttacking(false);
    
    	Sleep(IdleInterval);
    
    	//Worldinfo.Game.Broadcast(self, "!!!!!!!  Going to FollowPath  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    	followingPath = true;
    	actual_node = last_node;
    	GotoState('FollowPath');
    
    }
    
    state Chaseplayer
    {
      Begin:
    	
    	MyBadguy1Pawn.SetAttacking(false);
        Pawn.Acceleration = vect(0,0,1);
    	
        while (Pawn != none && thePlayer.Health > 0)
        {
    
    
    		if (ActorReachable(thePlayer))
    		{
    			distanceToPlayer = VSize(thePlayer.Location - Pawn.Location);
    			if (distanceToPlayer < attackDistance)
    			{
    				GotoState('Attack');
    				break;
    			}
    			else //if(distanceToPlayer < 300)
    			{
    				MoveToward(thePlayer, thePlayer, 20.0f);
    				if(Pawn.ReachedDestination(thePlayer))
    				{
    					GotoState('Attack');
    					break;
    				}
    			}
    		}
    		else
    		{
    			MoveTarget = FindPathToward(thePlayer,,perceptionDistance + (perceptionDistance/2));
    			if (MoveTarget != none)
    			{
    				//Worldinfo.Game.Broadcast(self, "Moving toward Player");
    
    				distanceToPlayer = VSize(MoveTarget.Location - Pawn.Location);
    				if (distanceToPlayer < 100)
    					MoveToward(MoveTarget, thePlayer, 20.0f);
    				else
    					MoveToward(MoveTarget, MoveTarget, 20.0f);	
    		
    				//MoveToward(MoveTarget, MoveTarget);
    			}
    			else
    			{
    				GotoState('Idle');
    				break;
    			}		
    		}
    
    		Sleep(1);
        }
    }
    
    state Attack
    {
     Begin:
    	Pawn.Acceleration = vect(0,0,0);
    	MyBadguy1Pawn.SetAttacking(true);
    	while(true && thePlayer.Health > 0)
    	{   
    		//Worldinfo.Game.Broadcast(self, "Attacking Player");
    
    		distanceToPlayer = VSize(thePlayer.Location - Pawn.Location);
            if (distanceToPlayer > attackDistance * 2)
            { 
    			MyBadguy1Pawn.SetAttacking(false);
                GotoState('Chaseplayer');
    			break;
            }
    		Sleep(1);
    	}
    	MyBadguy1Pawn.SetAttacking(false);
    }
    
    
    auto state FollowPath
    {
    	event SeePlayer(Pawn SeenPlayer)
    	{
    	    thePlayer = SeenPlayer;
            distanceToPlayer = VSize(thePlayer.Location - Pawn.Location);
            if (distanceToPlayer < perceptionDistance)
            { 
            	//Worldinfo.Game.Broadcast(self, "I can see you!!");
    			noiseHeard = true;
    			followingPath = false;
                GotoState('Chaseplayer');
            }
        }
    
     Begin:
    
    	while(followingPath)
    	{
    		MoveTarget = MyNavigationPoints[actual_node];
    
    		if(Pawn.ReachedDestination(MoveTarget))
    		{
    			//WorldInfo.Game.Broadcast(self, "Encontrei o node");
    			actual_node++;
    			
    			if (actual_node >= MyNavigationPoints.Length)
    			{
    				actual_node = 0;
    			}
    			last_node = actual_node;
    			
    			MoveTarget = MyNavigationPoints[actual_node];
    		}	
    
    		if (ActorReachable(MoveTarget))
    		{
    			distanceToPlayer = VSize(MoveTarget.Location - Pawn.Location);
    			if (distanceToPlayer < perceptionDistance / 3)
    				MoveToward(MoveTarget, MyNavigationPoints[actual_node + 1]);
    			else
    				MoveToward(MoveTarget, MoveTarget);	
    		}
    		else
    		{
    			MoveTarget = FindPathToward(MyNavigationPoints[actual_node]);
    			if (MoveTarget != none)
    			{
    				
    			//	SetRotation(RInterpTo(Rotation,Rotator(MoveTarget.Location),Delta,90000,true));
    
    				MoveToward(MoveTarget, MoveTarget);
    			}
    		}
    
    		Sleep(1);
    	}
    }

  13. #13

    Default

    I didn't check the code but...
    Try to add a Log action after your touch event in order to know if the Trigger is touched always.

    As you say, it doesn't work if you have enemies on your map, it probably has someething to do with the trigger event itself which is only activated once at default settings.

    Try to set MaxTriggerCount of the trigger event to 0.

  14. #14
    MSgt. Shooter Person
    Join Date
    Aug 2011
    Posts
    62

    Default

    Yes Snake maxtriggercount is 0. Okay so if there was some problem with triggers i tried using the level loaded event instead and the same problem again.The delay sequence works fine without enemies but it just doesn't work when i put enemies into my levels. This has affected the whole objective of my game. Now i need to either compromise on my enemies or timers in the levels. Hell this just sucks !!


 

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.