Possessed PlayerPawn

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Possessed PlayerPawn

Post by Cybernetic pig »

Code: Select all

ScriptLog: PostPostBeginPlay Called
ScriptLog: There is no player :/
Log: Spawning new actor for Viewport WindowsViewport0
ScriptLog: Team 0
ScriptLog: Login: Player
ScriptLog: MYCHK:: 5 :: 79
ScriptLog: Lean Keys UNDEFINED, disabling tiptoes
ScriptLog: Team 0
Log: Possessed PlayerPawn: JCDentonMale 01_NYC_UNATCOIsland.JCDentonMale1
I used PostPostBeginPlay() of an actor already placed in the map to log if (player == none) log("There is no player :/");
player being player = DeusExPlayer(GetPlayerPawn());

So, to be able to reference the player before possession using a beginPlay function, what can I do? Is there a beginPlay function (or something similar called once the object is spawned) that is called after player possession, in the case of pre-placed actors in a map?
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Possessed PlayerPawn

Post by DDL »

Prebeginplay, beginplay, postbeginplay and even postpostbeginplay. There are loads.

What are you trying to do, exactly? If your code is critically dependent on a possessed playerpawn, why not have the playerpawn itself call it once possessed?

I've put fucktons of code into my playerclass because it's one of the few things you can guarantee will definitely be there, and doing stuff, when you want things to happen.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Possessed PlayerPawn

Post by Cybernetic pig »

DDL wrote:Prebeginplay, beginplay, postbeginplay and even postpostbeginplay. There are loads.
Yeah, but all are called before player possession. PostPostBeginPlay being the last called.
What are you trying to do, exactly? If your code is critically dependent on a possessed playerpawn, why not have the playerpawn itself call it once possessed?
I guess I'll have to. I want to do a variety of things upon initialization that involve both DeusExPlayer and various actors.

Thanks.
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Possessed PlayerPawn

Post by DDL »

I wrote all my stuff to work with vanilla deusex.u (coz I didn't like the idea of replacing core code), so my player class literally sweeps through the entire level at runtime and replaces every actor with my own modified versions, transferring properties across as necessary.

It's insanely inefficient coding and would probably make any rational programmer weep, but the take home message is: it's doable.

I'd also be cautious about interpreting log messages, especially with startup stuff. I've found some things seem to merrily log that they can't find a player, but then work entirely correctly as if they had found the player, so it's....confusing.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: Possessed PlayerPawn

Post by Hanfling »

@cypig:
You could try to use event DetailChange() in GameInfo, or use PostLogin() on GameInfo, etc..

@DDL:
I would have prefered putting that into a Mutator, as that is exactly what they are supposed to do.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Possessed PlayerPawn

Post by Cybernetic pig »

Yeah, PostLogin was what was needed. Thanks.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: Possessed PlayerPawn

Post by Cybernetic pig »

Bunged it in TravelPostAccept() in DeusExPlayer in the end, definitely more appropriate.
Post Reply