Results 1 to 7 of 7
  1. #1
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Posts
    182

    Default [solved] Kismet Event Destroyed not called with custom KActorSpawnable

    Hi,

    I created a custom KActorSpawnable and use an Actor Factory in Kismet to create them. I want a fixed maximum amount of them in the level and create new ones when others are destroyed, so I created this Kismet setup:
    This Image Was Automatically Resized by using the Screenshot Tag.  Click to view the full version

    To keep track of the currently existing actors I use an objectlist. The problem is that the destroyed event is never called when the kactors destroy after their ticks.
    My Actor code is this:
    Code:
    class Leukocyte extends KActorSpawnable
    	placeable;
    
    var float LifeTime;
    
    function Tick(float DeltaTime)
    {
    	super.Tick(DeltaTime);
    
    	LifeTime+=DeltaTime;
    	if(LifeTime>15)
    	{
    		Destroy();
    	}
    }
    
    DefaultProperties
    {
    	Begin Object Name=StaticMeshComponent0
    		LightEnvironment=MyLightEnvironment
    		StaticMesh=StaticMesh'leukocyte.Mesh.leukocyte'
    		CastShadow=false
    		BlockRigidBody=true
    		CollideActors=true
    	End Object
    
    	CollisionType=COLLIDE_BlockAll
    
    	Begin Object Class=ParticleSystemComponent Name=ParticleSystemComponent1
            Template=ParticleSystem'leukocyte.Effects.leukocyte_extends'
        End Object
        Components.Add(ParticleSystemComponent1)
    
    	bWakeOnLevelStart=true
    
    	LifeTime=0;
    }
    Is that a bug or am I missing something completly obvious?

    Edit:

    Unchecking "Player Only" solved everything

    greetings
    Last edited by FTC; 02-11-2012 at 05:14 AM. Reason: found a solution

  2. #2
    Iron Guard
    Join Date
    Mar 2011
    Location
    U.S.
    Posts
    836
    Gamer IDs

    Gamertag: ICHAINSAWDURMOM

    Default

    I'm not 100% sure what you are trying to do, but every 15 ticks (pretty quickly) you are destroying these actors. If you can give me a more detailed description of what you are trying to do, I may can help you with a better solution. That being said, make your the bDeleteMe is set correctly and it should be able to destroy the object. I would also make logs in your Destroy() because it may never get destroyed in the first place. There are alternate ways to doing this as well, like having a named Remote Event called from script every time one of these should die. This way, you don't have to keep track of every single reference of these things, but rather, any one that enters the world and dies calls this same event and this event can handle the decrement variable and any other housekeeping you need.

  3. #3
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Posts
    182

    Default

    It is not 15 ticks, because DeltaTime is about 0.016 every tick so the actor lives for several seconds. I try to emulate something like a KActor particle system with a maximum count (2 in this example). When the Destroy() function is called the actor gets deleted (at least the visual part does, because it is gone from the scene). When I try to set bDeleteMe in the Tick() or other functions it tells me I cannot assign const variables and when I set it to true in the defaultproperties I cannot spawn the actor anymore. As for remote events, that would be an idea but I read several times that those are for kismet internal event handling and are not meant to be used with script.

    greetings

  4. #4
    Redeemer
    Join Date
    Dec 2008
    Location
    Germany
    Posts
    1,236

    Default

    If I dont mix things up, KActors don't get destroyed, they get shutdown.
    So you have to find a workaround.
    2B || !(2B)

  5. #5
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Posts
    182

    Default

    I changed the super class from KActorSpawnable to Actor to test if KActors prevented the Destroyed event but no change. However the Actors definitly get destroyed in both cases. I looked it up with the -wxwindows interface. Could it be that something changed in UDK? I remember a similar setup that I did a long while ago that worked... That is why I asked for something that I overlooked.

    greetings

  6. #6
    Redeemer
    Join Date
    Dec 2008
    Location
    Germany
    Posts
    1,236

    Default

    You might want to check what the Destroy() call returns ("true if destroyed, false if indestructible"), also check if Destroy/Destroyed is called at all. Or if the log says anything.
    2B || !(2B)

  7. #7
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Posts
    182

    Default

    I did all those things and everything indicated the successful deletion, but still no event. So I went through all the kismet piece by piece and found a checkbox to be the problem:

    Unchecking "Player Only" solved _everything_

    Well so much for overlooking something
    Thanks for your help


 

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.