Page 1 of 1

DXOnly - Why isn't it calling PlayerTick?

Posted: Sun Dec 29, 2013 5:24 am
by bjorn98009_91
Hi!

Anyone around that knows why the map DXOnly doesn't call PlayerTick? The map DX calls PlayerTick as it should, but DXOnly does not. Anyone got any ideas on how to run my code if I can't use PlayerTick?

Re: DXOnly - Why isn't it calling PlayerTick?

Posted: Sun Dec 29, 2013 9:08 pm
by Hanfling
Maybe use GameInfo's Tick() ?

or MissionScript's ?

Re: DXOnly - Why isn't it calling PlayerTick?

Posted: Mon Dec 30, 2013 8:59 pm
by bjorn98009_91
Hmm, turns out the code must be run in the player class or parent classes to that, since I need access to the ClientSetMusic function. I managed to get the game print out logs for the map using

event TravelPostAccept(), event PreBeginPlay() and event PostBeginPlay()

However, if calling ClientSetMusic in any of those functions it will do nothing (I'm assuming, since the music player isn't set up at that stage.). I can't use missionscripting, since I need to run my own UpdateDynamicMusic function (or atleast be able to access ClientSetMusic). Can't use GameInfo either, or could I find the playerpawn from my MissionScript/GameInfo sript and use player.UpdateDynamicMusic(0)? If so, how do I do that?

Edit: Don't answer that! I'm working on something now that might work.

Re: DXOnly - Why isn't it calling PlayerTick?

Posted: Wed Jan 01, 2014 10:27 pm
by bjorn98009_91
Alright now I've gotten the music to work by using the Timer function in my custom GameInfo.

Thanks for the tip Hanfling! :)

Re: DXOnly - Why isn't it calling PlayerTick?

Posted: Wed Jan 01, 2014 11:23 pm
by Hanfling
Correct answer:

Code: Select all

// DeusExPlayer.uc

// ----------------------------------------------------------------------
// TravelPostAccept()
// ----------------------------------------------------------------------

event TravelPostAccept()
{
		// [...]

		// hack for the DXOnly.dx splash level
		if (info.MissionNumber == -1)
		{
			ShowHud(False);
			GotoState('Paralyzed');
			return;
		}
		// [...]
}

// [...]

// ----------------------------------------------------------------------
// state Paralyzed
// ----------------------------------------------------------------------

state Paralyzed
{
	// [...]

	event PlayerTick(float deltaTime)
	{
		UpdateInHand();
		ShowHud(False);
		ViewFlash(deltaTime);
	}

	// [...]
}

So Global.PlayerTick() is not called.

Re: DXOnly - Why isn't it calling PlayerTick?

Posted: Thu Jan 02, 2014 12:09 am
by bjorn98009_91
Ahh, I did notice that it went to state 'Paralyzed' but didn't check what that state meant.