Browse Source

Spawn only if ground under feet

- Increase initial hunger level for faster debugging of need/goal pipeline
- UnrealMovementComponent only spawns Actors if they have a hit point on the world. It'll spam tons of messages at the moment
combatComponentRefactor
Macoy Madson 6 years ago
parent
commit
0f14650c71
  1. BIN
      GalavantUnreal/Content/TopDownCPP/Maps/TopDownExampleMap.umap
  2. BIN
      GalavantUnreal/Content/TopDownCPP/Maps/TopDownExampleMap_BuiltData.uasset
  3. 9
      GalavantUnreal/Source/GalavantUnreal/GalaEntityComponents/UnrealMovementComponent.cpp
  4. 4
      GalavantUnreal/Source/GalavantUnreal/GalavantUnrealMain.cpp

BIN
GalavantUnreal/Content/TopDownCPP/Maps/TopDownExampleMap.umap

Binary file not shown.

BIN
GalavantUnreal/Content/TopDownCPP/Maps/TopDownExampleMap_BuiltData.uasset

Binary file not shown.

9
GalavantUnreal/Source/GalavantUnreal/GalaEntityComponents/UnrealMovementComponent.cpp

@ -319,6 +319,7 @@ void UnrealMovementComponent::SpawnActorIfNecessary(
FVector position(ToFVector(component->data.WorldPosition));
FActorSpawnParameters spawnParams;
bool hitWorld = false;
// Raycast to find the ground to spawn on
// TODO: Far future: If anything is ever flying, we'll need to not do this
{
@ -333,9 +334,17 @@ void UnrealMovementComponent::SpawnActorIfNecessary(
ECollisionChannel::ECC_WorldDynamic))
{
position.Z = hitResult.ImpactPoint.Z + 100.f;
hitWorld = true;
}
}
if (!hitWorld)
{
LOGD << "Entity " << component->entity
<< " will NOT spawn actor/character because it doesn't have a place to stand";
return;
}
LOGD << "Entity " << component->entity
<< " spawning actor/character because it should still be rendered";

4
GalavantUnreal/Source/GalavantUnreal/GalavantUnrealMain.cpp

@ -112,7 +112,7 @@ void InitializeResources()
static gv::NeedDef TestHungerNeed;
TestHungerNeed.Type = gv::NeedType::Hunger;
TestHungerNeed.Name = "Hunger";
TestHungerNeed.InitialLevel = 0.f;
TestHungerNeed.InitialLevel = 70.f;
TestHungerNeed.MaxLevel = 300.f;
TestHungerNeed.MinLevel = 0.f;
TestHungerNeed.UpdateRate = 10.f;
@ -350,7 +350,7 @@ void AGalavantUnrealMain::InitializeGalavant()
{
gv::g_PlanComponentManager.Initialize(&WorldStateManager, &TaskEventCallbacks);
// PlanComponentManager.DebugPrint = true;
//gv::g_PlanComponentManager.DebugPrint = true;
}
{

Loading…
Cancel
Save