Custom pet pawn & Custom game objective event

Feedback, discussion & bug reporting on current maps
DaveTheBlaze
Posts: 17
Joined: Sun 15. Mar 2020, 18:28
Description: CovidFreeMapper

Custom pet pawn & Custom game objective event

Post by DaveTheBlaze » Tue 21. Apr 2020, 15:13

Me again, yay.
On behalf of the other problems on my map I open up another thread.

------------------------------------------------------------------------------------------------------------------------------------------------------------------
Problem #1:
I've found a nice mesh on another map and decided to implement it as a pawn on my own map.
I created this subclass for xPawn -> Monster:
//=============================================================================
// DogPet.
//=============================================================================
class DogPet extends Monster
placeable;
I placed the actor inside my map and changed the default mesh to the mesh I wanted.
It looks like this:
DogPet_Pawn.jpg
When the pawn is close by it will start to follow the player around (like a Monster class would do).
Now the problem: The orientation is wrong. This means the pawn constantly looks to the side while walking towards you.
How can I fix this? Do I have to add a function which will control the pawns orientation/direction or is something wrong in the Movement settings of the actor itself (maybe an offset in rotation or something)?

Those are the actor properties:
DogPet_Actor_1of2.jpg
DogPet_Actor_2of2.jpg
PS: I don't own the model of the actor (e.g. in Maya). Thats why I can't just render the model in a different direction.
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Problem #2:
I've found a custom game objective on another map, which involves picking up and delivering a certain objective found on the map.
The objective itself works fine.
This is the code for the delivery actor:
//=============================================================================
// MyProximityObjective.
//=============================================================================
class MyProximityObjectiveBLUE_TEST extends ProximityObjective
placeable;

#exec OBJ LOAD FILE=AnnouncerAssault.uax

var GameObject_EnergyCore EC;


function bool IsRelevant( Pawn Instigator, bool bAliveCheck )
{
Local PlayerReplicationInfo PRI;

PRI = Instigator.PlayerReplicationInfo;
if ( IsRelevant2( Instigator, bAliveCheck )
&& (PRI != None) && (PRI.HasFlag != None) && PRI.HasFlag.IsA('GameObject_EnergyCore') )
return true;

return false;
}

function bool IsRelevant2( Pawn P, bool bAliveCheck )
{
if ( !IsActive() || !UnrealMPGameInfo(Level.Game).CanDisableObjective( Self ) )
return false;

if ( !ClassIsChildOf(P.Class, ConstraintPawnClass) )
return false;

Instigator = FindInstigator( P );
if ( (Instigator.GetTeam() == None) || (Instigator.GetTeam().TeamIndex != DefenderTeamIndex) )
return false;

if ( bAliveCheck )
{
if ( Instigator.Health < 1 || Instigator.bDeleteMe || !Instigator.IsPlayerPawn() )
return false;
}

if ( bBotOnlyObjective && (PlayerController(Instigator.Controller) != None) )
return false;

return true;
}

function DisableObjective(Pawn Instigator)
{
local PlayerReplicationInfo PRI;
local GameObject_EnergyCore EnergyCore;

PRI = Instigator.PlayerReplicationInfo;

if ( !IsActive() || PRI == None || PRI.HasFlag == None || !PRI.HasFlag.IsA('GameObject_EnergyCore') )
return;

PRI.Team.Score += 1.0;
EnergyCore = GameObject_EnergyCore(PRI.HasFlag);
EnergyCore.ClearHolder();
EnergyCore.GotoState('Home');
EnergyCore.SendHome();
EnergyCore.HomeBase.bDisabled = false;
EnergyCore.HomeBase.SetActive(true);
//AnnounceScore(PRI.Team.TeamIndex);
//ASGameInfo(Level.Game).RespawnPlayer( Instigator.Controller, false );
}
And its actor properties:
ProximityObj_Actor_1of2.jpg
ProximityObj_Actor_2of2.jpg
Normally an announcer would announce the score after delivering the objective but as you can see at the end of the code I commented that part out because I wanted to put another sound for after delivering the object.
I then tried to set my custom sound inside the actor properties ('Announcer_DisabledObjective').
As it turns out the sound is not played when delivering the object. I did some further tests and it looks like that the custom objective isn't triggering an event at all. But why? I don't see a problem in the actor code, so why is the objective not triggering an event or any sounds?

PS: the sound works fine, it was coded like the rest of my sound files which work perfectly fine.


As always, thanks in advance for helping me out.
Greets, Dave
You do not have the required permissions to view the files attached to this post.
Last edited by DaveTheBlaze on Thu 14. May 2020, 18:02, edited 2 times in total.

DaveTheBlaze
Posts: 17
Joined: Sun 15. Mar 2020, 18:28
Description: CovidFreeMapper

Custom pet pawn & Custom game objective event

Post by DaveTheBlaze » Thu 14. May 2020, 17:59

Update:

I solved my first problem by exporting the static mesh out of the editor and import it to Blender, rotating it and importing it back to the editor.
I didn't even know there was a way to export meshes out of the editor into a readable format.

I'm still struggling with my 2nd problem.
Does anyone know why the objective doesn't trigger an event when achieving it?

Or can anyone tell me how to script a code to trigger an event manually from inside the code itself?

Greets, Dave