From 5b80ba4398192a60f62a0270690c0e70c64193e5 Mon Sep 17 00:00:00 2001 From: Jocke Date: Fri, 4 Mar 2016 08:22:48 +0100 Subject: [PATCH 01/14] Made 3 new healthHUDs 1 for each class. --- assets | 2 +- .../Schema/Entities/HealthHUDAssault.xml | 156 ++++++++++++++++++ .../Schema/Entities/HealthHUDDefender.xml | 156 ++++++++++++++++++ resources/Schema/Entities/HealthHUDSniper.xml | 156 ++++++++++++++++++ 4 files changed, 469 insertions(+), 1 deletion(-) create mode 100644 resources/Schema/Entities/HealthHUDAssault.xml create mode 100644 resources/Schema/Entities/HealthHUDDefender.xml create mode 100644 resources/Schema/Entities/HealthHUDSniper.xml diff --git a/assets b/assets index 5d761454..d3be164b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 5d7614549bfb6c497bfee12e2e295293a08e8e5e +Subproject commit d3be164b6929ed0f3847bf7b53c1247843a9eae6 diff --git a/resources/Schema/Entities/HealthHUDAssault.xml b/resources/Schema/Entities/HealthHUDAssault.xml new file mode 100644 index 00000000..efd91399 --- /dev/null +++ b/resources/Schema/Entities/HealthHUDAssault.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + 1 + + + + 100/100 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + 1 + + + + + Textures/HealthHUD3.png + + + + + + + + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Assault-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Defender-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Sniper-01.png + + false + + + + + + + + + + + + + + + + + + + + Textures/Icons/Abilities/Superman-01.png + + false + + + + + + + + + + + + + 0.0 + Fonts/DroidSans.ttf,64 + + false + + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/HealthHUDDefender.xml b/resources/Schema/Entities/HealthHUDDefender.xml new file mode 100644 index 00000000..504fbd21 --- /dev/null +++ b/resources/Schema/Entities/HealthHUDDefender.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + 1 + + + + 100/100 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + 1 + + + + + Textures/HealthHUD3.png + + + + + + + + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Assault-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Defender-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Sniper-01.png + + false + + + + + + + + + + + + + + + + + + + + Textures/Icons/Abilities/SheildDots-01.png + + false + + + + + + + + + + + + + 0.0 + Fonts/DroidSans.ttf,64 + + false + + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/HealthHUDSniper.xml b/resources/Schema/Entities/HealthHUDSniper.xml new file mode 100644 index 00000000..13b6dc4d --- /dev/null +++ b/resources/Schema/Entities/HealthHUDSniper.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + 1 + + + + 100/100 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + 1 + + + + + Textures/HealthHUD3.png + + + + + + + + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Assault-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Defender-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Sniper-01.png + + false + + + + + + + + + + + + + + + + + + + + Textures/Icons/Abilities/Dash-01.png + + false + + + + + + + + + + + + + 0.0 + Fonts/DroidSans.ttf,64 + + false + + + + + + + + + + + + + + From 7ba0e4ea9d8b2e5319feaad3a8a977cba92c3f90 Mon Sep 17 00:00:00 2001 From: viktorljung Date: Fri, 4 Mar 2016 08:35:02 +0100 Subject: [PATCH 02/14] Run, Strafe and jump animations now playing --- .../Editor/EditorCameraInputController.h | 4 +- .../Engine/Input/FirstPersonInputController.h | 96 ++++++++++++- include/Engine/Rendering/BlendTree.h | 1 + .../Engine/Rendering/EAutoAnimationBlend.h | 2 + resources/Schema/Entities/Player.xml | 13 +- src/Engine/Editor/EditorSystem.cpp | 2 +- src/Engine/Rendering/AnimationSystem.cpp | 2 +- src/Engine/Rendering/BlendTree.cpp | 16 +++ src/Game/Systems/PlayerDeathSystem.cpp | 4 - src/Game/Systems/PlayerMovementSystem.cpp | 136 +++++++++++++++++- .../Systems/Weapon/AssaultWeaponBehaviour.cpp | 2 +- 11 files changed, 253 insertions(+), 25 deletions(-) diff --git a/include/Engine/Editor/EditorCameraInputController.h b/include/Engine/Editor/EditorCameraInputController.h index 6cb31d99..257e3424 100644 --- a/include/Engine/Editor/EditorCameraInputController.h +++ b/include/Engine/Editor/EditorCameraInputController.h @@ -12,8 +12,8 @@ template class EditorCameraInputController : public FirstPersonInputController { public: - EditorCameraInputController(EventBroker* eventBroker, unsigned int playerID) - : FirstPersonInputController(eventBroker, playerID) + EditorCameraInputController(EventBroker* eventBroker, unsigned int playerID, EntityWrapper playerEntity) + : FirstPersonInputController(eventBroker, playerID, playerEntity) { EVENT_SUBSCRIBE_MEMBER(m_EMousePress, &EditorCameraInputController::OnMousePress); EVENT_SUBSCRIBE_MEMBER(m_EMouseRelease, &EditorCameraInputController::OnMouseRelease); diff --git a/include/Engine/Input/FirstPersonInputController.h b/include/Engine/Input/FirstPersonInputController.h index ed9469bd..2c7013e4 100644 --- a/include/Engine/Input/FirstPersonInputController.h +++ b/include/Engine/Input/FirstPersonInputController.h @@ -6,12 +6,13 @@ #include "../Core/ELockMouse.h" #include "../Game/Events/EDashAbility.h" #include "InputHandler.h" +#include "Rendering/EAutoAnimationBlend.h" template class FirstPersonInputController : public InputController { public: - FirstPersonInputController(EventBroker* eventBroker, int playerID); + FirstPersonInputController(EventBroker* eventBroker, int playerID, EntityWrapper playerEntity); virtual const glm::vec3 Movement() const { return m_Movement; } virtual const glm::vec3 Rotation() const { return m_Rotation; } @@ -34,6 +35,8 @@ public: protected: const int m_PlayerID; + EntityWrapper m_PlayerEntity; + bool m_MouseLocked = false; glm::vec3 m_Rotation; glm::vec3 m_Movement; @@ -65,9 +68,10 @@ protected: }; template -FirstPersonInputController::FirstPersonInputController(EventBroker* eventBroker, int playerID) +FirstPersonInputController::FirstPersonInputController(EventBroker* eventBroker, int playerID, EntityWrapper playerEntity) : InputController(eventBroker) , m_PlayerID(playerID) + , m_PlayerEntity(playerEntity) { EVENT_SUBSCRIBE_MEMBER(m_ELockMouse, &FirstPersonInputController::OnLockMouse); EVENT_SUBSCRIBE_MEMBER(m_EUnlockMouse, &FirstPersonInputController::OnUnlockMouse); @@ -118,13 +122,75 @@ bool FirstPersonInputController::OnCommand(const Events::InputComm if (e.Command == "Forward") { float val = glm::clamp(e.Value, -1.f, 1.f); m_Movement.z = -val; + + if (m_PlayerEntity.Valid()) { + EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel"); + if (playerModel.Valid()) { + if (val > 0) { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.1; + aeb.NodeName = "Run"; + aeb.RootNode = playerModel; + aeb.Start = true; + m_EventBroker->Publish(aeb); + } else if (val < 0) { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.1; + aeb.NodeName = "Run"; + aeb.RootNode = playerModel; + aeb.Start = true; + aeb.Reverse = true; + m_EventBroker->Publish(aeb); + } else { + + } + } + } } if (e.Command == "Right") { float val = glm::clamp(e.Value, -1.f, 1.f); m_Movement.x = val; + + if (m_PlayerEntity.Valid()) { + EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel"); + + if (playerModel.Valid()) { + if (val > 0) { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.1; + aeb.NodeName = "Right"; + aeb.RootNode = playerModel; + aeb.Start = true; + m_EventBroker->Publish(aeb); + } else if (val < 0) { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.1; + aeb.NodeName = "Left"; + aeb.RootNode = playerModel; + aeb.Start = true; + m_EventBroker->Publish(aeb); + } else { + + + } + } + } + } if (glm::length2(m_Movement) > 0) { m_Movement = glm::normalize(m_Movement); + } else { + if (m_PlayerEntity.Valid()) { + EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel"); + + if (playerModel.Valid()) { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.1; + aeb.NodeName = "Idle"; + aeb.RootNode = playerModel; + m_EventBroker->Publish(aeb); + } + } } } @@ -159,6 +225,32 @@ bool FirstPersonInputController::OnCommand(const Events::InputComm if (e.Command == "Crouch") { m_Crouching = e.Value > 0; + + if (m_PlayerEntity.Valid()) { + EntityWrapper playerModel = m_PlayerEntity.FirstChildByName("PlayerModel"); + if (playerModel.Valid()) { + if (e.Value == 0.f) { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "StandMovement"; + aeb.RootNode = playerModel; + aeb.Start = true; + aeb.Restart = true; + aeb.SingleLevelBlend = true; + m_EventBroker->Publish(aeb); + } else if(e.Value == 1.0f) { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "CrouchMovement"; + aeb.RootNode = playerModel; + aeb.Start = true; + aeb.Restart = true; + aeb.SingleLevelBlend = true; + m_EventBroker->Publish(aeb); + } + } + } + } if (e.Command == "SpecialAbility") { diff --git a/include/Engine/Rendering/BlendTree.h b/include/Engine/Rendering/BlendTree.h index aa06f1e6..02f4a348 100644 --- a/include/Engine/Rendering/BlendTree.h +++ b/include/Engine/Rendering/BlendTree.h @@ -62,6 +62,7 @@ public: double progress; bool Start; bool SingleBlend; + double Weight; std::unordered_map StartWeights; }; diff --git a/include/Engine/Rendering/EAutoAnimationBlend.h b/include/Engine/Rendering/EAutoAnimationBlend.h index ebd29848..29d3d612 100644 --- a/include/Engine/Rendering/EAutoAnimationBlend.h +++ b/include/Engine/Rendering/EAutoAnimationBlend.h @@ -19,6 +19,8 @@ struct AutoAnimationBlend : Event bool Restart = false; bool SingleLevelBlend = false; + double Weight = -1.0; + EntityWrapper AnimationEntity = EntityWrapper::Invalid; }; diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml index d34dba32..4ff512ac 100644 --- a/resources/Schema/Entities/Player.xml +++ b/resources/Schema/Entities/Player.xml @@ -631,7 +631,6 @@ Models/Characters/Assault/AssaultBlue.mesh - false @@ -719,12 +718,12 @@ ReloadSwitchBlend - MovementBlend + FinalMovementBlend - + StandCrouchBlend @@ -987,7 +986,7 @@ DashForwardF - 1 + 2 false @@ -999,7 +998,7 @@ DashBackwardF - 1 + 2 false @@ -1023,7 +1022,7 @@ DashLeftF - 1 + 3 false @@ -1035,7 +1034,7 @@ DashRightF - 1 + 3 false diff --git a/src/Engine/Editor/EditorSystem.cpp b/src/Engine/Editor/EditorSystem.cpp index 62ddba88..f9cdde0b 100644 --- a/src/Engine/Editor/EditorSystem.cpp +++ b/src/Engine/Editor/EditorSystem.cpp @@ -19,7 +19,7 @@ EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame m_ActualCamera = m_EditorCamera; m_EditorWorld->AttachComponent(m_EditorCamera.ID, "Transform"); m_EditorWorld->AttachComponent(m_EditorCamera.ID, "Camera"); - m_EditorCameraInputController = new EditorCameraInputController(m_EventBroker, -1); + m_EditorCameraInputController = new EditorCameraInputController(m_EventBroker, -1, EntityWrapper::Invalid); m_EditorGUI = new EditorGUI(m_World, m_EventBroker); m_EditorGUI->SetEntitySelectedCallback(std::bind(&EditorSystem::OnEntitySelected, this, std::placeholders::_1)); diff --git a/src/Engine/Rendering/AnimationSystem.cpp b/src/Engine/Rendering/AnimationSystem.cpp index 5bac27f9..005778e7 100644 --- a/src/Engine/Rendering/AnimationSystem.cpp +++ b/src/Engine/Rendering/AnimationSystem.cpp @@ -196,7 +196,7 @@ bool AnimationSystem::OnAutoAnimationBlend(Events::AutoAnimationBlend& e) abj.BlendInfo.progress = 0.0; abj.BlendInfo.Start = e.Start; abj.BlendInfo.SingleBlend = e.SingleLevelBlend; - + abj.BlendInfo.Weight = e.Weight; EntityWrapper nodeEntity = subTreeRoot.FirstChildByName(e.NodeName); // more than one if (nodeEntity.Valid()) { diff --git a/src/Engine/Rendering/BlendTree.cpp b/src/Engine/Rendering/BlendTree.cpp index 9b6679ea..29bbe7e6 100644 --- a/src/Engine/Rendering/BlendTree.cpp +++ b/src/Engine/Rendering/BlendTree.cpp @@ -207,6 +207,22 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo) { std::vector goalNodes = FindNodesByName(blendInfo.NodeName); + if(blendInfo.Weight >= 0 && blendInfo.Weight <= 1.0) { + for (auto it = goalNodes.begin(); it != goalNodes.end(); it++) { + EntityWrapper entity = (*it)->Entity; + + if (entity.Valid()) { + if (entity.HasComponent("Blend")) { + (double&)entity["Blend"]["Weight"] = blendInfo.Weight; + } + } + } + + return blendInfo; + } + + + if (blendInfo.Start) { for (auto it = goalNodes.begin(); it != goalNodes.end(); it++) { EntityWrapper entity = (*it)->Entity; diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index cbf0927f..b9a42ffc 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -45,10 +45,6 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) //copy the data from player to explosioneffectmodel playerEntityModel.Copy(deathEffectEW["Model"]); playerEntityAnimation.Copy(deathEffectEW["Animation"]); - //freeze the animation - deathEffectEW["Animation"]["Speed1"] = 0.0; - deathEffectEW["Animation"]["Speed2"] = 0.0; - deathEffectEW["Animation"]["Speed3"] = 0.0; //copy the models position,orientation deathEffectEW["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"]; diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index d67e77bd..8fddbe96 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -42,11 +42,25 @@ void PlayerMovementSystem::updateMovementControllers(double dt) cameraOrientation.x = glm::clamp(cameraOrientation.x, -glm::half_pi(), glm::half_pi()); // Set third person model aim pitch EntityWrapper playerModel = player.FirstChildByName("PlayerModel"); + + //Third-person aim if (playerModel.Valid()) { - //ComponentWrapper cAnimationOffset = playerModel["AnimationOffset"]; - //float pitch = cameraOrientation.x + 0.2f; - //double time = (pitch + glm::half_pi()) / glm::pi(); - //cAnimationOffset["Time"] = time; + EntityWrapper aimPrimaryEntity = playerModel.FirstChildByName("AimPrimary"); + if(aimPrimaryEntity.Valid()){ + if(aimPrimaryEntity.HasComponent("Animation")) { + float pitch = cameraOrientation.x + 0.2f; + double time = (pitch + glm::half_pi()) / glm::pi(); + (double&)aimPrimaryEntity["Animation"]["Time"] = time; + } + } + EntityWrapper aimSecondaryEntity = playerModel.FirstChildByName("AimSecondary"); + if (aimSecondaryEntity.Valid()) { + if (aimSecondaryEntity.HasComponent("Animation")) { + float pitch = cameraOrientation.x + 0.2f; + double time = (pitch + glm::half_pi()) / glm::pi(); + (double&)aimSecondaryEntity["Animation"]["Time"] = time; + } + } } } @@ -140,10 +154,64 @@ void PlayerMovementSystem::updateMovementControllers(double dt) if (isOnGround) { (bool)cPhysics["IsOnGround"] = false; velocity.y = player["Player"]["JumpSpeed"]; + + + if (player.Valid()) { + EntityWrapper playerModel = player.FirstChildByName("PlayerModel"); + if (playerModel.Valid()) { + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.15; + aeb.NodeName = "Jump"; + aeb.RootNode = playerModel; + aeb.Start = true; + aeb.Restart = true; + m_EventBroker->Publish(aeb); + } + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.25; + aeb.NodeName = "StandCrouchBlend"; + aeb.RootNode = playerModel; + aeb.Start = true; + aeb.Restart = false; + aeb.AnimationEntity = playerModel.FirstChildByName("Jump"); + m_EventBroker->Publish(aeb); + } + } + } + + } else if (player.HasComponent("DoubleJump") && !controller->DoubleJumping()) { //Enter here if player can double jump and is doing so. (bool)cPhysics["IsOnGround"] = false; velocity.y = player["DoubleJump"]["DoubleJumpSpeed"]; + + if (player.Valid()) { + EntityWrapper playerModel = player.FirstChildByName("PlayerModel"); + if (playerModel.Valid()) { + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.15; + aeb.NodeName = "Jump"; + aeb.RootNode = playerModel; + aeb.Start = true; + aeb.Restart = true; + m_EventBroker->Publish(aeb); + } + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.25; + aeb.NodeName = "StandCrouchBlend"; + aeb.RootNode = playerModel; + aeb.Start = true; + aeb.Restart = false; + aeb.AnimationEntity = playerModel.FirstChildByName("Jump"); + m_EventBroker->Publish(aeb); + } + } + } + // If IsServer and network is off this will not work if (IsClient) { //put a hexagon at the players feet @@ -234,7 +302,7 @@ void PlayerMovementSystem::playerStep(double dt) bool PlayerMovementSystem::OnPlayerSpawned(Events::PlayerSpawned& e) { // When a player spawns, create an input controller for them - m_PlayerInputControllers[e.Player] = new FirstPersonInputController(m_EventBroker, e.PlayerID); + m_PlayerInputControllers[e.Player] = new FirstPersonInputController(m_EventBroker, e.PlayerID, e.Player); if (e.PlayerID == -1) { // Keep track of the local player m_LocalPlayer = e.Player; @@ -267,18 +335,72 @@ void PlayerMovementSystem::spawnHexagon(EntityWrapper target) bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e) { EntityWrapper player(m_World, e.Player); - if (!player.Valid() || !IsClient || player.ID == LocalPlayer.ID) { + if (!player.Valid() || !IsClient){// || player.ID == LocalPlayer.ID) { return false; } auto entityFile = ResourceManager::Load("Schema/Entities/DashEffect.xml"); EntityWrapper dashEffect = entityFile->MergeInto(m_World); - auto playerModel = player.FirstChildByName("PlayerModel"); + EntityWrapper playerModel = player.FirstChildByName("PlayerModel"); + +/* auto playerEntityModel = playerModel["Model"]; + + + if (player.HasComponent("Physics")) { + glm::vec3 velocity = (glm::vec3)player["Physics"]["Velocity"]; + + glm::vec2 direction = glm::vec2(velocity.x, velocity.z); + + std::string DashName = ""; + if (glm::abs(direction.x) > glm::abs(direction.y)) { + if(glm::sign(direction.x) > 0) { + DashName = "DashRight"; + } else { + DashName = "DashLeft"; + } + } else { + if (glm::sign(direction.y) > 0) { + DashName = "DashForward"; + } else { + DashName = "DashBackward"; + } + } + + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.1; + aeb.NodeName = DashName; + aeb.RootNode = playerModel; + aeb.Restart = true; + aeb.Start = true; + m_EventBroker->Publish(aeb); + } + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "StandCrouchBlend"; + aeb.RootNode = playerModel; + aeb.Delay = 0.3; + aeb.Start = true; + aeb.Restart = false; + aeb.AnimationEntity = playerModel.FirstChildByName(DashName); + m_EventBroker->Publish(aeb); + } + } + */ + +/* auto playerEntityAnimation = playerModel["Animation"]; + playerEntityModel.Copy(dashEffect["Model"]); playerEntityAnimation.Copy(dashEffect["Animation"]); dashEffect["ExplosionEffect"]["EndColor"] = (glm::vec4)playerEntityModel["Color"]; ((glm::vec4&)dashEffect["ExplosionEffect"]["EndColor"]).w = 0.f; +*/ + + + + return true; } diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 3918e9b8..55f6bb56 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -103,7 +103,7 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi) // Play animation EntityWrapper modelEntity = wi.FirstPersonEntity.Parent().Parent(); if (modelEntity.Valid()) { - EntityWrapper blendTree = modelEntity.FirstChildByName("AssaultWeaponBlendTree"); + EntityWrapper blendTree = modelEntity.FirstChildByName("BlendTreeAssaultWeapon"); EntityWrapper reloadBlend = blendTree.FirstChildByName("Reload"); Events::AutoAnimationBlend eFireBlend; From 2b55450c183e222cac3293e159ba6cc0f1a3541b Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Fri, 4 Mar 2016 08:54:59 +0100 Subject: [PATCH 03/14] Cray cray weapons --- assets | 2 +- include/Game/Systems/Weapon/WeaponBehaviour.h | 26 + resources/Schema/Entities/DefenderShield.xml | 42 +- resources/Schema/Entities/MovementTest.xml | 6 +- resources/Schema/Entities/Player.xml | 205 +-- .../Schema/Entities/PlayerAssaultBlue.xml | 1258 +++++++++++++++++ .../Schema/Entities/PlayerDefenderBlue.xml | 334 +++-- .../Entities/WeaponDefenderBlueView.xml | 8 +- .../Entities/WeaponDefenderBlueWorld.xml | 11 +- .../Systems/Weapon/AssaultWeaponBehaviour.cpp | 17 +- .../Weapon/DefenderWeaponBehaviour.cpp | 39 + 11 files changed, 1694 insertions(+), 254 deletions(-) create mode 100644 resources/Schema/Entities/PlayerAssaultBlue.xml diff --git a/assets b/assets index 4205e927..819f9d1c 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 4205e92755aa67c90db6d272047cd92037ae9f11 +Subproject commit 819f9d1c8f62e8ebb07dafbb39f6dff1fd4d5a05 diff --git a/include/Game/Systems/Weapon/WeaponBehaviour.h b/include/Game/Systems/Weapon/WeaponBehaviour.h index 3cda172e..b00dd2e0 100644 --- a/include/Game/Systems/Weapon/WeaponBehaviour.h +++ b/include/Game/Systems/Weapon/WeaponBehaviour.h @@ -9,6 +9,7 @@ #include "Systems/SpawnerSystem.h" #include "Rendering/ESetCamera.h" #include "Core/ConfigFile.h" +#include "Rendering/EAutoAnimationBlend.h" template class WeaponBehaviour : public PureSystem @@ -94,6 +95,31 @@ protected: } } + void playAnimation(EntityWrapper weaponModelEntity, const std::string& subTreeName, const std::string& animationNodeName) + { + EntityWrapper root = weaponModelEntity.FirstParentWithComponent("Model"); + if (!root.Valid()) { + return; + } + + EntityWrapper subTree = root.FirstChildByName(subTreeName); + if (!subTree.Valid()) { + return; + } + + EntityWrapper animationNode = subTree.FirstChildByName(animationNodeName); + if (!animationNode.Valid()) { + return; + } + + Events::AutoAnimationBlend eFireBlend; + eFireBlend.RootNode = root; + eFireBlend.NodeName = animationNodeName; + eFireBlend.Restart = true; + eFireBlend.Start = true; + m_EventBroker->Publish(eFireBlend); + } + void playAnimationAndReturn(EntityWrapper weaponModelEntity, const std::string& subTreeName, const std::string& animationNodeName) { EntityWrapper root = weaponModelEntity.FirstParentWithComponent("Model"); diff --git a/resources/Schema/Entities/DefenderShield.xml b/resources/Schema/Entities/DefenderShield.xml index da760e72..5cb72116 100755 --- a/resources/Schema/Entities/DefenderShield.xml +++ b/resources/Schema/Entities/DefenderShield.xml @@ -2,36 +2,36 @@ + + Deploy + Idle + 0 + + + Models/Characters/Defender/DefenderShield.mesh + - + - - Models/Core/UnitPlane.mesh - - - - - - + + ActivateDeactiveShieldF + + 1 + + - + - - - Models/Core/UnitHexagon.mesh - - true - - - - - - + + ShieldFrontF + 1 + + diff --git a/resources/Schema/Entities/MovementTest.xml b/resources/Schema/Entities/MovementTest.xml index 90c943ef..8202bff3 100644 --- a/resources/Schema/Entities/MovementTest.xml +++ b/resources/Schema/Entities/MovementTest.xml @@ -15,7 +15,7 @@ - Schema/Entities/PlayerAssaultFallbackRed.xml + Schema/Entities/PlayerDefenderBlue.xml @@ -98,7 +98,7 @@ - + @@ -111,7 +111,7 @@ - + diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml index dfcf40a3..70b387bb 100644 --- a/resources/Schema/Entities/Player.xml +++ b/resources/Schema/Entities/Player.xml @@ -485,11 +485,11 @@ - Run + MovementBlend FinalBlend - Models/Characters/Defender/FirstPersonDefenderBlue.mesh + Models/Characters/Assault/FirstPersonAssaultBlue.mesh @@ -506,8 +506,8 @@ Schema/Entities/WeaponAssaultBlueView.xml - - + + @@ -524,8 +524,8 @@ Schema/Entities/SidearmWeaponView.xml - - + + @@ -544,55 +544,31 @@ - Idle - WeaponAction + Fire + Reload 0 true - - - - Fire - Reload - 0 - - - - - - - - ShootShotgunF - 1 - false - - - - - - - - - ReloadSwitchF - 1 - false - - - - - - - - + - IdleF - + ShootRifleF 1 - true + false + + + + + + + + + ReloadSwitchF + 1 + false @@ -608,17 +584,42 @@ - + - - RunF - - 1 - true - + + Idle + Run + 0 + true + - + + + + + RunF + 1 + true + true + + + + + + + + + IdleF + 1 + true + true + + + + + + @@ -672,8 +673,8 @@ Schema/Entities/WeaponAssaultBlueWorld.xml - - + + @@ -693,8 +694,8 @@ Schema/Entities/SidearmWeaponWorld.xml - - + + @@ -801,7 +802,7 @@ CrouchStrafeLeftF - + 1 true @@ -813,7 +814,7 @@ CrouchStrafeRightF - + 1 true @@ -827,7 +828,7 @@ CrouchWalkF - + 1 true @@ -870,42 +871,6 @@ - - - - Walk - Run - 1.2938206818383024e-24 - - - - - - - - WalkF - - 1 - true - - - - - - - - - RunF - - 1 - true - - - - - - - @@ -920,7 +885,7 @@ StrafeRightF - + 1 true @@ -932,7 +897,43 @@ StrafeLeftF - + + 1 + true + + + + + + + + + + + Walk + Run + 1.2938206818383024e-24 + + + + + + + + WalkF + + 1 + true + + + + + + + + + RunF + 1 true @@ -948,7 +949,7 @@ IdleF - + 1 true @@ -1117,7 +1118,7 @@ IdleAssaultRifleU - + 1 true @@ -1129,7 +1130,7 @@ IdleSecWepU - + 1 true diff --git a/resources/Schema/Entities/PlayerAssaultBlue.xml b/resources/Schema/Entities/PlayerAssaultBlue.xml new file mode 100644 index 00000000..bcf4b5e5 --- /dev/null +++ b/resources/Schema/Entities/PlayerAssaultBlue.xml @@ -0,0 +1,1258 @@ + + + + + + + + + + + + + + + + + + + + + + + 5 + + + + + + + + + + + + + 0.10000000149011612 + 300 + + + + + + + + + + Models/Widgets/Camera.mesh + false + + + + + + + + + + + + + + + + + + + Textures/Weapons/Crosshair/SmallThickHoleDot.png + + false + + + + + + + + + + + + Schema/Entities/HitMarker.xml + + + + + + + + + + + + + + 1 + + + + + Textures/HealthHUD3.png + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + + false + + + + + + + + + + + + + + + + Textures/Core/White.png + + false + + + + + + + + + + + + + + + + Textures/Core/White.png + + false + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + + false + + + + + + + + + + + 0.0 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + 1 + + + + 100/100 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + 2 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + 3 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 1 + + + + 4 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + 1 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 1 + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + Models/Widgets/Arrows/Arrow5.mesh + + + + + + + + + + + + + + + MovementBlend + FinalBlend + + + Models/Characters/Assault/FirstPersonAssaultBlue.mesh + + + + + + + + R_Arm_Weapon_Joint + + + AssaultWeapon + + + Schema/Entities/WeaponAssaultBlueView.xml + + + + + + + + + + + + R_Arm_Weapon_Joint + + + SidearmWeapon + + + Schema/Entities/SidearmWeaponView.xml + + + + + + + + + + + + BlendTreeAssaultWeapon + BlendTreeSecondaryWeapon + 0 + true + + + + + + + + Fire + Reload + 0 + true + + + + + + + + ShootRifleF + 1 + false + + + + + + + + + ReloadSwitchF + 1 + false + + + + + + + + + + + + + + + + + + + Idle + Run + 0 + true + + + + + + + + RunF + 1 + true + true + + + + + + + + + IdleF + 1 + true + true + + + + + + + + + + + + + + + 0.10000000149011612 + 300 + + + Models/Widgets/Camera.mesh + false + + + + + + + + + + + + BlendTreeAim + BlendTreeAssault + + + + + Models/Characters/Assault/AssaultBlue.mesh + + + + + + + + + R_Arm_Weapon_Joint + + + AssaultWeapon + + + + + + Schema/Entities/WeaponAssaultBlueWorld.xml + + + + + + + + + + + + R_Arm_Weapon_Joint + + + SidearmWeapon + + + + + + Schema/Entities/SidearmWeaponWorld.xml + + + + + + + + + + + + AimPrimary + AimSecondary + 0 + true + + + + + + + + AimSecWepA + + false + true + + + + + + + + + AimRifleA + + false + true + + + + + + + + + + + ReloadSwitchBlend + MovementBlend + + + + + + + + StandCrouchBlend + JumpDashBlend + 2.5146881298480398e-63 + true + + + + + + + + StandMovement + CrouchMovement + 0 + true + + + + + + + + MovementBlend + Idle + 1 + + + + + + + + Walk + StrafeLRBlend + 0 + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + CrouchStrafeLeftF + + 1 + true + + + + + + + + + CrouchStrafeRightF + + 1 + true + + + + + + + + + + + CrouchWalkF + + 1 + true + + + + + + + + + + + CrouchF + + 1 + + + + + + + + + + + MovementBlend + Idle + 1 + + + + + + + + RunWalkBlend + StrafeLRBlend + 2.4565650245976452e-16 + + + + + + + + Walk + Run + 1.2938206818383024e-24 + + + + + + + + WalkF + + 1 + true + + + + + + + + + RunF + + 1 + true + + + + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeRightF + + 1 + true + + + + + + + + + StrafeLeftF + + 1 + true + + + + + + + + + + + + + IdleF + + 1 + true + + + + + + + + + + + + + Jump + DashBlend + 1 + true + + + + + + + + JumpF + + 1 + false + + + + + + + + + DashFBBlend + DashLRBlend + 0.014621149736541383 + + + + + + + + DashForward + DashBackward + 0.014363533804961248 + + + + + + + + DashForwardF + + 1 + false + + + + + + + + + DashBackwardF + + 1 + false + + + + + + + + + + + DashLeft + DashRight + 4.3244885367500671e-16 + + + + + + + + DashLeftF + + 1 + false + + + + + + + + + DashRightF + + 1 + false + + + + + + + + + + + + + + + + + ReloadSwitch + WeaponActionBlend + 1 + true + + + + + + + + ReloadSwitchU + + 1 + + + + + + + + + IdleBlend + ShootBlend + 0 + + + + + + + + IdlePrimary + IdleSecondary + 0 + + + + + + + + IdleAssaultRifleU + + 1 + true + + + + + + + + + IdleSecWepU + + 1 + true + + + + + + + + + + + ShootPrimary + ShootSecondary + 0 + + + + + + + + ShootFastRifleU + + 1 + + + + + + + + + ShootSecWepFastU + + + + + + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + false + + + + + + + + + + + + Models/Core/UnitCube.mesh + + false + + + + + + + + + + + Insert name here + Fonts/DroidSans.ttf,100 + + + + + + + + + + + + + + Textures/Icons/Arrow.png + + false + + + + + 50 + true + + + + + + + + + + + + Schema/Entities/DefenderShield.xml + + + + + + + + + + diff --git a/resources/Schema/Entities/PlayerDefenderBlue.xml b/resources/Schema/Entities/PlayerDefenderBlue.xml index aef660a3..c3bfc074 100644 --- a/resources/Schema/Entities/PlayerDefenderBlue.xml +++ b/resources/Schema/Entities/PlayerDefenderBlue.xml @@ -1,31 +1,38 @@ - + - - + - - - - + + 4 + 52 + + + + 150 + 150 + + - + + true 5 - + + @@ -38,6 +45,7 @@ + @@ -213,7 +221,7 @@ - 100/100 + 150/150 Fonts/DroidSans.ttf,64 @@ -422,6 +430,7 @@ Fonts/DroidSans.ttf,64 + @@ -485,12 +494,10 @@ - - BlendTreeAssaultWeapon - BlendTreeSecondaryWeapon - 0 - true - + + MovementBlend + FinalBlend + Models/Characters/Defender/FirstPersonDefenderBlue.mesh @@ -501,7 +508,6 @@ R_Arm_Weapon_Joint - true DefenderWeapon @@ -510,9 +516,8 @@ Schema/Entities/WeaponDefenderBlueView.xml - - - + + @@ -529,38 +534,39 @@ Schema/Entities/SidearmWeaponView.xml - - + + - + - Idle - WeaponAction + BlendTreeDefenderWeapon + BlendTreeSecondaryWeapon 0 true - + - Fire - Reload - 1 + ActionBlend + Shield + 0 + true - + - ShootShotgunF - + ActivateDeactiveShieldF + 1 false @@ -568,39 +574,112 @@ - + - - ReloadSwitchF - - 1 - true - + + Idle + ActionBlend2 + 0 + true + - + + + + + IdleF + + + + + + + + + Fire + Reload + 0 + + + + + + + + ShootShotgunF + + 1 + false + + + + + + + + + ShotgunReloadTwoF + + 1 + false + + + + + + + + - + - - IdleF - - 1 - true - - + + + Idle + Run + 0 + true + - + + + + + RunF + + 1 + true + true + + + + + + + + + IdleF + + 1 + true + true + + + + + + @@ -632,9 +711,8 @@ - Models/Characters/Assault/AssaultBlue.mesh - - false + Models/Characters/Defender/DefenderBlue.mesh + @@ -651,11 +729,11 @@ - Schema/Entities/WeaponAssaultBlueWorld.xml + Schema/Entities/WeaponDefenderBlueWorld.xml - - + + @@ -675,8 +753,8 @@ Schema/Entities/SidearmWeaponWorld.xml - - + + @@ -779,11 +857,11 @@ - + - CrouchStrafeLeftF - + CrouchStrafeRightF + 1 true @@ -791,11 +869,11 @@ - + - CrouchStrafeRightF - + CrouchStrafeLeftF + 1 true @@ -809,7 +887,7 @@ CrouchWalkF - + 1 true @@ -852,42 +930,6 @@ - - - - Walk - Run - 1.2938206818383024e-24 - - - - - - - - WalkF - - 1 - true - - - - - - - - - RunF - - 1 - true - - - - - - - @@ -902,7 +944,7 @@ StrafeRightF - + 1 true @@ -914,7 +956,43 @@ StrafeLeftF - + + 1 + true + + + + + + + + + + + Walk + Run + 1.2938206818383024e-24 + + + + + + + + WalkF + + 1 + true + + + + + + + + + RunF + 1 true @@ -930,7 +1008,7 @@ IdleF - + 1 true @@ -1099,7 +1177,7 @@ IdleAssaultRifleU - + 1 true @@ -1111,7 +1189,7 @@ IdleSecWepU - + 1 true @@ -1159,6 +1237,50 @@ + + + + + + + + + + + Deploy + Idle + 0 + + + Models/Characters/Defender/DefenderShield.mesh + + + + + + + + ActivateDeactiveShieldF + 1 + + + + + + + + + ShieldFrontF + 1 + + + + + + + + + @@ -1191,7 +1313,7 @@ - Insert name here + Fonts/DroidSans.ttf,100 diff --git a/resources/Schema/Entities/WeaponDefenderBlueView.xml b/resources/Schema/Entities/WeaponDefenderBlueView.xml index 6ec4b452..24b18f68 100644 --- a/resources/Schema/Entities/WeaponDefenderBlueView.xml +++ b/resources/Schema/Entities/WeaponDefenderBlueView.xml @@ -3,11 +3,9 @@ - Models/Weapons/Blue/DefenderGunBlue.mesh + Models/Weapons/Blue/DefenderWeaponBlue.mesh - - - + @@ -34,7 +32,7 @@ - + diff --git a/resources/Schema/Entities/WeaponDefenderBlueWorld.xml b/resources/Schema/Entities/WeaponDefenderBlueWorld.xml index 826301b4..6c750964 100644 --- a/resources/Schema/Entities/WeaponDefenderBlueWorld.xml +++ b/resources/Schema/Entities/WeaponDefenderBlueWorld.xml @@ -2,17 +2,10 @@ - - R_Arm_Weapon_Joint - - - Models/Weapons/Blue/DefenderGunBlue.mesh + Models/Weapons/Blue/DefenderWeaponBlue.mesh - - - - + diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index cdb0a563..0fd987ae 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -39,6 +39,8 @@ void AssaultWeaponBehaviour::UpdateWeapon(ComponentWrapper cWeapon, WeaponInfo& ammo = glm::max(0, ammo - (magSize - magAmmo)); magAmmo = glm::min(magSize, ammo); isReloading = false; + wi.FirstPersonEntity["Model"]["Visible"] = true; + wi.ThirdPersonEntity["Model"]["Visible"] = true; } // Restore view angle @@ -57,19 +59,18 @@ void AssaultWeaponBehaviour::UpdateWeapon(ComponentWrapper cWeapon, WeaponInfo& } // Update first person run animation - /*ComponentWrapper cPlayer = wi.Player["Player"]; + ComponentWrapper cPlayer = wi.Player["Player"]; ComponentWrapper cPhysics = wi.Player["Physics"]; const float& movementSpeed = cPlayer["MovementSpeed"]; float speed = glm::length((const glm::vec3&)cPhysics["Velocity"]); - float animationSpeed = glm::max(speed, movementSpeed) / movementSpeed; + float animationWeight = glm::min(speed, movementSpeed) / movementSpeed; EntityWrapper rootNode = wi.FirstPersonEntity.FirstParentWithComponent("Model"); if (rootNode.Valid()) { - EntityWrapper animationNode = rootNode.FirstChildByName("Run"); - if (animationNode.Valid()) { - (bool&)animationNode["Animation"]["Play"] = animationSpeed > 0; - (double&)animationNode["Animation"]["Speed"] = animationSpeed; + EntityWrapper blend = rootNode.FirstChildByName("MovementBlend"); + if (blend.Valid()) { + (double&)blend["Blend"]["Weight"] = animationWeight; } - }*/ + } // Fire if we're able to fire if (canFire(cWeapon, wi)) { @@ -122,6 +123,8 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi) EntityWrapper reloadEffectSpawner = wi.FirstPersonEntity.FirstChildByName("FirstPersonReloadSpawner"); if (reloadEffectSpawner.Valid()) { SpawnerSystem::Spawn(reloadEffectSpawner, reloadEffectSpawner); + wi.FirstPersonEntity["Model"]["Visible"] = false; + wi.ThirdPersonEntity["Model"]["Visible"] = false; } } diff --git a/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp b/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp index 3a4ed3a4..2d6ab74b 100644 --- a/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/DefenderWeaponBehaviour.cpp @@ -36,6 +36,7 @@ void DefenderWeaponBehaviour::UpdateWeapon(ComponentWrapper cWeapon, WeaponInfo& m_EventBroker->Publish(e); } else { isReloading = false; + playAnimationAndReturn(wi.FirstPersonEntity, "FinalBlend", "Idle"); } } @@ -96,6 +97,9 @@ void DefenderWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi) // Start reload isReloading = true; reloadTimer = reloadTime; + + // Play animation + playAnimationAndReturn(wi.FirstPersonEntity, "FinalBlend", "Reload"); } void DefenderWeaponBehaviour::OnHolster(ComponentWrapper cWeapon, WeaponInfo& wi) @@ -115,8 +119,40 @@ bool DefenderWeaponBehaviour::OnInputCommand(ComponentWrapper cWeapon, WeaponInf if (attachment.Valid()) { if (e.Value > 0) { SpawnerSystem::Spawn(attachment, attachment); + + EntityWrapper root = wi.FirstPersonEntity.FirstParentWithComponent("Model"); + if (root.Valid()) { + EntityWrapper subTree = root.FirstChildByName("FinalBlend"); + if (subTree.Valid()) { + EntityWrapper animationNode = subTree.FirstChildByName("Shield"); + if (animationNode.Valid()) { + Events::AutoAnimationBlend eFireBlend; + eFireBlend.RootNode = root; + eFireBlend.NodeName = "Shield"; + eFireBlend.Restart = true; + eFireBlend.Start = true; + m_EventBroker->Publish(eFireBlend); + } + } + } } else { attachment.DeleteChildren(); + + EntityWrapper root = wi.FirstPersonEntity.FirstParentWithComponent("Model"); + if (root.Valid()) { + EntityWrapper subTree = root.FirstChildByName("FinalBlend"); + if (subTree.Valid()) { + EntityWrapper animationNode = subTree.FirstChildByName("ActionBlend"); + if (animationNode.Valid()) { + Events::AutoAnimationBlend eFireBlend; + eFireBlend.RootNode = root; + eFireBlend.NodeName = "ActionBlend"; + eFireBlend.Restart = true; + eFireBlend.Start = true; + m_EventBroker->Publish(eFireBlend); + } + } + } } } } @@ -195,6 +231,9 @@ void DefenderWeaponBehaviour::fireShell(ComponentWrapper cWeapon, WeaponInfo& wi } } + // Play animation + playAnimationAndReturn(wi.FirstPersonEntity, "BlendTreeDefenderWeapon", "Fire"); + // Sound Events::PlaySoundOnEntity e; e.EmitterID = wi.Player.ID; From e2674d915ecf0a9828945f9eaa35b6a582977dc7 Mon Sep 17 00:00:00 2001 From: Jocke Date: Fri, 4 Mar 2016 08:55:55 +0100 Subject: [PATCH 04/14] Constrained weapon behavior to client side only --- include/Game/Systems/Weapon/WeaponBehaviour.h | 6 ++++-- src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp | 11 ++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/Game/Systems/Weapon/WeaponBehaviour.h b/include/Game/Systems/Weapon/WeaponBehaviour.h index 3cda172e..a823f9dd 100644 --- a/include/Game/Systems/Weapon/WeaponBehaviour.h +++ b/include/Game/Systems/Weapon/WeaponBehaviour.h @@ -242,8 +242,10 @@ private: // Spawn the weapon(s) EntityWrapper firstPersonWeapon; EntityWrapper thirdPersonWeapon; - if (firstPersonAttachment.Valid()) { - firstPersonWeapon = SpawnerSystem::Spawn(firstPersonAttachment, firstPersonAttachment); + if (IsClient) { + if (firstPersonAttachment.Valid()) { + firstPersonWeapon = SpawnerSystem::Spawn(firstPersonAttachment, firstPersonAttachment); + } } if (thirdPersonAttachment.Valid()) { thirdPersonWeapon = SpawnerSystem::Spawn(thirdPersonAttachment, thirdPersonAttachment); diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index cdb0a563..4c970500 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -117,11 +117,12 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi) // Play animation playAnimationAndReturn(wi.FirstPersonEntity, "BlendTreeAssaultWeapon", "Reload"); - - // Spawn explosion effect - EntityWrapper reloadEffectSpawner = wi.FirstPersonEntity.FirstChildByName("FirstPersonReloadSpawner"); - if (reloadEffectSpawner.Valid()) { - SpawnerSystem::Spawn(reloadEffectSpawner, reloadEffectSpawner); + if (IsClient) { + // Spawn explosion effect + EntityWrapper reloadEffectSpawner = wi.FirstPersonEntity.FirstChildByName("FirstPersonReloadSpawner"); + if (reloadEffectSpawner.Valid()) { + SpawnerSystem::Spawn(reloadEffectSpawner, reloadEffectSpawner); + } } } From ebd4c58c41c903dc680d7d8aadd3bcc1edf27aeb Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Fri, 4 Mar 2016 09:23:18 +0100 Subject: [PATCH 05/14] "Fixed" weapon spawning over network --- include/Game/Systems/Weapon/WeaponBehaviour.h | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/include/Game/Systems/Weapon/WeaponBehaviour.h b/include/Game/Systems/Weapon/WeaponBehaviour.h index 60675d67..e2d5980b 100644 --- a/include/Game/Systems/Weapon/WeaponBehaviour.h +++ b/include/Game/Systems/Weapon/WeaponBehaviour.h @@ -32,6 +32,21 @@ public: virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& cWeapon, double dt) override { + EntityWrapper firstPersonWeapon = entity.FirstChildByName("Hands").FirstChildByName("AssaultWeapon"); + EntityWrapper thirdPersonWeapon = entity.FirstChildByName("PlayerModel").FirstChildByName("AssaultWeapon"); + if (IsClient && (firstPersonWeapon.Valid() || thirdPersonWeapon.Valid())) { + if (m_ActiveWeapons.count(entity) == 0) { + + WeaponInfo& wi = m_ActiveWeapons[entity]; + wi.Player = entity; + wi.WeaponEntity = entity; + wi.FirstPersonEntity = firstPersonWeapon; + wi.ThirdPersonEntity = thirdPersonWeapon; + + OnEquip(cWeapon, wi); + } + } + auto weapon = getActiveWeapon(entity); if (!weapon) { return; @@ -239,6 +254,10 @@ private: void selectWeapon(ComponentWrapper cWeapon, EntityWrapper player) { + if (!IsServer) { + return; + } + // Don't reselect weapon if it's already active if (getActiveWeapon(player)) { return; @@ -268,11 +287,11 @@ private: // Spawn the weapon(s) EntityWrapper firstPersonWeapon; EntityWrapper thirdPersonWeapon; - if (IsClient) { + //if (IsClient) { if (firstPersonAttachment.Valid()) { firstPersonWeapon = SpawnerSystem::Spawn(firstPersonAttachment, firstPersonAttachment); } - } + //} if (thirdPersonAttachment.Valid()) { thirdPersonWeapon = SpawnerSystem::Spawn(thirdPersonAttachment, thirdPersonAttachment); } From 3ac8a5c7ef4c8bf62063c965d576c94d858f9497 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Fri, 4 Mar 2016 09:38:38 +0100 Subject: [PATCH 06/14] Working map --- .../Schema/Entities/NewMap2version5NEW.xml | 8623 ++++++++--------- .../Schema/Entities/PlayerAssaultBlue.xml | 72 +- .../Schema/Entities/PlayerAssaultRed.xml | 1258 +++ .../Schema/Entities/WeaponAssaultRedView.xml | 109 + .../Schema/Entities/WeaponAssaultRedWorld.xml | 34 + 5 files changed, 5747 insertions(+), 4349 deletions(-) create mode 100644 resources/Schema/Entities/PlayerAssaultRed.xml create mode 100644 resources/Schema/Entities/WeaponAssaultRedView.xml create mode 100644 resources/Schema/Entities/WeaponAssaultRedWorld.xml diff --git a/resources/Schema/Entities/NewMap2version5NEW.xml b/resources/Schema/Entities/NewMap2version5NEW.xml index 2925f516..aa709967 100644 --- a/resources/Schema/Entities/NewMap2version5NEW.xml +++ b/resources/Schema/Entities/NewMap2version5NEW.xml @@ -2,6 +2,9 @@ + + 2.4355835422707059 + @@ -29,29 +32,6 @@ - - - - - Models/Props/Walls/SciFiWallBig.mesh - - - - - - - - - - - - Models/Props/Walls/SciFiWallBig.mesh - true - - - - - @@ -82,6 +62,29 @@ + + + + + Models/Props/Walls/SciFiWallBig.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + true + + + + + @@ -676,6 +679,42 @@ + + + + + Models/Highgrounds/Hg8.mesh + + + + + + + + + + + + Models/Highgrounds/Hg10.mesh + + + + + + + + + + + + Models/Highgrounds/Hg4.mesh + + + + + + + @@ -751,42 +790,6 @@ - - - - - Models/Highgrounds/Hg8.mesh - - - - - - - - - - - - Models/Highgrounds/Hg10.mesh - - - - - - - - - - - - Models/Highgrounds/Hg4.mesh - - - - - - - @@ -1924,6 +1927,68 @@ + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + @@ -2526,392 +2591,7 @@ - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - - + @@ -2920,12 +2600,12 @@ - Models/Props/Flora/SpecialRoot.mesh + Models/Props/Pillars/StonePillar.mesh - - - + + + @@ -2934,12 +2614,11 @@ - Models/Props/Flora/SpecialRoot.mesh + Models/Props/Pillars/SciFiPillar2Red.mesh - - - + + @@ -2948,11 +2627,13 @@ - Models/Props/Flora/SpecialRoot.mesh + 6 + Models/Props/Pillars/SciFiPillar1Red.mesh - - + + + @@ -2961,32 +2642,10 @@ - Models/Props/Flora/SpecialRoot.mesh + Models/Props/Pillars/StonePillar.mesh - - - - - - - - - - - - - - - - - - - Models/Props/SciFiHolder1.mesh - - - - + @@ -2995,496 +2654,11 @@ - Models/Props/SciFiHolder1.mesh + Models/Props/Pillars/SciFiPillar2Red.mesh - - - - - - - - - - - Models/Props/SciFiHolder1.mesh - - - - - - - - - - - - - Models/Props/SciFiHolder1.mesh - - - - - - - - - - - - - Models/Props/SciFiHolder1.mesh - - - - - - - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/mediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - + + @@ -3494,573 +2668,16 @@ - Models/Props/Stones/SmallStone1.mesh + Models/Props/Pillars/StonePillar.mesh - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - + + - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/mediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/mediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/mediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/mediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/mediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/mediumStone2.mesh - - - - - - - - @@ -4068,6 +2685,19 @@ + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + @@ -4108,19 +2738,6 @@ - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - @@ -4137,579 +2754,6 @@ - - - - - - - - - - Models/Props/Pillars/StonePillar.mesh - - - - - - - - - - - - Models/Props/Pillars/StonePillar.mesh - - - - - - - - - - - - - - Models/Props/Pillars/SciFiPillar2Red.mesh - - - - - - - - - - - - - - 6 - Models/Props/Pillars/SciFiPillar1Red.mesh - - - - - - - - - - - - - - Models/Props/Pillars/StonePillar.mesh - - - - - - - - - - - - - - Models/Props/Pillars/SciFiPillar2Red.mesh - - - - - - - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - - - - Models/Props/Walls/BigWallBlue.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Core/UnitPlane.mesh - - true - - - - - - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - @@ -4729,232 +2773,6 @@ - - - - - - - - - - Models/Props/Walls/SpecialWall1.mesh - - - - - - - - - - - - - - Models/Props/Walls/SpecialWall1.mesh - - - - - - - - - - - - - - Models/Props/Walls/SpecialWall1.mesh - - - - - - - - - - - - - - Models/Props/Walls/SpecialWall1.mesh - - - - - - - - - - - - - - - - - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/BigWallBlue.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - - Models/Props/Walls/BigWallBlue.mesh - - - - - - - - - - - - - Models/Props/Walls/smallWall3.mesh - - - - - - - - - - - @@ -4966,8 +2784,8 @@ Models/Props/PickUps/PickUpHolder.mesh - - + + @@ -4975,49 +2793,7 @@ - - - - - - - - - - 8 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - + @@ -5034,7 +2810,343 @@ - + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + @@ -5046,324 +3158,11 @@ - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Pillars/StonePillar.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - @@ -5371,593 +3170,8 @@ Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/mediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - 4 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - 3 - - - - - - - - - - - - 2 - - - - - - - - - - - - 2 - 1 - - - - - - - - - - - - - - 4 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - 2 - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - + + @@ -5976,6 +3190,46 @@ + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + @@ -5983,8 +3237,195 @@ Models/Props/Stones/BigStone.mesh - - + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/mediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/mediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + @@ -5997,8 +3438,8 @@ - - + + @@ -6010,8 +3451,308 @@ Models/Props/Stones/SmallStone1.mesh - - + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/mediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/mediumStone2.mesh + + + + + @@ -6044,20 +3785,6 @@ - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - @@ -6071,46 +3798,6 @@ - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - @@ -6118,48 +3805,8 @@ Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - + + @@ -6185,8 +3832,114 @@ Models/Props/Stones/SmallStone1.mesh - - + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/mediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + @@ -6199,8 +3952,22 @@ Models/Props/Stones/SmallStone1.mesh - - + + + + + + + + + + + Models/Props/Stones/mediumStone2.mesh + + + + + @@ -6212,75 +3979,8 @@ Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - + + @@ -6298,47 +3998,6 @@ - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - @@ -6352,18 +4011,6 @@ - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - @@ -6418,112 +4065,6 @@ - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/mediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - @@ -6531,13 +4072,41 @@ Models/Props/Stones/MediumStone2.mesh - - + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + @@ -6551,71 +4120,6 @@ - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - @@ -6629,75 +4133,6 @@ - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - @@ -6712,6 +4147,1958 @@ + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/mediumStone2.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/smallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Stones/mediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 5 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 4 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 3 + + + + + + + + + + + + 2 + 1 + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 4 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + @@ -6733,9 +6120,211 @@ Models/Props/Stones/SmallStone1.mesh - - - + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + @@ -6754,6 +6343,192 @@ + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + @@ -6767,6 +6542,73 @@ + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + @@ -6774,9 +6616,170 @@ Models/Props/Stones/SmallStone1.mesh - - - + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/mediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + @@ -6816,90 +6819,6 @@ - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - @@ -6932,7 +6851,7 @@ - + @@ -6948,8 +6867,8 @@ Models/Props/PickUps/PickUpHolder.mesh - - + + @@ -6957,49 +6876,7 @@ - - - - - - - - - - 8 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - + @@ -7016,7 +6893,7 @@ - + @@ -7058,7 +6935,133 @@ - + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + @@ -7100,7 +7103,7 @@ - + @@ -7112,11 +7115,100 @@ + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + @@ -7130,6 +7222,20 @@ + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + @@ -7145,20 +7251,6 @@ - - - - - Models/Props/Pillars/StonePillar.mesh - - - - - - - - - @@ -7173,95 +7265,6 @@ - - - - - Models/Props/Pillars/StonePillar.mesh - - - - - - - - - - - - Models/Props/Pillars/SciFiPillar2Blue.mesh - - - - - - - - - - - - - - - - - - - - - Models/Props/Walls/SpecialWall1.mesh - - - - - - - - - - - - - - Models/Props/Walls/SpecialWall1.mesh - - - - - - - - - - - - - - Models/Props/Walls/SpecialWall1.mesh - - - - - - - - - - - - - - Models/Props/Walls/SpecialWall1.mesh - - - - - - - - - @@ -7413,19 +7416,6 @@ - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - @@ -7453,6 +7443,19 @@ + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + @@ -7542,9 +7545,8 @@ Models/Props/Flora/SpecialRoot.mesh - - - + + @@ -7556,8 +7558,9 @@ Models/Props/Flora/SpecialRoot.mesh - - + + + @@ -7601,12 +7604,11 @@ - Models/Props/Walls/SmallWall3.mesh + Models/Props/Walls/MediumWall3.mesh - - - + + @@ -7618,8 +7620,76 @@ Models/Props/Walls/MediumWall3.mesh - - + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + @@ -7657,48 +7727,8 @@ Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - + + @@ -7718,6 +7748,20 @@ + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + @@ -7725,12 +7769,26 @@ Models/Props/Walls/BigWallBlue.mesh - + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + @@ -7751,8 +7809,7 @@ Models/Props/Walls/SmallWall3.mesh - - + @@ -7765,8 +7822,21 @@ Models/Props/Walls/MediumWall3.mesh - - + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + @@ -7792,8 +7862,8 @@ Models/Props/Walls/SmallWall3.mesh - - + + @@ -7806,49 +7876,9 @@ Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - Models/Props/Walls/BigWallBlue.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - + + + @@ -7866,6 +7896,19 @@ + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + @@ -7883,11 +7926,39 @@ - Models/Props/Walls/BigWallBlue.mesh + Models/Props/Walls/SmallWall3.mesh - - + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + @@ -7905,32 +7976,6 @@ - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - @@ -7944,48 +7989,6 @@ - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - @@ -8008,19 +8011,6 @@ - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - @@ -8048,6 +8038,19 @@ + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + @@ -8144,13 +8147,12 @@ - 4 - Models/Props/Pillars/SciFiPillar3Blue.mesh + 6 + Models/Props/Pillars/SciFiPillar2Blue.mesh - - - + + @@ -8177,8 +8179,9 @@ Models/Props/Pillars/SciFiPillar2Blue.mesh - - + + + @@ -8187,12 +8190,12 @@ - 6 - Models/Props/Pillars/SciFiPillar1Blue.mesh + Models/Props/Pillars/SciFiPillar2Blue.mesh - - + + + @@ -8220,8 +8223,8 @@ Models/Props/Pillars/SciFiPillar2Blue.mesh - - + + @@ -8240,6 +8243,49 @@ + + + + + 4 + Models/Props/Pillars/SciFiPillar3Blue.mesh + + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + 6 + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + @@ -8255,49 +8301,6 @@ - - - - - 6 - Models/Props/Pillars/SciFiPillar2Blue.mesh - - - - - - - - - - - - - - 6 - Models/Props/Pillars/SciFiPillar2Blue.mesh - - - - - - - - - - - - - Models/Props/Pillars/SciFiPillar2Blue.mesh - - - - - - - - - @@ -8352,26 +8355,6 @@ - - - - 10 - - - - - - - - - - - 1 - - - - - @@ -8383,17 +8366,6 @@ - - - - 10 - - - - - - - @@ -8406,6 +8378,17 @@ + + + + 10 + + + + + + + @@ -8429,6 +8412,26 @@ + + + + 1 + + + + + + + + + 10 + + + + + + + @@ -8440,7 +8443,7 @@ - Schema/Entities/PlayerRed.xml + Schema/Entities/PlayerAssaultRed.xml @@ -8702,61 +8705,55 @@ - Schema/Entities/Player.xml + Schema/Entities/PlayerAssaultBlue.xml - + - + - Models/Characters/Assault/AssaultTPose.mesh - false + Models/Core/UnitCube.mesh + + + + + + + + + + Models/Core/UnitCube.mesh - + - + - Models/Characters/Assault/AssaultTPose.mesh - false + Models/Core/UnitCube.mesh - + - + - Models/Characters/Assault/AssaultTPose.mesh - false + Models/Core/UnitCube.mesh - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - + diff --git a/resources/Schema/Entities/PlayerAssaultBlue.xml b/resources/Schema/Entities/PlayerAssaultBlue.xml index bcf4b5e5..c918dcd6 100644 --- a/resources/Schema/Entities/PlayerAssaultBlue.xml +++ b/resources/Schema/Entities/PlayerAssaultBlue.xml @@ -871,42 +871,6 @@ - - - - Walk - Run - 1.2938206818383024e-24 - - - - - - - - WalkF - - 1 - true - - - - - - - - - RunF - - 1 - true - - - - - - - @@ -943,6 +907,42 @@ + + + + Walk + Run + 1.2938206818383024e-24 + + + + + + + + WalkF + + 1 + true + + + + + + + + + RunF + + 1 + true + + + + + + + diff --git a/resources/Schema/Entities/PlayerAssaultRed.xml b/resources/Schema/Entities/PlayerAssaultRed.xml new file mode 100644 index 00000000..af0ba963 --- /dev/null +++ b/resources/Schema/Entities/PlayerAssaultRed.xml @@ -0,0 +1,1258 @@ + + + + + + + + + + + + + + + + + + + + + + + 5 + + + + + + + + + + + + + 0.10000000149011612 + 300 + + + + + + + + + + Models/Widgets/Camera.mesh + false + + + + + + + + + + + + + + + + + + + Textures/Weapons/Crosshair/SmallThickHoleDot.png + + false + + + + + + + + + + + + Schema/Entities/HitMarker.xml + + + + + + + + + + + + + + 1 + + + + + Textures/HealthHUD3.png + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + + false + + + + + + + + + + + + + + + + Textures/Core/White.png + + false + + + + + + + + + + + + + + + + Textures/Core/White.png + + false + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + + false + + + + + + + + + + + 0.0 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + 1 + + + + 100/100 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + 2 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + 3 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 1 + + + + 4 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + 1 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 1 + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + Models/Widgets/Arrows/Arrow5.mesh + + + + + + + + + + + + + + + MovementBlend + FinalBlend + + + Models/Characters/Assault/FirstPersonAssaultRed.mesh + + + + + + + + R_Arm_Weapon_Joint + + + AssaultWeapon + + + Schema/Entities/WeaponAssaultRedView.xml + + + + + + + + + + + + R_Arm_Weapon_Joint + + + SidearmWeapon + + + Schema/Entities/SidearmWeaponView.xml + + + + + + + + + + + + BlendTreeAssaultWeapon + BlendTreeSecondaryWeapon + 0 + true + + + + + + + + Fire + Reload + 0 + true + + + + + + + + ShootRifleF + 1 + false + + + + + + + + + ReloadSwitchF + 1 + false + + + + + + + + + + + + + + + + + + + Idle + Run + 0 + true + + + + + + + + RunF + 1 + true + true + + + + + + + + + IdleF + 1 + true + true + + + + + + + + + + + + + + + 0.10000000149011612 + 300 + + + Models/Widgets/Camera.mesh + false + + + + + + + + + + + + BlendTreeAim + BlendTreeAssault + + + + + Models/Characters/Assault/AssaultRed.mesh + + + + + + + + + R_Arm_Weapon_Joint + + + AssaultWeapon + + + + + + Schema/Entities/WeaponAssaultRedWorld.xml + + + + + + + + + + + + R_Arm_Weapon_Joint + + + SidearmWeapon + + + + + + Schema/Entities/SidearmWeaponWorld.xml + + + + + + + + + + + + AimPrimary + AimSecondary + 0 + true + + + + + + + + AimSecWepA + + false + true + + + + + + + + + AimRifleA + + false + true + + + + + + + + + + + ReloadSwitchBlend + MovementBlend + + + + + + + + StandCrouchBlend + JumpDashBlend + 2.5146881298480398e-63 + true + + + + + + + + StandMovement + CrouchMovement + 0 + true + + + + + + + + MovementBlend + Idle + 1 + + + + + + + + Walk + StrafeLRBlend + 0 + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + CrouchStrafeLeftF + + 1 + true + + + + + + + + + CrouchStrafeRightF + + 1 + true + + + + + + + + + + + CrouchWalkF + + 1 + true + + + + + + + + + + + CrouchF + + 1 + + + + + + + + + + + MovementBlend + Idle + 1 + + + + + + + + RunWalkBlend + StrafeLRBlend + 2.4565650245976452e-16 + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeRightF + + 1 + true + + + + + + + + + StrafeLeftF + + 1 + true + + + + + + + + + + + Walk + Run + 1.2938206818383024e-24 + + + + + + + + WalkF + + 1 + true + + + + + + + + + RunF + + 1 + true + + + + + + + + + + + + + IdleF + + 1 + true + + + + + + + + + + + + + Jump + DashBlend + 1 + true + + + + + + + + JumpF + + 1 + false + + + + + + + + + DashFBBlend + DashLRBlend + 0.014621149736541383 + + + + + + + + DashForward + DashBackward + 0.014363533804961248 + + + + + + + + DashForwardF + + 1 + false + + + + + + + + + DashBackwardF + + 1 + false + + + + + + + + + + + DashLeft + DashRight + 4.3244885367500671e-16 + + + + + + + + DashLeftF + + 1 + false + + + + + + + + + DashRightF + + 1 + false + + + + + + + + + + + + + + + + + ReloadSwitch + WeaponActionBlend + 1 + true + + + + + + + + ReloadSwitchU + + 1 + + + + + + + + + IdleBlend + ShootBlend + 0 + + + + + + + + IdlePrimary + IdleSecondary + 0 + + + + + + + + IdleAssaultRifleU + + 1 + true + + + + + + + + + IdleSecWepU + + 1 + true + + + + + + + + + + + ShootPrimary + ShootSecondary + 0 + + + + + + + + ShootFastRifleU + + 1 + + + + + + + + + ShootSecWepFastU + + + + + + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + false + + + + + + + + + + + + Models/Core/UnitCube.mesh + + false + + + + + + + + + + + Insert name here + Fonts/DroidSans.ttf,100 + + + + + + + + + + + + + + Textures/Icons/Arrow.png + + false + + + + + 50 + true + + + + + + + + + + + + Schema/Entities/DefenderShield.xml + + + + + + + + + + diff --git a/resources/Schema/Entities/WeaponAssaultRedView.xml b/resources/Schema/Entities/WeaponAssaultRedView.xml new file mode 100644 index 00000000..0a9b65b2 --- /dev/null +++ b/resources/Schema/Entities/WeaponAssaultRedView.xml @@ -0,0 +1,109 @@ + + + + + + Models/Weapons/Red/AssaultWeaponRed.mesh + + + + + + + + + Schema/Entities/RayRed.xml + + + + + + + + + + + + Schema/Entities/ReloadEffectView.xml + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + + + + 32 + Fonts/DroidSans.ttf,64 + + + + Player + AssaultWeapon + MagazineAmmo + + + + + + + + + + + 320 + Fonts/DroidSans.ttf,64 + + + + Player + AssaultWeapon + Ammo + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/WeaponAssaultRedWorld.xml b/resources/Schema/Entities/WeaponAssaultRedWorld.xml new file mode 100644 index 00000000..68d78d03 --- /dev/null +++ b/resources/Schema/Entities/WeaponAssaultRedWorld.xml @@ -0,0 +1,34 @@ + + + + + + Models/Weapons/Red/AssaultWeaponRed.mesh + + + + + + + + + Schema/Entities/RayRed.xml + + + + + + + + + + + Schema/Entities/ReloadEffectWorld.xml + + + + + + + + From c1f5cf65a7211ea1029084e48d68f8066ed53630 Mon Sep 17 00:00:00 2001 From: viktorljung Date: Fri, 4 Mar 2016 09:39:16 +0100 Subject: [PATCH 07/14] Movement animations --- .../Engine/Input/FirstPersonInputController.h | 13 +- resources/Schema/Entities/Player.xml | 16 +- src/Game/Systems/PlayerMovementSystem.cpp | 139 ++++++++++++------ 3 files changed, 117 insertions(+), 51 deletions(-) diff --git a/include/Engine/Input/FirstPersonInputController.h b/include/Engine/Input/FirstPersonInputController.h index 2c7013e4..00f36ac7 100644 --- a/include/Engine/Input/FirstPersonInputController.h +++ b/include/Engine/Input/FirstPersonInputController.h @@ -129,14 +129,23 @@ bool FirstPersonInputController::OnCommand(const Events::InputComm if (val > 0) { Events::AutoAnimationBlend aeb; aeb.Duration = 0.1; - aeb.NodeName = "Run"; + + if(m_Crouching) { + aeb.NodeName = "Walk"; + } else { + aeb.NodeName = "Run"; + } aeb.RootNode = playerModel; aeb.Start = true; m_EventBroker->Publish(aeb); } else if (val < 0) { Events::AutoAnimationBlend aeb; aeb.Duration = 0.1; - aeb.NodeName = "Run"; + if (m_Crouching) { + aeb.NodeName = "Walk"; + } else { + aeb.NodeName = "Run"; + } aeb.RootNode = playerModel; aeb.Start = true; aeb.Reverse = true; diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml index 4ff512ac..475acf78 100644 --- a/resources/Schema/Entities/Player.xml +++ b/resources/Schema/Entities/Player.xml @@ -894,11 +894,11 @@ - + - StrafeLeftF - + StrafeRightF + 1 true @@ -906,11 +906,11 @@ - + - StrafeRightF - + StrafeLeftF + 1 true @@ -1022,7 +1022,7 @@ DashLeftF - 3 + 2 false @@ -1034,7 +1034,7 @@ DashRightF - 3 + 2 false diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 8fddbe96..3d897bf7 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -343,52 +343,109 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e) EntityWrapper dashEffect = entityFile->MergeInto(m_World); EntityWrapper playerModel = player.FirstChildByName("PlayerModel"); -/* - auto playerEntityModel = playerModel["Model"]; - + for (auto& kv : m_PlayerInputControllers) { + EntityWrapper player = kv.first; + auto& controller = kv.second; - if (player.HasComponent("Physics")) { - glm::vec3 velocity = (glm::vec3)player["Physics"]["Velocity"]; - - glm::vec2 direction = glm::vec2(velocity.x, velocity.z); - - std::string DashName = ""; - if (glm::abs(direction.x) > glm::abs(direction.y)) { - if(glm::sign(direction.x) > 0) { - DashName = "DashRight"; - } else { - DashName = "DashLeft"; - } - } else { - if (glm::sign(direction.y) > 0) { - DashName = "DashForward"; - } else { - DashName = "DashBackward"; - } + if (!player.Valid()) { + continue; } - { - Events::AutoAnimationBlend aeb; - aeb.Duration = 0.1; - aeb.NodeName = DashName; - aeb.RootNode = playerModel; - aeb.Restart = true; - aeb.Start = true; - m_EventBroker->Publish(aeb); - } - { - Events::AutoAnimationBlend aeb; - aeb.Duration = 0.3; - aeb.NodeName = "StandCrouchBlend"; - aeb.RootNode = playerModel; - aeb.Delay = 0.3; - aeb.Start = true; - aeb.Restart = false; - aeb.AnimationEntity = playerModel.FirstChildByName(DashName); - m_EventBroker->Publish(aeb); + if (player.Valid()) { + EntityWrapper playerModel = player.FirstChildByName("PlayerModel"); + if (playerModel.Valid()) { + if (glm::abs(controller->Movement().x) > glm::abs(controller->Movement().z)) { + if (controller->Movement().x > 0) { + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "DashRight"; + aeb.RootNode = playerModel; + aeb.Restart = true; + aeb.Start = true; + m_EventBroker->Publish(aeb); + } + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "StandCrouchBlend"; + aeb.RootNode = playerModel; + aeb.Delay = -0.3; + aeb.Start = true; + aeb.Restart = false; + aeb.AnimationEntity = playerModel.FirstChildByName("DashForward"); + m_EventBroker->Publish(aeb); + } + } else { + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "DashLeft"; + aeb.RootNode = playerModel; + aeb.Restart = true; + aeb.Start = true; + m_EventBroker->Publish(aeb); + } + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "StandCrouchBlend"; + aeb.RootNode = playerModel; + aeb.Delay = -0.3; + aeb.Start = true; + aeb.Restart = false; + aeb.AnimationEntity = playerModel.FirstChildByName("DashForward"); + m_EventBroker->Publish(aeb); + } + } + } else { + if (controller->Movement().z < 0) { + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "DashForward"; + aeb.RootNode = playerModel; + aeb.Restart = true; + aeb.Start = true; + m_EventBroker->Publish(aeb); + } + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "StandCrouchBlend"; + aeb.RootNode = playerModel; + aeb.Delay = -0.3; + aeb.Start = true; + aeb.Restart = false; + aeb.AnimationEntity = playerModel.FirstChildByName("DashForward"); + m_EventBroker->Publish(aeb); + } + } else { + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "DashBackward"; + aeb.RootNode = playerModel; + aeb.Restart = true; + aeb.Start = true; + m_EventBroker->Publish(aeb); + } + { + Events::AutoAnimationBlend aeb; + aeb.Duration = 0.3; + aeb.NodeName = "StandCrouchBlend"; + aeb.RootNode = playerModel; + aeb.Delay = -0.3; + aeb.Start = true; + aeb.Restart = false; + aeb.AnimationEntity = playerModel.FirstChildByName("DashForward"); + m_EventBroker->Publish(aeb); + } + } + } + } } } - */ /* auto playerEntityAnimation = playerModel["Animation"]; From 4557455e491387b141faed830b3b7c3152ce2bac Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Fri, 4 Mar 2016 09:41:12 +0100 Subject: [PATCH 08/14] HUD stuff --- .../Schema/Entities/PlayerAssaultBlue.xml | 368 +++++++++--------- .../Schema/Entities/PlayerAssaultRed.xml | 368 +++++++++--------- 2 files changed, 376 insertions(+), 360 deletions(-) diff --git a/resources/Schema/Entities/PlayerAssaultBlue.xml b/resources/Schema/Entities/PlayerAssaultBlue.xml index c918dcd6..18125e2c 100644 --- a/resources/Schema/Entities/PlayerAssaultBlue.xml +++ b/resources/Schema/Entities/PlayerAssaultBlue.xml @@ -84,150 +84,6 @@ - - - - - - - - - 1 - - - - - Textures/HealthHUD3.png - - - - - - - - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - 0.0 - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - - - - 1 - - - - 100/100 - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - @@ -481,6 +337,158 @@ + + + + + + + + + + + + 1 + + + + 100/100 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + 1 + + + + + Textures/HealthHUD3.png + + + + + + + + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Assault-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Defender-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Sniper-01.png + + false + + + + + + + + + + + + + + + + + + + + Textures/Icons/Abilities/Superman-01.png + + false + + + + + + + + + + + + + 0.0 + Fonts/DroidSans.ttf,64 + + false + + + + + + + + + + + + + @@ -871,42 +879,6 @@ - - - - Left - Right - 0.033793529385008014 - - - - - - - - StrafeRightF - - 1 - true - - - - - - - - - StrafeLeftF - - 1 - true - - - - - - - @@ -943,6 +915,42 @@ + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeRightF + + 1 + true + + + + + + + + + StrafeLeftF + + 1 + true + + + + + + + diff --git a/resources/Schema/Entities/PlayerAssaultRed.xml b/resources/Schema/Entities/PlayerAssaultRed.xml index af0ba963..6dfc94bc 100644 --- a/resources/Schema/Entities/PlayerAssaultRed.xml +++ b/resources/Schema/Entities/PlayerAssaultRed.xml @@ -84,150 +84,6 @@ - - - - - - - - - 1 - - - - - Textures/HealthHUD3.png - - - - - - - - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - 0.0 - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - - - - 1 - - - - 100/100 - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - @@ -481,6 +337,158 @@ + + + + + + + + + + + + 1 + + + + 100/100 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + 1 + + + + + Textures/HealthHUD3.png + + + + + + + + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Assault-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Defender-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Sniper-01.png + + false + + + + + + + + + + + + + + + + + + + + Textures/Icons/Abilities/Superman-01.png + + false + + + + + + + + + + + + + 0.0 + Fonts/DroidSans.ttf,64 + + false + + + + + + + + + + + + + @@ -871,42 +879,6 @@ - - - - Left - Right - 0.033793529385008014 - - - - - - - - StrafeRightF - - 1 - true - - - - - - - - - StrafeLeftF - - 1 - true - - - - - - - @@ -943,6 +915,42 @@ + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeRightF + + 1 + true + + + + + + + + + StrafeLeftF + + 1 + true + + + + + + + From 434ff1e7eb55e53a0e925e951f3a6c31da98f063 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Fri, 4 Mar 2016 10:03:06 +0100 Subject: [PATCH 09/14] ???? --- resources/Schema/Entities/MovementTest.xml | 6 +- resources/Schema/Entities/Player.xml | 189 +++-- .../Schema/Entities/PlayerAssaultBlue.xml | 658 +++++++++--------- .../Schema/Entities/PlayerAssaultRed.xml | 658 +++++++++--------- resources/Schema/Entities/PlayerModel.xml | 542 +++++++++++++++ .../Systems/Weapon/AssaultWeaponBehaviour.cpp | 12 + 6 files changed, 1300 insertions(+), 765 deletions(-) create mode 100644 resources/Schema/Entities/PlayerModel.xml diff --git a/resources/Schema/Entities/MovementTest.xml b/resources/Schema/Entities/MovementTest.xml index 8202bff3..50f77401 100644 --- a/resources/Schema/Entities/MovementTest.xml +++ b/resources/Schema/Entities/MovementTest.xml @@ -83,7 +83,7 @@ - Schema/Entities/Player.xml + Schema/Entities/PlayerAssaultBlue.xml @@ -98,7 +98,7 @@ - + @@ -111,7 +111,7 @@ - + diff --git a/resources/Schema/Entities/Player.xml b/resources/Schema/Entities/Player.xml index 70b387bb..475acf78 100644 --- a/resources/Schema/Entities/Player.xml +++ b/resources/Schema/Entities/Player.xml @@ -484,12 +484,14 @@ - - MovementBlend - FinalBlend - + + BlendTreeAssaultWeapon + BlendTreeSecondaryWeapon + 0 + true + - Models/Characters/Assault/FirstPersonAssaultBlue.mesh + Models/Characters/Defender/FirstPersonDefenderBlue.mesh @@ -506,8 +508,8 @@ Schema/Entities/WeaponAssaultBlueView.xml - - + + @@ -524,30 +526,29 @@ Schema/Entities/SidearmWeaponView.xml - - + + - + - BlendTreeAssaultWeapon - BlendTreeSecondaryWeapon + Idle + WeaponAction 0 true - + Fire Reload - 0 - true + 1 @@ -555,8 +556,9 @@ - ShootRifleF + ShootShotgunF 1 + true false @@ -567,8 +569,9 @@ ReloadSwitchF + 1 - false + true @@ -576,50 +579,25 @@ - + + + IdleF + + 1 + true + - + - - Idle - Run - 0 - true - - - - - - RunF - 1 - true - true - - - - - - - - - IdleF - 1 - true - true - - - - - - + @@ -653,7 +631,6 @@ Models/Characters/Assault/AssaultBlue.mesh - false @@ -673,8 +650,8 @@ Schema/Entities/WeaponAssaultBlueWorld.xml - - + + @@ -694,8 +671,8 @@ Schema/Entities/SidearmWeaponWorld.xml - - + + @@ -741,12 +718,12 @@ ReloadSwitchBlend - MovementBlend + FinalMovementBlend - + StandCrouchBlend @@ -802,7 +779,7 @@ CrouchStrafeLeftF - + 1 true @@ -814,7 +791,7 @@ CrouchStrafeRightF - + 1 true @@ -828,7 +805,7 @@ CrouchWalkF - + 1 true @@ -871,42 +848,6 @@ - - - - Left - Right - 0.033793529385008014 - - - - - - - - StrafeRightF - - 1 - true - - - - - - - - - StrafeLeftF - - 1 - true - - - - - - - @@ -921,7 +862,7 @@ WalkF - + 1 true @@ -933,7 +874,43 @@ RunF - + + 1 + true + + + + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeRightF + + 1 + true + + + + + + + + + StrafeLeftF + 1 true @@ -949,7 +926,7 @@ IdleF - + 1 true @@ -1009,7 +986,7 @@ DashForwardF - 1 + 2 false @@ -1021,7 +998,7 @@ DashBackwardF - 1 + 2 false @@ -1045,7 +1022,7 @@ DashLeftF - 1 + 2 false @@ -1057,7 +1034,7 @@ DashRightF - 1 + 2 false @@ -1118,7 +1095,7 @@ IdleAssaultRifleU - + 1 true @@ -1130,7 +1107,7 @@ IdleSecWepU - + 1 true diff --git a/resources/Schema/Entities/PlayerAssaultBlue.xml b/resources/Schema/Entities/PlayerAssaultBlue.xml index 18125e2c..057a0abb 100644 --- a/resources/Schema/Entities/PlayerAssaultBlue.xml +++ b/resources/Schema/Entities/PlayerAssaultBlue.xml @@ -652,191 +652,179 @@ + + + BlendTreeAim + BlendTreeAssault + + + + + Models/Characters/Assault/AssaultBlue.mesh + + false + + + + + + - - BlendTreeAim - BlendTreeAssault - - - - - Models/Characters/Assault/AssaultBlue.mesh - - + + R_Arm_Weapon_Joint + + + AssaultWeapon + + + + + + Schema/Entities/WeaponAssaultBlueWorld.xml + + + + + + + + + + + + R_Arm_Weapon_Joint + + + SidearmWeapon + + + + + + Schema/Entities/SidearmWeaponWorld.xml + + + + + + + + + + + + AimPrimary + AimSecondary + 0 + true + - + - - R_Arm_Weapon_Joint - - - AssaultWeapon - - - - - - Schema/Entities/WeaponAssaultBlueWorld.xml - - - - - + + AimSecWepA + + false + true + + - + - - R_Arm_Weapon_Joint - - - SidearmWeapon - - - - - - Schema/Entities/SidearmWeaponWorld.xml - - - - - + + AimRifleA + + false + true + + - + + + + + + ReloadSwitchBlend + FinalMovementBlend + + + + + - AimPrimary - AimSecondary - 0 + StandCrouchBlend + JumpDashBlend + 2.5146881298480398e-63 true - - - - AimSecWepA - - false - true - - - - - - - - - AimRifleA - - false - true - - - - - - - - - - - ReloadSwitchBlend - MovementBlend - - - - - + - StandCrouchBlend - JumpDashBlend - 2.5146881298480398e-63 + StandMovement + CrouchMovement + 0 true - + - StandMovement - CrouchMovement - 0 - true + MovementBlend + Idle + 1 - + - MovementBlend - Idle - 1 + Walk + StrafeLRBlend + 0 - + - Walk - StrafeLRBlend - 0 + Left + Right + 0.033793529385008014 - - - - Left - Right - 0.033793529385008014 - - - - - - - - CrouchStrafeLeftF - - 1 - true - - - - - - - - - CrouchStrafeRightF - - 1 - true - - - - - - - - + - CrouchWalkF - + CrouchStrafeLeftF + + 1 + true + + + + + + + + + CrouchStrafeRightF + 1 true @@ -846,118 +834,11 @@ - + - CrouchF - - 1 - - - - - - - - - - - MovementBlend - Idle - 1 - - - - - - - - RunWalkBlend - StrafeLRBlend - 2.4565650245976452e-16 - - - - - - - - Walk - Run - 1.2938206818383024e-24 - - - - - - - - WalkF - - 1 - true - - - - - - - - - RunF - - 1 - true - - - - - - - - - - - Left - Right - 0.033793529385008014 - - - - - - - - StrafeRightF - - 1 - true - - - - - - - - - StrafeLeftF - - 1 - true - - - - - - - - - - - - - IdleF - + CrouchWalkF + 1 true @@ -967,70 +848,68 @@ - - - - - - Jump - DashBlend - 1 - true - - - - - + - JumpF - + CrouchF + 1 - false - + + + + + + MovementBlend + Idle + 1 + + + + + - DashFBBlend - DashLRBlend - 0.014621149736541383 + RunWalkBlend + StrafeLRBlend + 2.4565650245976452e-16 - + - DashForward - DashBackward - 0.014363533804961248 + Walk + Run + 1.2938206818383024e-24 - + - DashForwardF - + WalkF + 1 - false + true - + - DashBackwardF - + RunF + 1 - false + true @@ -1038,35 +917,35 @@ - + - DashLeft - DashRight - 4.3244885367500671e-16 + Left + Right + 0.033793529385008014 - + - DashLeftF - + StrafeLeftF + 1 - false + true - + - DashRightF - + StrafeRightF + 1 - false + true @@ -1076,71 +955,84 @@ + + + + IdleF + + 1 + true + + + + + - + - ReloadSwitch - WeaponActionBlend + Jump + DashBlend 1 true - + - ReloadSwitchU - + JumpF + 1 + false - + - IdleBlend - ShootBlend - 0 + DashFBBlend + DashLRBlend + 0.014621149736541383 - + - IdlePrimary - IdleSecondary - 0 + DashForward + DashBackward + 0.014363533804961248 - + - IdleAssaultRifleU - - 1 - true + DashForwardF + + 2 + false - + - IdleSecWepU - - 1 - true + DashBackwardF + + 2 + false @@ -1148,31 +1040,35 @@ - + - ShootPrimary - ShootSecondary - 0 + DashLeft + DashRight + 4.3244885367500671e-16 - + - ShootFastRifleU - - 1 + DashLeftF + + 2 + false - + - ShootSecWepFastU + DashRightF + + 2 + false @@ -1186,8 +1082,114 @@ + + + + ReloadSwitch + WeaponActionBlend + 1 + true + + + + + + + + ReloadSwitchU + + 1 + + + + + + + + + IdleBlend + ShootBlend + 0 + + + + + + + + IdlePrimary + IdleSecondary + 0 + + + + + + + + IdleAssaultRifleU + + 1 + true + + + + + + + + + IdleSecWepU + + 1 + true + + + + + + + + + + + ShootPrimary + ShootSecondary + 0 + + + + + + + + ShootFastRifleU + + 1 + + + + + + + + + ShootSecWepFastU + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/PlayerAssaultRed.xml b/resources/Schema/Entities/PlayerAssaultRed.xml index 6dfc94bc..5811cc74 100644 --- a/resources/Schema/Entities/PlayerAssaultRed.xml +++ b/resources/Schema/Entities/PlayerAssaultRed.xml @@ -652,191 +652,179 @@ + + + BlendTreeAim + BlendTreeAssault + + + + + Models/Characters/Assault/AssaultRed.mesh + + false + + + + + + - - BlendTreeAim - BlendTreeAssault - - - - - Models/Characters/Assault/AssaultRed.mesh - - + + R_Arm_Weapon_Joint + + + AssaultWeapon + + + + + + Schema/Entities/WeaponAssaultRedWorld.xml + + + + + + + + + + + + R_Arm_Weapon_Joint + + + SidearmWeapon + + + + + + Schema/Entities/SidearmWeaponWorld.xml + + + + + + + + + + + + AimPrimary + AimSecondary + 0 + true + - + - - R_Arm_Weapon_Joint - - - AssaultWeapon - - - - - - Schema/Entities/WeaponAssaultRedWorld.xml - - - - - + + AimSecWepA + + false + true + + - + - - R_Arm_Weapon_Joint - - - SidearmWeapon - - - - - - Schema/Entities/SidearmWeaponWorld.xml - - - - - + + AimRifleA + + false + true + + - + + + + + + ReloadSwitchBlend + FinalMovementBlend + + + + + - AimPrimary - AimSecondary - 0 + StandCrouchBlend + JumpDashBlend + 2.5146881298480398e-63 true - - - - AimSecWepA - - false - true - - - - - - - - - AimRifleA - - false - true - - - - - - - - - - - ReloadSwitchBlend - MovementBlend - - - - - + - StandCrouchBlend - JumpDashBlend - 2.5146881298480398e-63 + StandMovement + CrouchMovement + 0 true - + - StandMovement - CrouchMovement - 0 - true + MovementBlend + Idle + 1 - + - MovementBlend - Idle - 1 + Walk + StrafeLRBlend + 0 - + - Walk - StrafeLRBlend - 0 + Left + Right + 0.033793529385008014 - - - - Left - Right - 0.033793529385008014 - - - - - - - - CrouchStrafeLeftF - - 1 - true - - - - - - - - - CrouchStrafeRightF - - 1 - true - - - - - - - - + - CrouchWalkF - + CrouchStrafeLeftF + + 1 + true + + + + + + + + + CrouchStrafeRightF + 1 true @@ -846,118 +834,11 @@ - + - CrouchF - - 1 - - - - - - - - - - - MovementBlend - Idle - 1 - - - - - - - - RunWalkBlend - StrafeLRBlend - 2.4565650245976452e-16 - - - - - - - - Walk - Run - 1.2938206818383024e-24 - - - - - - - - WalkF - - 1 - true - - - - - - - - - RunF - - 1 - true - - - - - - - - - - - Left - Right - 0.033793529385008014 - - - - - - - - StrafeRightF - - 1 - true - - - - - - - - - StrafeLeftF - - 1 - true - - - - - - - - - - - - - IdleF - + CrouchWalkF + 1 true @@ -967,70 +848,68 @@ - - - - - - Jump - DashBlend - 1 - true - - - - - + - JumpF - + CrouchF + 1 - false - + + + + + + MovementBlend + Idle + 1 + + + + + - DashFBBlend - DashLRBlend - 0.014621149736541383 + RunWalkBlend + StrafeLRBlend + 2.4565650245976452e-16 - + - DashForward - DashBackward - 0.014363533804961248 + Walk + Run + 1.2938206818383024e-24 - + - DashForwardF - + WalkF + 1 - false + true - + - DashBackwardF - + RunF + 1 - false + true @@ -1038,35 +917,35 @@ - + - DashLeft - DashRight - 4.3244885367500671e-16 + Left + Right + 0.033793529385008014 - + - DashLeftF - + StrafeLeftF + 1 - false + true - + - DashRightF - + StrafeRightF + 1 - false + true @@ -1076,71 +955,84 @@ + + + + IdleF + + 1 + true + + + + + - + - ReloadSwitch - WeaponActionBlend + Jump + DashBlend 1 true - + - ReloadSwitchU - + JumpF + 1 + false - + - IdleBlend - ShootBlend - 0 + DashFBBlend + DashLRBlend + 0.014621149736541383 - + - IdlePrimary - IdleSecondary - 0 + DashForward + DashBackward + 0.014363533804961248 - + - IdleAssaultRifleU - - 1 - true + DashForwardF + + 2 + false - + - IdleSecWepU - - 1 - true + DashBackwardF + + 2 + false @@ -1148,31 +1040,35 @@ - + - ShootPrimary - ShootSecondary - 0 + DashLeft + DashRight + 4.3244885367500671e-16 - + - ShootFastRifleU - - 1 + DashLeftF + + 2 + false - + - ShootSecWepFastU + DashRightF + + 2 + false @@ -1186,8 +1082,114 @@ + + + + ReloadSwitch + WeaponActionBlend + 1 + true + + + + + + + + ReloadSwitchU + + 1 + + + + + + + + + IdleBlend + ShootBlend + 0 + + + + + + + + IdlePrimary + IdleSecondary + 0 + + + + + + + + IdleAssaultRifleU + + 1 + true + + + + + + + + + IdleSecWepU + + 1 + true + + + + + + + + + + + ShootPrimary + ShootSecondary + 0 + + + + + + + + ShootFastRifleU + + 1 + + + + + + + + + ShootSecWepFastU + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/PlayerModel.xml b/resources/Schema/Entities/PlayerModel.xml new file mode 100644 index 00000000..a26fbc08 --- /dev/null +++ b/resources/Schema/Entities/PlayerModel.xml @@ -0,0 +1,542 @@ + + + + + + BlendTreeAim + BlendTreeAssault + + + + + Models/Characters/Assault/AssaultBlue.mesh + + false + + + + + + + + + R_Arm_Weapon_Joint + + + AssaultWeapon + + + + + + Schema/Entities/WeaponAssaultBlueWorld.xml + + + + + + + + + + + + R_Arm_Weapon_Joint + + + SidearmWeapon + + + + + + Schema/Entities/SidearmWeaponWorld.xml + + + + + + + + + + + + AimPrimary + AimSecondary + 0 + true + + + + + + + + AimSecWepA + + false + true + + + + + + + + + AimRifleA + + false + true + + + + + + + + + + + ReloadSwitchBlend + FinalMovementBlend + + + + + + + + StandCrouchBlend + JumpDashBlend + 2.5146881298480398e-63 + true + + + + + + + + StandMovement + CrouchMovement + 0 + true + + + + + + + + MovementBlend + Idle + 1 + + + + + + + + Walk + StrafeLRBlend + 0 + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + CrouchStrafeLeftF + + 1 + true + + + + + + + + + CrouchStrafeRightF + + 1 + true + + + + + + + + + + + CrouchWalkF + + 1 + true + + + + + + + + + + + CrouchF + + 1 + + + + + + + + + + + MovementBlend + Idle + 1 + + + + + + + + RunWalkBlend + StrafeLRBlend + 2.4565650245976452e-16 + + + + + + + + Walk + Run + 1.2938206818383024e-24 + + + + + + + + WalkF + + 1 + true + + + + + + + + + RunF + + 1 + true + + + + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeLeftF + + 1 + true + + + + + + + + + StrafeRightF + + 1 + true + + + + + + + + + + + + + IdleF + + 1 + true + + + + + + + + + + + + + Jump + DashBlend + 1 + true + + + + + + + + JumpF + + 1 + false + + + + + + + + + DashFBBlend + DashLRBlend + 0.014621149736541383 + + + + + + + + DashForward + DashBackward + 0.014363533804961248 + + + + + + + + DashForwardF + + 2 + false + + + + + + + + + DashBackwardF + + 2 + false + + + + + + + + + + + DashLeft + DashRight + 4.3244885367500671e-16 + + + + + + + + DashLeftF + + 2 + false + + + + + + + + + DashRightF + + 2 + false + + + + + + + + + + + + + + + + + ReloadSwitch + WeaponActionBlend + 1 + true + + + + + + + + ReloadSwitchU + + 1 + + + + + + + + + IdleBlend + ShootBlend + 0 + + + + + + + + IdlePrimary + IdleSecondary + 0 + + + + + + + + IdleAssaultRifleU + + 1 + true + + + + + + + + + IdleSecWepU + + 1 + true + + + + + + + + + + + ShootPrimary + ShootSecondary + 0 + + + + + + + + ShootFastRifleU + + 1 + + + + + + + + + ShootSecWepFastU + + + + + + + + + + + + + + + + diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 3e97fe85..2e21bc18 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -127,6 +127,12 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi) wi.FirstPersonEntity["Model"]["Visible"] = false; wi.ThirdPersonEntity["Model"]["Visible"] = false; } + + // Sound + Events::PlaySoundOnEntity e; + e.EmitterID = wi.Player.ID; + e.FilePath = "Audio/weapon/Assault/AssaultWeaponReload.wav"; + m_EventBroker->Publish(e); } void AssaultWeaponBehaviour::OnEquip(ComponentWrapper cWeapon, WeaponInfo& wi) @@ -208,6 +214,12 @@ void AssaultWeaponBehaviour::fireBullet(ComponentWrapper cWeapon, WeaponInfo& wi // Play animation playAnimationAndReturn(wi.FirstPersonEntity, "BlendTreeAssaultWeapon", "Fire"); + + // Sound + Events::PlaySoundOnEntity e; + e.EmitterID = wi.Player.ID; + e.FilePath = "Audio/weapon/Assault/AssaultWeaponFire.wav"; + m_EventBroker->Publish(e); } bool AssaultWeaponBehaviour::canFire(ComponentWrapper cWeapon, WeaponInfo& wi) From b7a7f7fd5e4279af002ecfa03cc44c4ee7a37ec4 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Fri, 4 Mar 2016 15:02:01 +0100 Subject: [PATCH 10/14] ???? --- include/Engine/Network/Client.h | 2 +- include/Engine/Network/Server.h | 2 +- .../Schema/Entities/PlayerAssaultBlue.xml | 771 ++++++++++-------- .../Schema/Entities/PlayerAssaultRed.xml | 771 ++++++++++-------- src/Engine/Network/Client.cpp | 28 +- src/Engine/Network/Server.cpp | 71 +- src/Engine/Network/UDPServer.cpp | 11 +- .../Systems/Weapon/AssaultWeaponBehaviour.cpp | 16 +- 8 files changed, 951 insertions(+), 721 deletions(-) diff --git a/include/Engine/Network/Client.h b/include/Engine/Network/Client.h index 4ee071d2..2fa81549 100644 --- a/include/Engine/Network/Client.h +++ b/include/Engine/Network/Client.h @@ -52,7 +52,7 @@ public: void Connect(std::string address, int port); void Update() override; private: - UDPClient m_Unreliable; + //UDPClient m_Unreliable; TCPClient m_Reliable; std::vector m_PlayerSpawnEvents; void parseSpawnEvents(); diff --git a/include/Engine/Network/Server.h b/include/Engine/Network/Server.h index 395c80c7..48b7bcfa 100644 --- a/include/Engine/Network/Server.h +++ b/include/Engine/Network/Server.h @@ -36,7 +36,7 @@ public: private: // Network channels TCPServer m_Reliable; - UDPServer m_Unreliable; + //UDPServer m_Unreliable; UDPServer m_ServerlistRequest; // dont forget to set these in the childrens receive logic boost::asio::ip::address m_Address; diff --git a/resources/Schema/Entities/PlayerAssaultBlue.xml b/resources/Schema/Entities/PlayerAssaultBlue.xml index 057a0abb..7773235b 100644 --- a/resources/Schema/Entities/PlayerAssaultBlue.xml +++ b/resources/Schema/Entities/PlayerAssaultBlue.xml @@ -6,7 +6,9 @@ - + + 0.5 + @@ -519,7 +521,113 @@ - + + + + + Models/Weapons/Blue/AssaultWeaponBlue.mesh + + + + + + + + + + + + + + Schema/Entities/RayBlue.xml + + + + + + + + + + + + Schema/Entities/ReloadEffectView.xml + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + + + + 32 + Fonts/DroidSans.ttf,64 + + + + PlayerAssault + AssaultWeapon + MagazineAmmo + + + + + + + + + + + 320 + Fonts/DroidSans.ttf,64 + + + + PlayerAssault + AssaultWeapon + Ammo + + + + + + + + + + + + + + + @@ -652,179 +760,192 @@ - - - BlendTreeAim - BlendTreeAssault - - - - - Models/Characters/Assault/AssaultBlue.mesh - - false - - - - - - - - R_Arm_Weapon_Joint - - - AssaultWeapon - - - - - - Schema/Entities/WeaponAssaultBlueWorld.xml - - - - - - - - - - - - R_Arm_Weapon_Joint - - - SidearmWeapon - - - - - - Schema/Entities/SidearmWeaponWorld.xml - - - - - - - - - - - - AimPrimary - AimSecondary - 0 - true - + + BlendTreeAim + BlendTreeAssault + + + + + Models/Characters/Assault/AssaultBlue.mesh + + true + - + - - AimSecWepA - - false - true - - + + R_Arm_Weapon_Joint + + + AssaultWeapon + + + + + + Schema/Entities/WeaponAssaultBlueWorld.xml + + + + + - + - - AimRifleA - - false - true - - + + R_Arm_Weapon_Joint + + + SidearmWeapon + + + + + + Schema/Entities/SidearmWeaponWorld.xml + + + + + - - - - - - ReloadSwitchBlend - FinalMovementBlend - - - - - + - StandCrouchBlend - JumpDashBlend - 2.5146881298480398e-63 + AimPrimary + AimSecondary + 0 true - + + + + AimSecWepA + + false + true + + + + + + + + + AimRifleA + + false + true + + + + + + + + + + + ReloadSwitchBlend + FinalMovementBlend + + + + + - StandMovement - CrouchMovement - 0 + StandCrouchBlend + JumpDashBlend + 2.5146881298480398e-63 true - + - MovementBlend - Idle - 1 + StandMovement + CrouchMovement + 0 + true - + - Walk - StrafeLRBlend - 0 + MovementBlend + Idle + 1 - + - Left - Right - 0.033793529385008014 + Walk + StrafeLRBlend + 0 - + - - CrouchStrafeLeftF - - 1 - true - + + Left + Right + 0.033793529385008014 + - + + + + + CrouchStrafeLeftF + + 1 + true + + + + + + + + + CrouchStrafeRightF + + 1 + true + + + + + + - + - CrouchStrafeRightF - + CrouchWalkF + 1 true @@ -834,11 +955,118 @@ - + - CrouchWalkF - + CrouchF + + 1 + + + + + + + + + + + MovementBlend + Idle + 1 + + + + + + + + RunWalkBlend + StrafeLRBlend + 2.4565650245976452e-16 + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeLeftF + + 1 + true + + + + + + + + + StrafeRightF + + 1 + true + + + + + + + + + + + Walk + Run + 1.2938206818383024e-24 + + + + + + + + WalkF + + 1 + true + + + + + + + + + RunF + + 1 + true + + + + + + + + + + + + + IdleF + 1 true @@ -848,68 +1076,70 @@ - + + + + + + Jump + DashBlend + 1 + true + + + + + - CrouchF - + JumpF + 1 + false - - - - - - MovementBlend - Idle - 1 - - - - - + - RunWalkBlend - StrafeLRBlend - 2.4565650245976452e-16 + DashFBBlend + DashLRBlend + 0.014621149736541383 - + - Walk - Run - 1.2938206818383024e-24 + DashForward + DashBackward + 0.014363533804961248 - + - WalkF - - 1 - true + DashForwardF + + 2 + false - + - RunF - - 1 - true + DashBackwardF + + 2 + false @@ -917,35 +1147,35 @@ - + - Left - Right - 0.033793529385008014 + DashLeft + DashRight + 4.3244885367500671e-16 - + - StrafeLeftF - - 1 - true + DashLeftF + + 2 + false - + - StrafeRightF - - 1 - true + DashRightF + + 2 + false @@ -955,84 +1185,71 @@ - - - - IdleF - - 1 - true - - - - - - + - Jump - DashBlend + ReloadSwitch + WeaponActionBlend 1 true - + - JumpF - + ReloadSwitchU + 1 - false - + - DashFBBlend - DashLRBlend - 0.014621149736541383 + IdleBlend + ShootBlend + 0 - + - DashForward - DashBackward - 0.014363533804961248 + IdlePrimary + IdleSecondary + 0 - + - DashForwardF - - 2 - false + IdleAssaultRifleU + + 1 + true - + - DashBackwardF - - 2 - false + IdleSecWepU + + 1 + true @@ -1040,35 +1257,31 @@ - + - DashLeft - DashRight - 4.3244885367500671e-16 + ShootPrimary + ShootSecondary + 0 - + - DashLeftF - - 2 - false + ShootFastRifleU + + 1 - + - DashRightF - - 2 - false + ShootSecWepFastU @@ -1082,114 +1295,8 @@ - - - - ReloadSwitch - WeaponActionBlend - 1 - true - - - - - - - - ReloadSwitchU - - 1 - - - - - - - - - IdleBlend - ShootBlend - 0 - - - - - - - - IdlePrimary - IdleSecondary - 0 - - - - - - - - IdleAssaultRifleU - - 1 - true - - - - - - - - - IdleSecWepU - - 1 - true - - - - - - - - - - - ShootPrimary - ShootSecondary - 0 - - - - - - - - ShootFastRifleU - - 1 - - - - - - - - - ShootSecWepFastU - - - - - - - - - - - - - diff --git a/resources/Schema/Entities/PlayerAssaultRed.xml b/resources/Schema/Entities/PlayerAssaultRed.xml index 5811cc74..a198196e 100644 --- a/resources/Schema/Entities/PlayerAssaultRed.xml +++ b/resources/Schema/Entities/PlayerAssaultRed.xml @@ -6,7 +6,9 @@ - + + 0.5 + @@ -519,7 +521,113 @@ - + + + + + Models/Weapons/Red/AssaultWeaponRed.mesh + + + + + + + + + + + + + + Schema/Entities/RayRed.xml + + + + + + + + + + + + Schema/Entities/ReloadEffectView.xml + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + + + + 32 + Fonts/DroidSans.ttf,64 + + + + PlayerAssault + AssaultWeapon + MagazineAmmo + + + + + + + + + + + 320 + Fonts/DroidSans.ttf,64 + + + + PlayerAssault + AssaultWeapon + Ammo + + + + + + + + + + + + + + + @@ -652,179 +760,192 @@ - - - BlendTreeAim - BlendTreeAssault - - - - - Models/Characters/Assault/AssaultRed.mesh - - false - - - - - - - - R_Arm_Weapon_Joint - - - AssaultWeapon - - - - - - Schema/Entities/WeaponAssaultRedWorld.xml - - - - - - - - - - - - R_Arm_Weapon_Joint - - - SidearmWeapon - - - - - - Schema/Entities/SidearmWeaponWorld.xml - - - - - - - - - - - - AimPrimary - AimSecondary - 0 - true - + + BlendTreeAim + BlendTreeAssault + + + + + Models/Characters/Assault/AssaultRed.mesh + + true + - + - - AimSecWepA - - false - true - - + + R_Arm_Weapon_Joint + + + AssaultWeapon + + + + + + Schema/Entities/WeaponAssaultRedWorld.xml + + + + + - + - - AimRifleA - - false - true - - + + R_Arm_Weapon_Joint + + + SidearmWeapon + + + + + + Schema/Entities/SidearmWeaponWorld.xml + + + + + - - - - - - ReloadSwitchBlend - FinalMovementBlend - - - - - + - StandCrouchBlend - JumpDashBlend - 2.5146881298480398e-63 + AimPrimary + AimSecondary + 0 true - + + + + AimSecWepA + + false + true + + + + + + + + + AimRifleA + + false + true + + + + + + + + + + + ReloadSwitchBlend + FinalMovementBlend + + + + + - StandMovement - CrouchMovement - 0 + StandCrouchBlend + JumpDashBlend + 2.5146881298480398e-63 true - + - MovementBlend - Idle - 1 + StandMovement + CrouchMovement + 0 + true - + - Walk - StrafeLRBlend - 0 + MovementBlend + Idle + 1 - + - Left - Right - 0.033793529385008014 + Walk + StrafeLRBlend + 0 - + - - CrouchStrafeLeftF - - 1 - true - + + Left + Right + 0.033793529385008014 + - + + + + + CrouchStrafeLeftF + + 1 + true + + + + + + + + + CrouchStrafeRightF + + 1 + true + + + + + + - + - CrouchStrafeRightF - + CrouchWalkF + 1 true @@ -834,11 +955,118 @@ - + - CrouchWalkF - + CrouchF + + 1 + + + + + + + + + + + MovementBlend + Idle + 1 + + + + + + + + RunWalkBlend + StrafeLRBlend + 2.4565650245976452e-16 + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeLeftF + + 1 + true + + + + + + + + + StrafeRightF + + 1 + true + + + + + + + + + + + Walk + Run + 1.2938206818383024e-24 + + + + + + + + WalkF + + 1 + true + + + + + + + + + RunF + + 1 + true + + + + + + + + + + + + + IdleF + 1 true @@ -848,68 +1076,70 @@ - + + + + + + Jump + DashBlend + 1 + true + + + + + - CrouchF - + JumpF + 1 + false - - - - - - MovementBlend - Idle - 1 - - - - - + - RunWalkBlend - StrafeLRBlend - 2.4565650245976452e-16 + DashFBBlend + DashLRBlend + 0.014621149736541383 - + - Walk - Run - 1.2938206818383024e-24 + DashForward + DashBackward + 0.014363533804961248 - + - WalkF - - 1 - true + DashForwardF + + 2 + false - + - RunF - - 1 - true + DashBackwardF + + 2 + false @@ -917,35 +1147,35 @@ - + - Left - Right - 0.033793529385008014 + DashLeft + DashRight + 4.3244885367500671e-16 - + - StrafeLeftF - - 1 - true + DashLeftF + + 2 + false - + - StrafeRightF - - 1 - true + DashRightF + + 2 + false @@ -955,84 +1185,71 @@ - - - - IdleF - - 1 - true - - - - - - + - Jump - DashBlend + ReloadSwitch + WeaponActionBlend 1 true - + - JumpF - + ReloadSwitchU + 1 - false - + - DashFBBlend - DashLRBlend - 0.014621149736541383 + IdleBlend + ShootBlend + 0 - + - DashForward - DashBackward - 0.014363533804961248 + IdlePrimary + IdleSecondary + 0 - + - DashForwardF - - 2 - false + IdleAssaultRifleU + + 1 + true - + - DashBackwardF - - 2 - false + IdleSecWepU + + 1 + true @@ -1040,35 +1257,31 @@ - + - DashLeft - DashRight - 4.3244885367500671e-16 + ShootPrimary + ShootSecondary + 0 - + - DashLeftF - - 2 - false + ShootFastRifleU + + 1 - + - DashRightF - - 2 - false + ShootSecWepFastU @@ -1082,114 +1295,8 @@ - - - - ReloadSwitch - WeaponActionBlend - 1 - true - - - - - - - - ReloadSwitchU - - 1 - - - - - - - - - IdleBlend - ShootBlend - 0 - - - - - - - - IdlePrimary - IdleSecondary - 0 - - - - - - - - IdleAssaultRifleU - - 1 - true - - - - - - - - - IdleSecWepU - - 1 - true - - - - - - - - - - - ShootPrimary - ShootSecondary - 0 - - - - - - - - ShootFastRifleU - - 1 - - - - - - - - - ShootSecWepFastU - - - - - - - - - - - - - diff --git a/src/Engine/Network/Client.cpp b/src/Engine/Network/Client.cpp index d666e550..e29c4755 100644 --- a/src/Engine/Network/Client.cpp +++ b/src/Engine/Network/Client.cpp @@ -49,16 +49,16 @@ void Client::Connect(std::string address, int port) void Client::Update() { m_EventBroker->Process(); - while (m_Unreliable.IsSocketAvailable()) { - // Packet will get real data in receive - Packet packet(MessageType::Invalid); - m_Unreliable.Receive(packet); - if (packet.GetMessageType() == MessageType::Connect) { - parseUDPConnect(packet); - } else { - parseMessageType(packet); - } - } + //while (m_Unreliable.IsSocketAvailable()) { + // // Packet will get real data in receive + // Packet packet(MessageType::Invalid); + // m_Unreliable.Receive(packet); + // if (packet.GetMessageType() == MessageType::Connect) { + // parseUDPConnect(packet); + // } else { + // parseMessageType(packet); + // } + //} while (m_Reliable.IsSocketAvailable()) { // Packet will get real data in receive Packet packet(MessageType::Invalid); @@ -177,8 +177,8 @@ void Client::parseTCPConnect(Packet& packet) Packet UnreliablePacket(MessageType::Connect, m_SendPacketID); // Add player id and other stuff packet.WritePrimitive(m_PlayerID); - m_Unreliable.Send(packet); - LOG_INFO("Sent UDP Connect Server"); + // m_Unreliable.Send(packet); + // LOG_INFO("Sent UDP Connect Server"); } void Client::parsePlayerConnected(Packet & packet) @@ -476,7 +476,7 @@ bool Client::OnInputCommand(const Events::InputCommand & e) if (e.Command == "ConnectToServer") { // Connect for now if (e.Value > 0) { m_Reliable.Connect(m_PlayerName, m_Address, m_Port); - m_Unreliable.Connect(m_PlayerName, m_Address, m_Port); + // m_Unreliable.Connect(m_PlayerName, m_Address, m_Port); } //LOG_DEBUG("Client::OnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID); return true; @@ -613,7 +613,7 @@ void Client::sendLocalPlayerTransform() packet.WritePrimitive((int)cAssaultWeapon["Ammo"]); } - m_Unreliable.Send(packet); + m_Reliable.Send(packet); } void Client::identifyPacketLoss() diff --git a/src/Engine/Network/Server.cpp b/src/Engine/Network/Server.cpp index 0927a675..5bfb4000 100644 --- a/src/Engine/Network/Server.cpp +++ b/src/Engine/Network/Server.cpp @@ -47,19 +47,19 @@ void Server::Update() } } - PlayerDefinition pd; - while (m_Unreliable.IsSocketAvailable()) { - // Packet will get real data in receive - Packet packet(MessageType::Invalid); - m_Unreliable.Receive(packet, pd); - m_Address = pd.Endpoint.address(); - m_Port = pd.Endpoint.port(); - if (packet.GetMessageType() == MessageType::Connect) { - parseUDPConnect(packet); - } else { - parseMessageType(packet); - } - } + //PlayerDefinition pd; + //while (m_Unreliable.IsSocketAvailable()) { + // // Packet will get real data in receive + // Packet packet(MessageType::Invalid); + // m_Unreliable.Receive(packet, pd); + // m_Address = pd.Endpoint.address(); + // m_Port = pd.Endpoint.port(); + // if (packet.GetMessageType() == MessageType::Connect) { + // parseUDPConnect(packet); + // } else { + // parseMessageType(packet); + // } + //} while (m_ServerlistRequest.IsSocketAvailable()) { Packet packet(MessageType::Invalid); @@ -162,7 +162,7 @@ void Server::unreliableBroadcast(Packet& packet) { for (auto& kv : m_ConnectedPlayers) { packet.ChangePacketID(kv.second.PacketID); - m_Unreliable.Send(packet, kv.second); +// m_Unreliable.Send(packet, kv.second); } } @@ -172,7 +172,7 @@ void Server::sendSnapshot() Packet packet(MessageType::Snapshot); addInputCommandsToPacket(packet); addPlayersToPacket(packet, EntityID_Invalid); - unreliableBroadcast(packet); + reliableBroadcast(packet); } void Server::addInputCommandsToPacket(Packet& packet) @@ -320,25 +320,28 @@ void Server::checkForTimeOuts() } } -void Server::parseUDPConnect(Packet & packet) -{ - // Pop size of message int - packet.ReadPrimitive(); - int messageType = packet.ReadPrimitive(); - // Read packet ID - m_PreviousPacketID = m_PacketID; // Set previous packet id - m_PacketID = packet.ReadPrimitive(); //Read new packet id - // parse player id and other stuff - PlayerID playerID = packet.ReadPrimitive(); - // Do something here? - boost::asio::ip::udp::endpoint endpoint(m_Address, m_Port); - m_ConnectedPlayers.at(playerID).Endpoint = endpoint; - LOG_INFO("parseUDPConnect: Spectator \"%s\" connected on IP: %s", m_ConnectedPlayers.at(playerID).Name.c_str(), m_ConnectedPlayers.at(playerID).Endpoint.address().to_string().c_str()); - // Send a message to the player that connected - Packet connnectPacket(MessageType::Connect, m_ConnectedPlayers.at(playerID).PacketID); - m_Unreliable.Send(connnectPacket); - LOG_INFO("UDP Connect sent to client"); -} +//void Server::parseUDPConnect(Packet & packet) +//{ +// // Pop size of message int +// packet.ReadPrimitive(); +// int messageType = packet.ReadPrimitive(); +// // Read packet ID +// m_PreviousPacketID = m_PacketID; // Set previous packet id +// m_PacketID = packet.ReadPrimitive(); //Read new packet id +// // parse player id and other stuff +// PlayerID playerID = packet.ReadPrimitive(); +// if (!EntityWrapper(m_World, playerID).Valid()) { +// +// } +// // Do something here? +// boost::asio::ip::udp::endpoint endpoint(m_Address, m_Port); +// m_ConnectedPlayers.at(playerID).Endpoint = endpoint; +// LOG_INFO("parseUDPConnect: Spectator \"%s\" connected on IP: %s", m_ConnectedPlayers.at(playerID).Name.c_str(), m_ConnectedPlayers.at(playerID).Endpoint.address().to_string().c_str()); +// // Send a message to the player that connected +// Packet connnectPacket(MessageType::Connect, m_ConnectedPlayers.at(playerID).PacketID); +// m_Unreliable.Send(connnectPacket); +// LOG_INFO("UDP Connect sent to client"); +//} void Server::parseTCPConnect(Packet & packet) { diff --git a/src/Engine/Network/UDPServer.cpp b/src/Engine/Network/UDPServer.cpp index 8c9950dc..bfa27d69 100644 --- a/src/Engine/Network/UDPServer.cpp +++ b/src/Engine/Network/UDPServer.cpp @@ -21,33 +21,38 @@ void UDPServer::Send(Packet& packet, PlayerDefinition & playerDefinition) boost::asio::buffer(packet.Data(), packet.Size()), playerDefinition.Endpoint, 0); + LOG_INFO("Size of packet is %i", bytesSent); } catch (const boost::system::system_error& e) { + LOG_INFO(e.what()); // TODO: Clean up invalid endpoints out of m_ConnectedPlayers later playerDefinition.Endpoint = boost::asio::ip::udp::endpoint(); } + } // Send back to endpoint of received packet void UDPServer::Send(Packet & packet) { packet.UpdateSize(); - m_Socket->send_to( + size_t bytesSent = m_Socket->send_to( boost::asio::buffer( packet.Data(), packet.Size()), m_ReceiverEndpoint, 0); + LOG_INFO("Size of packet is %i", bytesSent); } // Broadcasting respond specific logic void UDPServer::Send(Packet & packet, boost::asio::ip::udp::endpoint endpoint) { packet.UpdateSize(); - m_Socket->send_to( + size_t bytesSent = m_Socket->send_to( boost::asio::buffer( packet.Data(), packet.Size()), endpoint, 0); + LOG_INFO("Size of packet is %i", bytesSent); } // Broadcasting @@ -55,7 +60,7 @@ void UDPServer::Broadcast(Packet & packet, int port) { packet.UpdateSize(); m_Socket->set_option(boost::asio::socket_base::broadcast(true)); - m_Socket->send_to( + size_t bytesSent = m_Socket->send_to( boost::asio::buffer( packet.Data(), packet.Size()), diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 2e21bc18..fc5334c9 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -39,8 +39,12 @@ void AssaultWeaponBehaviour::UpdateWeapon(ComponentWrapper cWeapon, WeaponInfo& ammo = glm::max(0, ammo - (magSize - magAmmo)); magAmmo = glm::min(magSize, ammo); isReloading = false; - wi.FirstPersonEntity["Model"]["Visible"] = true; - wi.ThirdPersonEntity["Model"]["Visible"] = true; + if (wi.FirstPersonEntity.Valid()) { + wi.FirstPersonEntity["Model"]["Visible"] = true; + } + if (wi.ThirdPersonEntity.Valid()) { + wi.ThirdPersonEntity["Model"]["Visible"] = true; + } } // Restore view angle @@ -124,8 +128,12 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi) if (reloadEffectSpawner.Valid()) { SpawnerSystem::Spawn(reloadEffectSpawner, reloadEffectSpawner); } - wi.FirstPersonEntity["Model"]["Visible"] = false; - wi.ThirdPersonEntity["Model"]["Visible"] = false; + if (wi.FirstPersonEntity.Valid()) { + wi.FirstPersonEntity["Model"]["Visible"] = false; + } + if (wi.ThirdPersonEntity.Valid()) { + wi.ThirdPersonEntity["Model"]["Visible"] = false; + } } // Sound From a8f2d0a8e6edddca2ece78fc2538aea5001fb836 Mon Sep 17 00:00:00 2001 From: Tleety Date: Mon, 7 Mar 2016 10:48:46 +0100 Subject: [PATCH 11/14] Some assets, some fixes to the scoreboard --- assets | 2 +- resources/Schema/Entities/CP_Rocky.xml | 2288 ++++++++--------- resources/Schema/Entities/ScoreBoard_Main.xml | 4 +- src/Game/Systems/ScoreScreenSystem.cpp | 2 +- 4 files changed, 1148 insertions(+), 1148 deletions(-) diff --git a/assets b/assets index 7a6d7078..0ae73657 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 7a6d70787b036d8ae8763b69ae6ad098bf221c22 +Subproject commit 0ae736570b5600c2ad05f556ccaec4f5341c2b06 diff --git a/resources/Schema/Entities/CP_Rocky.xml b/resources/Schema/Entities/CP_Rocky.xml index a9c4aaac..d034be78 100644 --- a/resources/Schema/Entities/CP_Rocky.xml +++ b/resources/Schema/Entities/CP_Rocky.xml @@ -21,6 +21,27 @@ + + + + + Models/Props/Highground5.mesh + + + + + + + + + + Models/Props/Highground6.mesh + + + + + + @@ -46,11 +67,9 @@ - Models/Props/Walls/SciFiWallBig.mesh + Models/Props/Walls/SciFiWallSmall1.mesh - - - + @@ -69,9 +88,11 @@ - Models/Props/Walls/SciFiWallMedium.mesh + Models/Props/Walls/SciFiWallBig.mesh - + + + @@ -79,7 +100,7 @@ - Models/Props/Walls/SciFiWallSmall1.mesh + Models/Props/Walls/SciFiWallMedium.mesh @@ -149,8 +170,8 @@ Models/Core/UnitCube.mesh - - + + @@ -462,8 +483,8 @@ Models/Core/UnitCube.mesh - - + + @@ -494,23 +515,23 @@ - Schema/Entities/ScoreBoard_Blue.xml + Schema/Entities/ScoreBoard_Red.xml - + - + - + Models/Core/UnitCube.mesh - + @@ -519,14 +540,14 @@ - + - + @@ -623,23 +644,23 @@ - Schema/Entities/ScoreBoard_Red.xml + Schema/Entities/ScoreBoard_Blue.xml - + - + - + Models/Core/UnitCube.mesh - + @@ -648,14 +669,14 @@ - + - + @@ -798,27 +819,6 @@ - - - - - Models/Props/Highground5.mesh - - - - - - - - - - Models/Props/Highground6.mesh - - - - - - @@ -944,6 +944,20 @@ + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + @@ -1103,20 +1117,6 @@ - - - - - Models/Props/Pillars/SciFiPillar2Blue.mesh - - - - - - - - - @@ -1430,11 +1430,11 @@ 2 - + - + @@ -1451,7 +1451,7 @@ - + @@ -1477,11 +1477,11 @@ 2 - + - + @@ -1498,7 +1498,7 @@ - + @@ -1524,11 +1524,11 @@ 2 - + - + @@ -1545,7 +1545,7 @@ - + @@ -1571,11 +1571,11 @@ 2 - + - + @@ -1592,7 +1592,7 @@ - + @@ -1618,11 +1618,11 @@ 2 - + - + @@ -1639,7 +1639,7 @@ - + @@ -1665,11 +1665,11 @@ 2 - + - + @@ -1686,7 +1686,7 @@ - + @@ -1712,11 +1712,11 @@ 2 - + - + @@ -1733,7 +1733,7 @@ - + @@ -2981,11 +2981,11 @@ 2 - + - + @@ -3002,7 +3002,7 @@ - + @@ -3028,11 +3028,11 @@ 2 - + - + @@ -3049,7 +3049,7 @@ - + @@ -3301,19 +3301,6 @@ - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - @@ -3382,237 +3369,21 @@ - - - - - - - - Models/Props/Walls/SmallWall3.mesh + Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/MediumWall2.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/MediumWall2.mesh - - - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - - Models/Props/Walls/MediumWall2.mesh - - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - - Models/Props/Walls/SmallWall3.mesh - - - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - Models/Props/Walls/BigWallRed.mesh - - - - - - - - - - - - - - Models/Props/Walls/BigWallBlue.mesh - - - - - - - - - - - - Models/Props/Walls/BigWallBlue.mesh - - - - - - - - - - - - - - Models/Props/Walls/MediumWall2.mesh - - - - + + - - - - Models/Core/UnitPlane.mesh - - true - - - - - - - - - @@ -3630,58 +3401,6 @@ - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - - @@ -3734,6 +3453,58 @@ + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + @@ -3826,6 +3597,235 @@ + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + @@ -3855,37 +3855,11 @@ - Models/Props/Stones/BigStone.mesh + Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - + + @@ -3917,6 +3891,164 @@ + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + @@ -3948,11 +4080,103 @@ - Models/Props/Stones/SmallStone1.mesh + Models/Props/Stones/BigStone.mesh - - + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + @@ -3970,6 +4194,19 @@ + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + @@ -4038,98 +4275,6 @@ - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - @@ -4144,151 +4289,6 @@ - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - @@ -4304,9 +4304,59 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + @@ -4347,47 +4397,27 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - + + + - - - - - - - - - - - - - - - - - 2 - - - - - - - - - - - - - - - - - - - + + + + + + + 6 + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + @@ -4403,21 +4433,6 @@ - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - @@ -4433,6 +4448,18 @@ + + + + + 3 + + + + + + + @@ -4458,18 +4485,6 @@ - - - - - 3 - - - - - - - @@ -4487,21 +4502,6 @@ - - - - - 6 - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - @@ -4509,6 +4509,53 @@ + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + @@ -4525,11 +4572,11 @@ 2 - + - + @@ -4546,54 +4593,7 @@ - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - 2 - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - + @@ -4619,11 +4619,11 @@ 2 - + - + @@ -4640,148 +4640,7 @@ - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - 2 - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - 2 - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - 2 - - - - - - - - - - - - - - 8 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - + @@ -4807,11 +4666,11 @@ 2 - + - + @@ -4828,7 +4687,148 @@ - + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + 2 + + + + + + + + + + + + + + 8 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + @@ -4845,21 +4845,6 @@ - - - - - 6 - Models/Props/Pillars/SciFiPillar1Blue.mesh - - - - - - - - - @@ -4888,6 +4873,21 @@ + + + + + 6 + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + @@ -4906,84 +4906,70 @@ - + - + + + Schema/Entities/Player.xml + + + + + + + + + - + - - 10 - + + + Models/Characters/Assault/AssaultTPose.mesh + false + - + - + - - 1 - - - - - - - - - - 10 - + + + Models/Characters/Assault/AssaultTPose.mesh + false + - + - + - - - 10 - + + + Models/Characters/Assault/AssaultTPose.mesh + false + - + - + - - 10 - + + + Models/Characters/Assault/AssaultTPose.mesh + false + - - - - - - - - - 10 - - - - - - - - - - - 0.40000000596046448 - - - + @@ -5006,19 +4992,6 @@ - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - @@ -5032,19 +5005,6 @@ - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - @@ -5058,6 +5018,116 @@ + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + + + + + + + + 10 + + + + + + + + + + + 0.40000000596046448 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + + 10 + + + + + + + + + + + 1 + + + + + + + + + 10 + + + + + + + @@ -5065,6 +5135,38 @@ + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 1 + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + @@ -5105,38 +5207,6 @@ - - - - - Models/Props/CapturePoint/CapturePointNeutral.mesh - - - - - - - - - - 3 - - - - Models/Core/UnitCylinder.mesh - - true - - - - - - - - - - - @@ -5169,38 +5239,6 @@ - - - - - Models/Props/CapturePoint/CapturePointNeutral.mesh - - - - - - - - - - 1 - - - - Models/Core/UnitCylinder.mesh - - true - - - - - - - - - - - @@ -5240,75 +5278,37 @@ - - - - - - - Schema/Entities/Player.xml - - - - - - - - - - - - + - + - Models/Characters/Assault/AssaultTPose.mesh - false + Models/Props/CapturePoint/CapturePointNeutral.mesh - + - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - + + + + + 3 + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + diff --git a/resources/Schema/Entities/ScoreBoard_Main.xml b/resources/Schema/Entities/ScoreBoard_Main.xml index 565fb57b..ccc1df68 100644 --- a/resources/Schema/Entities/ScoreBoard_Main.xml +++ b/resources/Schema/Entities/ScoreBoard_Main.xml @@ -21,11 +21,11 @@ - + - + diff --git a/src/Game/Systems/ScoreScreenSystem.cpp b/src/Game/Systems/ScoreScreenSystem.cpp index 6166e892..94674432 100644 --- a/src/Game/Systems/ScoreScreenSystem.cpp +++ b/src/Game/Systems/ScoreScreenSystem.cpp @@ -78,7 +78,7 @@ void ScoreScreenSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& if (it == m_PlayerIdentities.end()) { break; - } + } if(found == false) { if(it->second.Team != currentTeam) { From 388fe7c259fd71418fbe67c101a14d0b45f44eeb Mon Sep 17 00:00:00 2001 From: Tleety Date: Mon, 7 Mar 2016 11:28:10 +0100 Subject: [PATCH 12/14] Fixed some stuff on the player HUD --- resources/Schema/Entities/PlayerHUD.xml | 356 +++++++++++++----------- 1 file changed, 195 insertions(+), 161 deletions(-) diff --git a/resources/Schema/Entities/PlayerHUD.xml b/resources/Schema/Entities/PlayerHUD.xml index e3e9165b..cf07bc56 100644 --- a/resources/Schema/Entities/PlayerHUD.xml +++ b/resources/Schema/Entities/PlayerHUD.xml @@ -31,116 +31,6 @@ - - - - - - - - - 1 - - - - - Textures/HUD/HealthHudTriMain.png - - - - - - - - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - - - - - - Textures/Core/White.png - - false - - - - - - - - - - - - - - - - - 1 - - - - 100/100 - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - @@ -154,40 +44,7 @@ Textures/Core/UnitHexagon.png - - - - - - - - - - - 2 - - - - - - Textures/Core/UnitHexagon_Rotated.png - - - - - - - - - - - - - - - - Textures/Core/UnitHexagon.png - + false @@ -197,15 +54,16 @@ - - 3 - + + 3 + Textures/Core/UnitHexagon_Rotated.png + false @@ -222,6 +80,7 @@ Textures/Core/UnitHexagon.png + false @@ -231,16 +90,17 @@ - - 4 - 1 + + 4 + Textures/Core/UnitHexagon_Rotated.png + false @@ -257,6 +117,43 @@ Textures/Core/UnitHexagon.png + false + + + + + + + + + + + + + + 2 + + + Textures/Core/UnitHexagon_Rotated.png + + false + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + false @@ -266,15 +163,16 @@ - - 1 - + + 1 + Textures/Core/UnitHexagon_Rotated.png + false @@ -291,6 +189,7 @@ Textures/Core/UnitHexagon.png + false @@ -300,14 +199,15 @@ - 1 + Textures/Core/UnitHexagon_Rotated.png + false @@ -377,23 +277,157 @@ - - - Models/Widgets/Arrows/Arrow5.mesh - + + + Models/Widgets/Arrows/Arrow5.mesh + - - - + + + + + + + + + + + + + + 1 + + + + 100/100 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + 1 + + + + + Textures/HealthHUD3.png + + + + + + + + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Assault-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Defender-01.png + + false + + + + + + + + + + + + + + + + + Textures/Icons/Boosts/Sniper-01.png + + false + + + + + + + + + + + + + + + + + + + + Textures/Icons/Abilities/Superman-01.png + + false + + + + + + + + + + + + From 99d663d5a226866d431a09e3e128f28f8acd718e Mon Sep 17 00:00:00 2001 From: Tleety Date: Mon, 7 Mar 2016 13:55:37 +0100 Subject: [PATCH 13/14] ShiftIcon should now track ability depending on what ability the player has and change icon accordingly. --- .../Game/Systems/AbilityCooldownHUDSystem.h | 1 + src/Game/Systems/AbilityCooldownHUDSystem.cpp | 48 +++++++++++++++---- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/include/Game/Systems/AbilityCooldownHUDSystem.h b/include/Game/Systems/AbilityCooldownHUDSystem.h index 610b4dc2..f2710ce3 100644 --- a/include/Game/Systems/AbilityCooldownHUDSystem.h +++ b/include/Game/Systems/AbilityCooldownHUDSystem.h @@ -12,6 +12,7 @@ public: { } virtual void Update(double dt) override; +private: }; #endif \ No newline at end of file diff --git a/src/Game/Systems/AbilityCooldownHUDSystem.cpp b/src/Game/Systems/AbilityCooldownHUDSystem.cpp index ccb12a97..e2734b47 100644 --- a/src/Game/Systems/AbilityCooldownHUDSystem.cpp +++ b/src/Game/Systems/AbilityCooldownHUDSystem.cpp @@ -11,21 +11,53 @@ void AbilityCooldownHUDSystem::Update(double dt) for (auto& abilityHUDC : *abilityHUDs) { EntityWrapper entity = EntityWrapper(m_World, abilityHUDC.EntityID); EntityWrapper abilityEntity = entity.FirstParentWithComponent("DashAbility"); - if (!abilityEntity.Valid()) - return; + std::string abilityName = ""; + + if (!abilityEntity.Valid()) { + //If we dont have a dash ability on player, we check for Sprint ability + abilityEntity = entity.FirstParentWithComponent("SprintAbility"); + + if (!abilityEntity.Valid()) { + //If we dont have a sprint ability on player, we check for shield ability + abilityEntity = entity.FirstParentWithComponent("ShieldAbility"); + + if (!abilityEntity.Valid()) { + //If we dont have a shield ability, we return, since we cannot do anything. + return; + } else { + //If we have a shield ability, we set the right icon + abilityName = "ShieldAbility"; + if (entity.HasComponent("Sprite")) { + (std::string&)entity["Sprite"]["DiffuseTexture"] = "Textures\\Icons\\Abilities\\SheildDots-01.png"; + } + } + } else { + //If we do have a sprint ability, we change the icon + abilityName = "SprintAbility"; + if (entity.HasComponent("Sprite")) { + (std::string&)entity["Sprite"]["DiffuseTexture"] = "Textures\\Icons\\Abilities\\Dash-01.png"; + } + } + } else { + //If we have a dash ability, we set the icon to the correct one. + abilityName = "DashAbility"; + if (entity.HasComponent("Sprite")) { + (std::string&)entity["Sprite"]["DiffuseTexture"] = "Textures\\Icons\\Abilities\\Superman-01.png"; + } + } + EntityWrapper cooldownTextEntity = entity.FirstChildByName("Cooldown"); - double maxAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownMaxTimer"]; - double currentAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownTimer"]; - + double maxAbilityCD = (double)abilityEntity[abilityName]["CoolDownMaxTimer"]; + double currentAbilityCD = (double)abilityEntity[abilityName]["CoolDownTimer"]; currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0; - if(cooldownTextEntity.Valid()) { - if(cooldownTextEntity.HasComponent("Text")) - { + if (cooldownTextEntity.Valid()) { + if (cooldownTextEntity.HasComponent("Text")) { std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(currentAbilityCD).substr(0, 3); } } + if (entity.HasComponent("Fill")) { entity["Fill"]["Percentage"] = currentAbilityCD/maxAbilityCD; } From 47ece6a5bf7ac1b5f7feb2d15a26e7a97ff38401 Mon Sep 17 00:00:00 2001 From: Tleety Date: Mon, 7 Mar 2016 14:42:50 +0100 Subject: [PATCH 14/14] Changed shield component to track Active, so it and sprint glow full if they are active. Changed how reflections are calculated with light. --- assets | 2 +- resources/Schema/Components/ShieldAbility.xml | 2 +- resources/Schema/Components/ShieldAbility.xsd | 4 +-- resources/Shaders/ForwardPlus.frag.glsl | 2 +- .../Shaders/ForwardPlusShieldCheck.frag.glsl | 2 +- src/Game/Systems/AbilityCooldownHUDSystem.cpp | 29 +++++++++++++++---- 6 files changed, 29 insertions(+), 12 deletions(-) diff --git a/assets b/assets index 0ae73657..52ea74c5 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 0ae736570b5600c2ad05f556ccaec4f5341c2b06 +Subproject commit 52ea74c5d5996ebcd7b064e0a8be469c9f07926e diff --git a/resources/Schema/Components/ShieldAbility.xml b/resources/Schema/Components/ShieldAbility.xml index 49fcf0c0..d66dca31 100644 --- a/resources/Schema/Components/ShieldAbility.xml +++ b/resources/Schema/Components/ShieldAbility.xml @@ -1,4 +1,4 @@ - 2.0 + false \ No newline at end of file diff --git a/resources/Schema/Components/ShieldAbility.xsd b/resources/Schema/Components/ShieldAbility.xsd index 5cf2145c..bbb30c82 100644 --- a/resources/Schema/Components/ShieldAbility.xsd +++ b/resources/Schema/Components/ShieldAbility.xsd @@ -9,8 +9,8 @@ - - This is the cooldown on shield + + If the shield is active or not diff --git a/resources/Shaders/ForwardPlus.frag.glsl b/resources/Shaders/ForwardPlus.frag.glsl index aa45d118..8f0f7deb 100644 --- a/resources/Shaders/ForwardPlus.frag.glsl +++ b/resources/Shaders/ForwardPlus.frag.glsl @@ -171,7 +171,7 @@ void main() vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed); color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)); float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0; - vec4 reflectionTotal = reflectionColor * (1-specularTexel.a) * color_result.a; + vec4 reflectionTotal = reflectionColor * (1-specularTexel.a) * color_result.a * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)); color_result = color_result * clamp(1/specularTexel.a, 0, 1) + reflectionTotal; //vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color; diff --git a/resources/Shaders/ForwardPlusShieldCheck.frag.glsl b/resources/Shaders/ForwardPlusShieldCheck.frag.glsl index 35db495b..5995facb 100644 --- a/resources/Shaders/ForwardPlusShieldCheck.frag.glsl +++ b/resources/Shaders/ForwardPlusShieldCheck.frag.glsl @@ -178,7 +178,7 @@ void main() vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed); color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)); float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0; - vec4 reflectionTotal = reflectionColor * (1-specularTexel.a) * color_result.a; + vec4 reflectionTotal = reflectionColor * (1-specularTexel.a) * color_result.a * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)); color_result = color_result * clamp(1/specularTexel.a, 0, 1) + reflectionTotal; //vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color; diff --git a/src/Game/Systems/AbilityCooldownHUDSystem.cpp b/src/Game/Systems/AbilityCooldownHUDSystem.cpp index e2734b47..07461f95 100644 --- a/src/Game/Systems/AbilityCooldownHUDSystem.cpp +++ b/src/Game/Systems/AbilityCooldownHUDSystem.cpp @@ -47,19 +47,36 @@ void AbilityCooldownHUDSystem::Update(double dt) } EntityWrapper cooldownTextEntity = entity.FirstChildByName("Cooldown"); + //TODO: Fix so this track correctly for shield and sprint depending on how they work. + double maxAbilityCD, currentAbilityCD; - double maxAbilityCD = (double)abilityEntity[abilityName]["CoolDownMaxTimer"]; - double currentAbilityCD = (double)abilityEntity[abilityName]["CoolDownTimer"]; - currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0; + if (abilityName == "DashAbility") { + maxAbilityCD = (double)abilityEntity[abilityName]["CoolDownMaxTimer"]; + currentAbilityCD = (double)abilityEntity[abilityName]["CoolDownTimer"]; + currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0; - if (cooldownTextEntity.Valid()) { - if (cooldownTextEntity.HasComponent("Text")) { - std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(currentAbilityCD).substr(0, 3); + if (cooldownTextEntity.Valid()) { + if (cooldownTextEntity.HasComponent("Text")) { + std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(currentAbilityCD).substr(0, 3); + } } } + if (abilityName == "ShieldAbility") { + maxAbilityCD = 0.0; + currentAbilityCD = 1 - (bool)abilityEntity[abilityName]["Active"]; + } + + if (abilityName == "SprintAbility") { + maxAbilityCD = 0.0; + currentAbilityCD = 1 - (bool)abilityEntity[abilityName]["Active"]; + } + if (entity.HasComponent("Fill")) { entity["Fill"]["Percentage"] = currentAbilityCD/maxAbilityCD; } + + + } }