Tick() problems

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

bigjohn

New Member
Feb 23, 2004
45
0
0
44
los angeles
Hi
I've got several actors which contain either a tick event or a tick function in them, yet never get ticked. I narrowed down a bunch of them. For instance, one was extending Controller and I had to use "event PlayerTick( float DeltaTime )", instead of just tick. Another was an interaction and it needed a bRequiresTick=True in defaultproperties. This one last actor though just doesn't get ticked, and I can't figure it out. It's header is simply :
class BlankFighter extends Actor;
and I've tried putting an "Enable('Tick');" in postbeginplay. Anyone got any idea? Also, what's the difference between a tick event and a function? and why is there a tick and a playertick?
thanks
 

Mychaeel

New Member
There shouldn't be a problem with Tick being called in a straight Actor subclass. However, several Actor properties can affect whether and where Tick is executed.

Could you please post the following sections of your BlankFighter class?:
  • the "class" statement,
  • the "Tick" function (including any "state" declaration around it, if applicable), and
  • the "defaultproperties" section.

By the way: Where (client? server?) do you want Tick to be executed?
 

bigjohn

New Member
Feb 23, 2004
45
0
0
44
los angeles
Here's the code for the class. I removed the contents of my movement function just cause it's long for the purpose of keeping this thing readable.

Code:
//============================================================
//  BlankFighter
//============================================================

class BlankFighter extends Actor;

var int Speed_Forward, Speed_Back, Speed_Jump;
var bool bIsMoving, bIsJumping;

simulated function PostBeginPlay()
{
	Super.PostBeginPlay();
	bIsMoving=False;
	bIsJumping=False;
	Enable('Tick');
}

function Movement(string action)
{
...
}

event Tick( float DeltaTime )
{
	Level.GetLocalPlayerController().ClientMessage("In Tick");
	if (Physics == Phys_None) {
		SetPhysics(PHYS_Walking);
		bIsJumping = False;
		bIsMoving = False;
	}
}

defaultproperties
{
    bBlockActors = False
    Mesh=SkeletalMesh'KnightSkiesAnims.Merc'
    //HitEmitter=Class'KnightSkies.HitFX'
    Skins(0)=Texture'PlayerSkins.MercMaleBBodyA_0'
    Skins(1)=Texture'PlayerSkins.MercMaleBHeadB'
    DrawType=DT_Mesh
    Physics=Phys_Walking
    bShouldBaseAtStartup=true
    bCollideActors=True
	bCollideWorld=True

	// Movement Speeds
	Speed_Forward = 100;
	Speed_Back = -100;
	Speed_Jump = 300; // How high to jump
}
 

bigjohn

New Member
Feb 23, 2004
45
0
0
44
los angeles
I solved this problem. What it was is that I have another class extending BlankFighter which also has a tick in it. However, that tick didn't have a super.tick() call in it, so blankfighter's tick never got called. I'm still not clear on the differences between a tick event and a tick function though...
 

Mychaeel

New Member
The difference between "event" and "function" is non-existent on UnrealScript level. (It only affects what code is generated when C++ header files are created from UnrealScript sources; "event"s are meant to be called by native code, just as the Tick function is called directly by the engine.)
 
Last edited: