diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index bb6a50bfb..59874ecef 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -19,6 +19,7 @@ AppliedDefaultGraphicsPerformance=Maximum +ActiveClassRedirects=(OldClassName="TP_TopDownPlayerController",NewClassName="Cloud9PlayerController") +ActiveClassRedirects=(OldClassName="TP_TopDownGameMode",NewClassName="Cloud9GameMode") +ActiveClassRedirects=(OldClassName="TP_TopDownCharacter",NewClassName="Cloud9Character") +AssetManagerClassName=/Script/Cloud9.Cloud9AssetManager [/Script/PythonScriptPlugin.PythonScriptPluginSettings] bRemoteExecution=True diff --git a/Config/DefaultGame.ini b/Config/DefaultGame.ini index c34dbb78c..e2bd5f34c 100644 --- a/Config/DefaultGame.ini +++ b/Config/DefaultGame.ini @@ -21,3 +21,15 @@ UnUsedEnum=Everything UnUsedStruct=(IntField0=3,FloatField1=0.000000) Volume=0.100000 +[/Script/Engine.AssetManagerSettings] +-PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetBaseClass=/Script/Engine.World,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game/Maps")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) +-PrimaryAssetTypesToScan=(PrimaryAssetType="PrimaryAssetLabel",AssetBaseClass=/Script/Engine.PrimaryAssetLabel,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) ++PrimaryAssetTypesToScan=(PrimaryAssetType="Map",AssetBaseClass=/Script/Engine.World,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game/Maps")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) ++PrimaryAssetTypesToScan=(PrimaryAssetType="PrimaryAssetLabel",AssetBaseClass=/Script/Engine.PrimaryAssetLabel,bHasBlueprintClasses=False,bIsEditorOnly=True,Directories=((Path="/Game")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) ++PrimaryAssetTypesToScan=(PrimaryAssetType="Weapon",AssetBaseClass=/Script/Cloud9.WeaponDefinitionsAsset,bHasBlueprintClasses=False,bIsEditorOnly=False,Directories=((Path="/Game/Blueprints/Weapons")),SpecificAssets=,Rules=(Priority=-1,ChunkId=-1,bApplyRecursively=True,CookRule=Unknown)) +bOnlyCookProductionAssets=False +bShouldManagerDetermineTypeAndName=False +bShouldGuessTypeAndNameInEditor=True +bShouldAcquireMissingChunksOnLoad=False +MetaDataTagsForAssetRegistry=() + diff --git a/Content/Blueprints/Character/BP_Cloud9Character.uasset b/Content/Blueprints/Character/BP_Cloud9Character.uasset index a90a8706b..0201a2e16 100644 Binary files a/Content/Blueprints/Character/BP_Cloud9Character.uasset and b/Content/Blueprints/Character/BP_Cloud9Character.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Animations/PistolFireAnimation.uasset b/Content/Blueprints/Character/JungleRaider/Animations/PistolFireAnimation.uasset new file mode 100644 index 000000000..bc253eade Binary files /dev/null and b/Content/Blueprints/Character/JungleRaider/Animations/PistolFireAnimation.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Animations/RifleFireAnimation.uasset b/Content/Blueprints/Character/JungleRaider/Animations/RifleFireAnimation.uasset new file mode 100644 index 000000000..45585399c Binary files /dev/null and b/Content/Blueprints/Character/JungleRaider/Animations/RifleFireAnimation.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Animations/TAnimation.uasset b/Content/Blueprints/Character/JungleRaider/Animations/TAnimation.uasset index 9aa6a7a13..5435c8e1d 100644 Binary files a/Content/Blueprints/Character/JungleRaider/Animations/TAnimation.uasset and b/Content/Blueprints/Character/JungleRaider/Animations/TAnimation.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Mesh/tm_jungle_raider_variantb2.uasset b/Content/Blueprints/Character/JungleRaider/Mesh/tm_jungle_raider_variantb2.uasset index 2834074c2..d7360dcc0 100644 Binary files a/Content/Blueprints/Character/JungleRaider/Mesh/tm_jungle_raider_variantb2.uasset and b/Content/Blueprints/Character/JungleRaider/Mesh/tm_jungle_raider_variantb2.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Mesh/tm_jungle_raider_variantb2_Skeleton.uasset b/Content/Blueprints/Character/JungleRaider/Mesh/tm_jungle_raider_variantb2_Skeleton.uasset index 366d5d701..e695445ed 100644 Binary files a/Content/Blueprints/Character/JungleRaider/Mesh/tm_jungle_raider_variantb2_Skeleton.uasset and b/Content/Blueprints/Character/JungleRaider/Mesh/tm_jungle_raider_variantb2_Skeleton.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Montages/knife_fire_front_Montage.uasset b/Content/Blueprints/Character/JungleRaider/Montages/knife_fire_front_Montage.uasset index d1f674b05..8d91a31b5 100644 Binary files a/Content/Blueprints/Character/JungleRaider/Montages/knife_fire_front_Montage.uasset and b/Content/Blueprints/Character/JungleRaider/Montages/knife_fire_front_Montage.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Montages/pistol_fire_crouch_Montage.uasset b/Content/Blueprints/Character/JungleRaider/Montages/pistol_fire_crouch_Montage.uasset new file mode 100644 index 000000000..fd51a2a1e Binary files /dev/null and b/Content/Blueprints/Character/JungleRaider/Montages/pistol_fire_crouch_Montage.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Montages/rifle_fire_Montage.uasset b/Content/Blueprints/Character/JungleRaider/Montages/rifle_fire_Montage.uasset new file mode 100644 index 000000000..f2258fdf3 Binary files /dev/null and b/Content/Blueprints/Character/JungleRaider/Montages/rifle_fire_Montage.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Montages/rifle_fire_crouch_Montage.uasset b/Content/Blueprints/Character/JungleRaider/Montages/rifle_fire_crouch_Montage.uasset new file mode 100644 index 000000000..413361484 Binary files /dev/null and b/Content/Blueprints/Character/JungleRaider/Montages/rifle_fire_crouch_Montage.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Sequences/pistol_fire_crouch.uasset b/Content/Blueprints/Character/JungleRaider/Sequences/pistol_fire_crouch.uasset new file mode 100644 index 000000000..90fe6a80a Binary files /dev/null and b/Content/Blueprints/Character/JungleRaider/Sequences/pistol_fire_crouch.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Sequences/rifle_fire.uasset b/Content/Blueprints/Character/JungleRaider/Sequences/rifle_fire.uasset new file mode 100644 index 000000000..a29323b5b Binary files /dev/null and b/Content/Blueprints/Character/JungleRaider/Sequences/rifle_fire.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/Sequences/rifle_fire_crouch.uasset b/Content/Blueprints/Character/JungleRaider/Sequences/rifle_fire_crouch.uasset new file mode 100644 index 000000000..545f216fd Binary files /dev/null and b/Content/Blueprints/Character/JungleRaider/Sequences/rifle_fire_crouch.uasset differ diff --git a/Content/Blueprints/Character/JungleRaider/shotgun_fire.uasset b/Content/Blueprints/Character/JungleRaider/shotgun_fire.uasset new file mode 100644 index 000000000..a5540cc3c Binary files /dev/null and b/Content/Blueprints/Character/JungleRaider/shotgun_fire.uasset differ diff --git a/Content/Blueprints/Weapons/Common/Materials/shotgun_shell.uasset b/Content/Blueprints/Weapons/Common/Materials/shotgun_shell.uasset new file mode 100644 index 000000000..6ce8c160c Binary files /dev/null and b/Content/Blueprints/Weapons/Common/Materials/shotgun_shell.uasset differ diff --git a/Content/Blueprints/Weapons/Common/Meshes/shotgun_shell.uasset b/Content/Blueprints/Weapons/Common/Meshes/shotgun_shell.uasset new file mode 100644 index 000000000..c2a658d71 Binary files /dev/null and b/Content/Blueprints/Weapons/Common/Meshes/shotgun_shell.uasset differ diff --git a/Content/Blueprints/Weapons/Common/Textures/default_normal.uasset b/Content/Blueprints/Weapons/Common/Textures/default_normal.uasset new file mode 100644 index 000000000..e658e6017 Binary files /dev/null and b/Content/Blueprints/Weapons/Common/Textures/default_normal.uasset differ diff --git a/Content/Blueprints/Weapons/Common/Textures/shotgun_shell.uasset b/Content/Blueprints/Weapons/Common/Textures/shotgun_shell.uasset new file mode 100644 index 000000000..d1c169aed Binary files /dev/null and b/Content/Blueprints/Weapons/Common/Textures/shotgun_shell.uasset differ diff --git a/Content/Blueprints/Weapons/Examples/megatron3k/Materials/README.MD b/Content/Blueprints/Weapons/Examples/megatron3k/Materials/README.MD new file mode 100644 index 000000000..15a215826 --- /dev/null +++ b/Content/Blueprints/Weapons/Examples/megatron3k/Materials/README.MD @@ -0,0 +1 @@ +Place weapon materials/skins here \ No newline at end of file diff --git a/Content/Blueprints/Weapons/Examples/megatron3k/Mesh/README.MD b/Content/Blueprints/Weapons/Examples/megatron3k/Mesh/README.MD new file mode 100644 index 000000000..1d6c7944d --- /dev/null +++ b/Content/Blueprints/Weapons/Examples/megatron3k/Mesh/README.MD @@ -0,0 +1 @@ +Place weapon mesh here \ No newline at end of file diff --git a/Content/Blueprints/Weapons/Examples/megatron3k/Sounds/README.MD b/Content/Blueprints/Weapons/Examples/megatron3k/Sounds/README.MD new file mode 100644 index 000000000..e772fa961 --- /dev/null +++ b/Content/Blueprints/Weapons/Examples/megatron3k/Sounds/README.MD @@ -0,0 +1 @@ +Place weapon sounds here \ No newline at end of file diff --git a/Content/Blueprints/Weapons/Examples/megatron3k/Textures/README.MD b/Content/Blueprints/Weapons/Examples/megatron3k/Textures/README.MD new file mode 100644 index 000000000..3139d06f2 --- /dev/null +++ b/Content/Blueprints/Weapons/Examples/megatron3k/Textures/README.MD @@ -0,0 +1 @@ +Place weapon textures here \ No newline at end of file diff --git a/Content/Blueprints/Weapons/FirearmWeaponsTable.uasset b/Content/Blueprints/Weapons/FirearmWeaponsTable.uasset index 438393f6a..e8ebfe3b2 100644 Binary files a/Content/Blueprints/Weapons/FirearmWeaponsTable.uasset and b/Content/Blueprints/Weapons/FirearmWeaponsTable.uasset differ diff --git a/Content/Blueprints/Weapons/Knives/Stiletto/Materials/w_knife_stiletto_default.uasset b/Content/Blueprints/Weapons/Knives/Stiletto/Materials/w_knife_stiletto_default.uasset index 5b546c132..4c37ad8ec 100644 Binary files a/Content/Blueprints/Weapons/Knives/Stiletto/Materials/w_knife_stiletto_default.uasset and b/Content/Blueprints/Weapons/Knives/Stiletto/Materials/w_knife_stiletto_default.uasset differ diff --git a/Content/Blueprints/Weapons/Knives/Stiletto/Sounds/stilletto_draw_01.uasset b/Content/Blueprints/Weapons/Knives/Stiletto/Sounds/stilletto_draw_01.uasset deleted file mode 100644 index f59e81417..000000000 Binary files a/Content/Blueprints/Weapons/Knives/Stiletto/Sounds/stilletto_draw_01.uasset and /dev/null differ diff --git a/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_default.uasset b/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_default.uasset index bdb717397..12a3ad511 100644 Binary files a/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_default.uasset and b/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_default.uasset differ diff --git a/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_lore.uasset b/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_lore.uasset index b17bdc7e2..e995c8f16 100644 Binary files a/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_lore.uasset and b/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_lore.uasset differ diff --git a/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_material.uasset b/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_material.uasset new file mode 100644 index 000000000..458443d05 Binary files /dev/null and b/Content/Blueprints/Weapons/Knives/butterfly/Materials/w_knife_butterfly_material.uasset differ diff --git a/Content/Blueprints/Weapons/Knives/butterfly/Mesh/w_knife_butterfly.uasset b/Content/Blueprints/Weapons/Knives/butterfly/Mesh/w_knife_butterfly.uasset index 82a0c232b..689b9adee 100644 Binary files a/Content/Blueprints/Weapons/Knives/butterfly/Mesh/w_knife_butterfly.uasset and b/Content/Blueprints/Weapons/Knives/butterfly/Mesh/w_knife_butterfly.uasset differ diff --git a/Content/Blueprints/Weapons/MeleeWeaponTable.uasset b/Content/Blueprints/Weapons/MeleeWeaponTable.uasset index 95277de23..183505b05 100644 Binary files a/Content/Blueprints/Weapons/MeleeWeaponTable.uasset and b/Content/Blueprints/Weapons/MeleeWeaponTable.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/BP_Deagle.uasset b/Content/Blueprints/Weapons/Pistols/deagle/BP_Deagle.uasset new file mode 100644 index 000000000..ee9e2361a Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/deagle/BP_Deagle.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_default.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_default.uasset new file mode 100644 index 000000000..888168eb4 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_default.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_material.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_material.uasset index 31ea77482..b2698c12f 100644 Binary files a/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_material.uasset and b/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_material.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_ocean_drive.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_ocean_drive.uasset index 47a30b15a..19e0e0d14 100644 Binary files a/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_ocean_drive.uasset and b/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_ocean_drive.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_printstream.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_printstream.uasset new file mode 100644 index 000000000..0fe6e801e Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/deagle/Materials/w_pistol_deagle_printstream.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_default_magazine.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_default_magazine.uasset deleted file mode 100644 index 0c0734479..000000000 Binary files a/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_default_magazine.uasset and /dev/null differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_default_weapon.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_default_weapon.uasset deleted file mode 100644 index 8fd80f596..000000000 Binary files a/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_default_weapon.uasset and /dev/null differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_magazine.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_magazine.uasset new file mode 100644 index 000000000..dde83b4d6 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_magazine.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_weapon.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_weapon.uasset new file mode 100644 index 000000000..7ebb2eb3c Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/deagle/Mesh/w_pistol_deagle_weapon.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_clipin.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_clipin.uasset similarity index 97% rename from Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_clipin.uasset rename to Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_clipin.uasset index de035948f..802743895 100644 Binary files a/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_clipin.uasset and b/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_clipin.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_clipout.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_clipout.uasset similarity index 96% rename from Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_clipout.uasset rename to Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_clipout.uasset index d47ba3df2..15eb902cf 100644 Binary files a/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_clipout.uasset and b/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_clipout.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_slideback.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_slideback.uasset similarity index 95% rename from Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_slideback.uasset rename to Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_slideback.uasset index 8eadfb908..ca067ccd7 100644 Binary files a/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_slideback.uasset and b/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_slideback.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_slideforward.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_slideforward.uasset similarity index 94% rename from Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_slideforward.uasset rename to Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_slideforward.uasset index b0ce97fe6..04338fdd9 100644 Binary files a/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_reload_slideforward.uasset and b/Content/Blueprints/Weapons/Pistols/deagle/Sounds/deagle_slideforward.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_3dthperson.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_3dthperson.uasset new file mode 100644 index 000000000..6abecc989 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_3dthperson.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_default.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_default.uasset index b84f0c388..9f02ef0d2 100644 Binary files a/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_default.uasset and b/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_default.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_printstream.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_printstream.uasset new file mode 100644 index 000000000..345b3eed9 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_printstream.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_printstream_normal.uasset b/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_printstream_normal.uasset new file mode 100644 index 000000000..b1246cac1 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/deagle/Textures/w_pistol_deagle_printstream_normal.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Materials/w_pistol_hkp2000_decline.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Materials/w_pistol_hkp2000_decline.uasset new file mode 100644 index 000000000..166c88a6c Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Materials/w_pistol_hkp2000_decline.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Materials/w_pistol_hkp2000_material.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Materials/w_pistol_hkp2000_material.uasset new file mode 100644 index 000000000..27f610ba2 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Materials/w_pistol_hkp2000_material.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Mesh/w_pistol_hkp2000_magazine.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Mesh/w_pistol_hkp2000_magazine.uasset new file mode 100644 index 000000000..f38e1a793 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Mesh/w_pistol_hkp2000_magazine.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Mesh/w_pistol_hkp2000_weapon.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Mesh/w_pistol_hkp2000_weapon.uasset new file mode 100644 index 000000000..f25cc54dc Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Mesh/w_pistol_hkp2000_weapon.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_clipin.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_clipin.uasset new file mode 100644 index 000000000..de7c4bcfc Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_clipin.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_clipout.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_clipout.uasset new file mode 100644 index 000000000..207cd6fd4 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_clipout.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_draw.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_draw.uasset new file mode 100644 index 000000000..f7389917b Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_draw.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_fire_01.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_fire_01.uasset new file mode 100644 index 000000000..2eed440b8 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_fire_01.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_fire_02.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_fire_02.uasset new file mode 100644 index 000000000..3d2495c3c Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_fire_02.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_fire_03.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_fire_03.uasset new file mode 100644 index 000000000..f0928e3de Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_fire_03.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_slideback.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_slideback.uasset new file mode 100644 index 000000000..fe0910058 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_slideback.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_sliderelease.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_sliderelease.uasset new file mode 100644 index 000000000..8df5a8a6d Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Sounds/hkp2000_sliderelease.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_decline.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_decline.uasset new file mode 100644 index 000000000..a6cc9bcfe Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_decline.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_decline_normal.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_decline_normal.uasset new file mode 100644 index 000000000..4608202f6 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_decline_normal.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_default.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_default.uasset new file mode 100644 index 000000000..67763b3ea Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_default.uasset differ diff --git a/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_exponent.uasset b/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_exponent.uasset new file mode 100644 index 000000000..9e50ac2a9 Binary files /dev/null and b/Content/Blueprints/Weapons/Pistols/hkp2000/Textures/w_pistol_hkp2000_exponent.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_asiimov.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_asiimov.uasset new file mode 100644 index 000000000..2a34b8b50 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_asiimov.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_bloodsport.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_bloodsport.uasset new file mode 100644 index 000000000..a99d436fd Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_bloodsport.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_default.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_default.uasset new file mode 100644 index 000000000..b3887a376 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_default.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_material.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_material.uasset new file mode 100644 index 000000000..a97b2b4d4 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_material.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_slate.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_slate.uasset new file mode 100644 index 000000000..8a86c182b Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_slate.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_vulkan.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_vulkan.uasset new file mode 100644 index 000000000..ef5b630ef Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_vulkan.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_wild_lotus.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_wild_lotus.uasset new file mode 100644 index 000000000..22388e294 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Materials/w_rifle_ak47_wild_lotus.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Mesh/w_rifle_ak47_magazine.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Mesh/w_rifle_ak47_magazine.uasset new file mode 100644 index 000000000..ed611f03a Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Mesh/w_rifle_ak47_magazine.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Mesh/w_rifle_ak47_weapon.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Mesh/w_rifle_ak47_weapon.uasset new file mode 100644 index 000000000..db8935065 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Mesh/w_rifle_ak47_weapon.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_boltpull.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_boltpull.uasset new file mode 100644 index 000000000..7dc9d9c6d Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_boltpull.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_clipin.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_clipin.uasset new file mode 100644 index 000000000..dbdcb68de Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_clipin.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_clipout.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_clipout.uasset new file mode 100644 index 000000000..7d7007b87 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_clipout.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_draw.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_draw.uasset new file mode 100644 index 000000000..a7b162bd2 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_draw.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_fire_01.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_fire_01.uasset new file mode 100644 index 000000000..b8b12170c Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Sounds/ak47_fire_01.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_asiimov.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_asiimov.uasset new file mode 100644 index 000000000..ee135b335 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_asiimov.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_bloodsport.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_bloodsport.uasset new file mode 100644 index 000000000..4da6853e7 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_bloodsport.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_default.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_default.uasset new file mode 100644 index 000000000..42b5e63d7 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_default.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_slate.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_slate.uasset new file mode 100644 index 000000000..a62a5c54a Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_slate.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_slate_normal.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_slate_normal.uasset new file mode 100644 index 000000000..efe176fd0 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_slate_normal.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_vulkan.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_vulkan.uasset new file mode 100644 index 000000000..77c051128 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_vulkan.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_wild_lotus.uasset b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_wild_lotus.uasset new file mode 100644 index 000000000..61e0ff78c Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/ak47/Textures/w_rifle_ak47_wild_lotus.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Materials/w_rifle_m4a1s_default.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Materials/w_rifle_m4a1s_default.uasset new file mode 100644 index 000000000..35986296a Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Materials/w_rifle_m4a1s_default.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Materials/w_rifle_m4a1s_material.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Materials/w_rifle_m4a1s_material.uasset new file mode 100644 index 000000000..d4ffd4289 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Materials/w_rifle_m4a1s_material.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Materials/w_rifle_m4a1s_printstream.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Materials/w_rifle_m4a1s_printstream.uasset new file mode 100644 index 000000000..8318b75f7 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Materials/w_rifle_m4a1s_printstream.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Mesh/w_rifle_m4a1s_magazine.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Mesh/w_rifle_m4a1s_magazine.uasset new file mode 100644 index 000000000..f3d2823b9 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Mesh/w_rifle_m4a1s_magazine.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Mesh/w_rifle_m4a1s_silencer.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Mesh/w_rifle_m4a1s_silencer.uasset new file mode 100644 index 000000000..bcab273cb Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Mesh/w_rifle_m4a1s_silencer.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Mesh/w_rifle_m4a1s_weapon.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Mesh/w_rifle_m4a1s_weapon.uasset new file mode 100644 index 000000000..9265a053f Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Mesh/w_rifle_m4a1s_weapon.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_01.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_01.uasset new file mode 100644 index 000000000..dfe88e238 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_01.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_02.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_02.uasset new file mode 100644 index 000000000..440637691 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_02.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_03.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_03.uasset new file mode 100644 index 000000000..b21cd0961 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_03.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_04.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_04.uasset new file mode 100644 index 000000000..defc8d29a Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_04.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_boltback.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_boltback.uasset new file mode 100644 index 000000000..8749505aa Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_boltback.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_boltforward.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_boltforward.uasset new file mode 100644 index 000000000..d39402d95 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_boltforward.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_cliphit.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_cliphit.uasset new file mode 100644 index 000000000..0c3ff1be6 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_cliphit.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_clipin.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_clipin.uasset new file mode 100644 index 000000000..b330ada7a Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_clipin.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_clipout.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_clipout.uasset new file mode 100644 index 000000000..df8e021e6 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_clipout.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_draw.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_draw.uasset new file mode 100644 index 000000000..087b0ed81 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_draw.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_silencer_01.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_silencer_01.uasset new file mode 100644 index 000000000..d776b7935 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Sounds/m4a1_silencer_01.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Textures/w_rifle_m4a1s_default.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Textures/w_rifle_m4a1s_default.uasset new file mode 100644 index 000000000..29fa8e2a4 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Textures/w_rifle_m4a1s_default.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Textures/w_rifle_m4a1s_printstream.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Textures/w_rifle_m4a1s_printstream.uasset new file mode 100644 index 000000000..708ca7564 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Textures/w_rifle_m4a1s_printstream.uasset differ diff --git a/Content/Blueprints/Weapons/Rifle/m4a1s/Textures/w_rifle_m4a1s_printstream_normal.uasset b/Content/Blueprints/Weapons/Rifle/m4a1s/Textures/w_rifle_m4a1s_printstream_normal.uasset new file mode 100644 index 000000000..75ed7f7a9 Binary files /dev/null and b/Content/Blueprints/Weapons/Rifle/m4a1s/Textures/w_rifle_m4a1s_printstream_normal.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Materials/w_shotgun_nova_default.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Materials/w_shotgun_nova_default.uasset new file mode 100644 index 000000000..e26a07641 Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Materials/w_shotgun_nova_default.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Materials/w_shotgun_nova_koi.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Materials/w_shotgun_nova_koi.uasset new file mode 100644 index 000000000..18f09c56f Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Materials/w_shotgun_nova_koi.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Materials/w_shotgun_nova_material.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Materials/w_shotgun_nova_material.uasset new file mode 100644 index 000000000..fac8d07b4 Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Materials/w_shotgun_nova_material.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Mesh/w_shotgun_nova.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Mesh/w_shotgun_nova.uasset new file mode 100644 index 000000000..6e4a45723 Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Mesh/w_shotgun_nova.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_draw.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_draw.uasset new file mode 100644 index 000000000..9975aca07 Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_draw.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_fire_01.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_fire_01.uasset new file mode 100644 index 000000000..326094dbf Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_fire_01.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_insertshell.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_insertshell.uasset new file mode 100644 index 000000000..b2e7f527c Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_insertshell.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_pump.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_pump.uasset new file mode 100644 index 000000000..c5ce7f3df Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Sounds/nova_pump.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Textures/w_shotgun_nova_default.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Textures/w_shotgun_nova_default.uasset new file mode 100644 index 000000000..3a7e2fec1 Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Textures/w_shotgun_nova_default.uasset differ diff --git a/Content/Blueprints/Weapons/Shotguns/nova/Textures/w_shotgun_nova_koi.uasset b/Content/Blueprints/Weapons/Shotguns/nova/Textures/w_shotgun_nova_koi.uasset new file mode 100644 index 000000000..35164e78b Binary files /dev/null and b/Content/Blueprints/Weapons/Shotguns/nova/Textures/w_shotgun_nova_koi.uasset differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_asiimov.uasset b/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_asiimov.uasset new file mode 100644 index 000000000..3996c57a6 Binary files /dev/null and b/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_asiimov.uasset differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_default.uasset b/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_default.uasset index 253394e86..75bacdf41 100644 Binary files a/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_default.uasset and b/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_default.uasset differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_pawpaw.uasset b/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_pawpaw.uasset new file mode 100644 index 000000000..4c01de2af Binary files /dev/null and b/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_pawpaw.uasset differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_scope.uasset b/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_scope.uasset index aba2d9b5e..8e96b4575 100644 Binary files a/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_scope.uasset and b/Content/Blueprints/Weapons/Sniper/awp/Materials/w_sniper_awp_scope.uasset differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp.uasset b/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp.uasset deleted file mode 100644 index ffd94050a..000000000 Binary files a/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp.uasset and /dev/null differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp_mag.uasset b/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp_mag.uasset deleted file mode 100644 index 7f1fe7578..000000000 Binary files a/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp_mag.uasset and /dev/null differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp_magazine.uasset b/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp_magazine.uasset new file mode 100644 index 000000000..ebffd8861 Binary files /dev/null and b/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp_magazine.uasset differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp_weapon.uasset b/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp_weapon.uasset new file mode 100644 index 000000000..639c208a0 Binary files /dev/null and b/Content/Blueprints/Weapons/Sniper/awp/Mesh/w_sniper_awp_weapon.uasset differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_3thdperson.uasset b/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_3thdperson.uasset new file mode 100644 index 000000000..284f686ed Binary files /dev/null and b/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_3thdperson.uasset differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_default.uasset b/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_default.uasset index 21a360f55..fb2c3dc78 100644 Binary files a/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_default.uasset and b/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_default.uasset differ diff --git a/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_scope.uasset b/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_scope.uasset index 45422cde9..5ad8d014c 100644 Binary files a/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_scope.uasset and b/Content/Blueprints/Weapons/Sniper/awp/Textures/w_sniper_awp_scope.uasset differ diff --git a/Content/Blueprints/Weapons/WeaponTableDefinitions.uasset b/Content/Blueprints/Weapons/WeaponTableDefinitions.uasset new file mode 100644 index 000000000..e1b73d7db Binary files /dev/null and b/Content/Blueprints/Weapons/WeaponTableDefinitions.uasset differ diff --git a/Content/Maps/warmup.umap b/Content/Maps/warmup.umap index c6f56ecd6..720fce70f 100644 Binary files a/Content/Maps/warmup.umap and b/Content/Maps/warmup.umap differ diff --git a/Docs/CSGO/Animations.MD b/Docs/CSGO/Animations.MD index 8d3901f23..05396ab85 100644 --- a/Docs/CSGO/Animations.MD +++ b/Docs/CSGO/Animations.MD @@ -1,4 +1,4 @@ -### Animations +# Animations https://developer.valvesoftware.com/wiki/Category:QC_Commands https://github.com/perilouswithadollarsign/cstrike15_src/blob/master/game/shared/cstrike15/csgo_playeranimstate.cpp \ No newline at end of file diff --git a/Docs/CSGO/InstallLegacyVersion.MD b/Docs/CSGO/InstallLegacyVersion.MD index 349755230..a9ef73dad 100644 --- a/Docs/CSGO/InstallLegacyVersion.MD +++ b/Docs/CSGO/InstallLegacyVersion.MD @@ -1,4 +1,4 @@ -### Install CS:GO on 14.10.2023 (in CS2 Era) +# Install CS:GO on 14.10.2023 (in CS2 Era) - Do the right click on Counter-Strike 2 in Steam library - Go to properties diff --git a/Docs/CSGO/Maps.MD b/Docs/CSGO/Maps.MD index c4683626a..b68e073bd 100644 --- a/Docs/CSGO/Maps.MD +++ b/Docs/CSGO/Maps.MD @@ -1,72 +1,158 @@ -### Extract and import maps of CS:GO +# Extract and import maps of CS:GO + +## English version Basic steps are in [Import CS:GO Maps](https://www.youtube.com/watch?v=pX2ddaJzFHw&ab_channel=ItsJustChris) +### 1. Preparation + +- Extract a map using tool [bspsrc](https://github.com/ata4/bspsrc/releases) +- Delete all stuff from scene Blender created at start +- Open Blender Windows Console (not necessary but importing process can be monitored) + * `Window->Toggle System Console` + +### 2. Import + +- Open Blender and go to `File->Import->Valve Map Format (.vmf)` +- Select an extracted map (e.g., `de_mirage_d.vmf`) +- In the right bar (configuration) change the following parameters: + * Sets `Sky resolution` to 1024 + * Sets `Scale` to 0.01 or something similar, but it's better to choose multiples of 10 + (I've chosen 0.02 and ended with speed should be multiplied by 2) + * Save these parameters as preset (simpler in future) to import another map +- Wait until the selected map is imported + +### 3. Blender postprocess + +- Select shading mode viewport in the right upper corner (it's necessary to load texture of the map) +- Select "SkyBoxes": elements of the map that are located away from it +- Goto `Object->Transform VMF 3D Sky` (Object placed under Help/Pipeline menus) +- Also remove warmup scenes (if needed) +- Save the result as Blender file in some directory (e.g., `de_mirage.blend`) +- After that (!!!) extract texture from the map: + * Select all objects on scene + * Goto `File->External Data->Unpack Resources` + * Select `Write files to current directory` (this won't work if *.blend wasn't saved before) + * *Also note that some texture may be not correctly extracted and `VTFEdit` required to get it -**1. Preparation** - - Extract a map using tool [bspsrc](https://github.com/ata4/bspsrc/releases) - - Delete all stuff from scene Blender created at start - - Open Blender Windows Console (not necessary but importing process can be monitored) - * `Window->Toggle System Console` - -**2. Import** - - Open Blender and go to `File->Import->Valve Map Format (.vmf)` - - Select an extracted map (e.g., `de_mirage_d.vmf`) - - In the right bar (configuration) change the following parameters: - * Sets `Sky resolution` to 1024 - * Sets `Scale` to 0.01 or something similar, but it's better to choose multiples of 10 - (I've chosen 0.02 and ended with speed should be multiplied by 2) - * Save these parameters as preset (simpler in future) to import another map - - Wait until the selected map is imported - -**3. Blender postprocess** - - Select shading mode viewport in the right upper corner (it's necessary to load texture of the map) - - Select "SkyBoxes": elements of the map that are located away from it - - Goto `Object->Transform VMF 3D Sky` (Object placed under Help/Pipeline menus) - - Also remove warmup scenes (if needed) - - Save the result as Blender file in some directory (e.g., `de_mirage.blend`) - - After that (!!!) extract texture from the map: - * Select all objects on scene - * Goto `File->External Data->Unpack Resources` - * Select `Write files to current directory` (this won't work if *.blend wasn't saved before) - * *Also note that some texture may be not correctly extracted and `VTFEdit` required to get it - - - `Save as` *.blend file and in save menu open preference pane (gear in the right upper corner) check `Compress`. - **This will remove all textures from blend file (textures now stored in the directory near blend file) - and compress it, that significantly decrease size** - - - Export the map as FBX into the same directory where *.blend have been saved (all configurations are defaults). - **Don't change `Scale` here (!!!) because it was taken into account during VMF import** - - In the import menu, change the next configurations: - * `Hierarchy Type` change to `Create Level Actors` - * Check `Create Content Folder Hierarchy` - * Remove skeletal meshes (if its not needed) - -**4. Import into UE4 and postprocess** +- `Save as` *.blend file and in save menu open preference pane (gear in the right upper corner) check `Compress`. + **This will remove all textures from blend file (textures now stored in the directory near blend file) + and compress it, that significantly decrease size** + +- Export the map as FBX into the same directory where *.blend have been saved (all configurations are defaults). + **Don't change `Scale` here (!!!) because it was taken into account during VMF import** +- In the import menu, change the next configurations: + * `Hierarchy Type` change to `Create Level Actors` + * Check `Create Content Folder Hierarchy` + * Remove skeletal meshes (if its not needed) + +### 4. Import into UE4 and postprocess Scripts must be executed in order below: + - Create level in UE4 and import this FBX into it using `File->Import Into Level` - Fix static collisions with [FixStaticActorsCollisions.py](../../Content/Python/Map/FixStaticActorsCollisions.py) - * By default, all collisions generated by UE4 during import are f**ked up - (looks like due to the other CS:GO vertex traversal sequence). Script convert all collisions to complex - and remove geometry with completely unsupported collisions. -- Fix dynamic props collisions with [FixPhysicsPropsCollisions.py](../../Content/Python/Map/FixPhysicsPropsCollisions.py) + * By default, all collisions generated by UE4 during import are f**ked up + (looks like due to the other CS:GO vertex traversal sequence). Script convert all collisions to complex + and remove geometry with completely unsupported collisions. +- Fix dynamic props collisions + with [FixPhysicsPropsCollisions.py](../../Content/Python/Map/FixPhysicsPropsCollisions.py) - Fix environment lightning on the map with [FixEnvironmentLight.py](../../Content/Python/Map/FixEnvironmentLight.py) - * Imported `light_environment` lightning should be replaced because it is static thus no shadows etc + * Imported `light_environment` lightning should be replaced because it is static thus no shadows etc - Fix light's sources of the map with [FixLightSpotsSources.py](../../Content/Python/Map/FixLightSpotsSources.py) - * All lights are `Static` other than `Stationary`, so if shadows and good lightning - needed then all `light_*` actors required to be fixed - * Imported lights are usually too bright about 10 times than normal -- Fix opacity of materials with textures with Alpha-layer with [FixDecalsOverlays.py](../../Content/Python/Map/FixDecalsOverlays.py) - * `Blend mode` should be set to `Translucent` in material node - * Alpha channel of texture should be connected to `Opaque pin` - * See also https://docs.unrealengine.com/5.0/en-US/using-transparency-in-unreal-engine-materials/ + * All lights are `Static` other than `Stationary`, so if shadows and good lightning + needed then all `light_*` actors required to be fixed + * Imported lights are usually too bright about 10 times than normal +- Fix opacity of materials with textures with Alpha-layer + with [FixDecalsOverlays.py](../../Content/Python/Map/FixDecalsOverlays.py) + * `Blend mode` should be set to `Translucent` in material node + * Alpha channel of texture should be connected to `Opaque pin` + * See also https://docs.unrealengine.com/5.0/en-US/using-transparency-in-unreal-engine-materials/ - Removed failed TriMesh with [FixFailedTriMesh.py](../../Content/Python/Map/FixFailedTriMesh.py) - * Some meshes are invalid, and UE4 can't process it correctly (UE4 will print it in log file) - * Store log file with 'Failed to cook TriMesh' errors - as `.txt` in [fixups directory](../../Importing/fixups) + * Some meshes are invalid, and UE4 can't process it correctly (UE4 will print it in log file) + * Store log file with 'Failed to cook TriMesh' errors + as `.txt` in [fixups directory](../../Importing/fixups) -P.S.: Scripts made separated to each other and each time we +P.S.: Scripts made separated to each other and each time we reiterate over all actors to make possible to run it independently. -**6. Catalog imported map stuff in UE4** \ No newline at end of file +### 5. Catalog imported map stuff in UE4 + +## Russian version + +Основные шаги доступны в Импорт CS:GO карт + +### 1. Подготовка + +- Извлечь карту с помощью инструмента [bspsrc](https://github.com/ata4/bspsrc/releases) +- Удалить все объекты, созданные в Blender при старте +- Открыть консольное окно Blender (необязательно, но процесс импорта можно отслеживать) + * `Окно->Toggle System Console` + +### 2. Импорт + +- Открыть Blender и перейти `Файл->Импорт->Формат Valve Map (.vmf)` +- Выбрать извлеченную карту (например, `de_mirage_d.vmf`) +- В правой панели (конфигурация) изменить следующие параметры: + - Установить `Sky resolution` на 1024 + - Установить `Scale` на 0.01 или что-то подобное, но лучше выбирать кратные 10 (Я выбрал 0.02 и получилось, что + скорость должна быть умножена на 2 ... да, я гений) + - Сохранить эти параметры как пресет (будет проще в будущем импортировать другую карту) +- Дождитесь завершения импорта выбранной карты + +### 3. Постобработка в Blender + +- Выбрать режим отображения `shading mode` в правом верхнем углу (это необходимо для загрузки текстуры карты) +- Выбрать "SkyBoxes": элементы карты, которые находятся далеко от нее +- Перейти в `Object->Transform VMF 3D Sky` (Объект размещен в меню Help/Pipeline) +- Также удалить сцены разминки (при необходимости) +- Сохранить результат как файл Blender в какой-нибудь директории (например, `de_mirage.blend`) +- После этого (!!!) извлечь текстуру из карты: +- Выделить все объекты на сцене + * Зайти в `File->External Data->Unpack Resources` + * Выбрать `Write files to current directory` (это не сработает, если `*.blend` файл не был сохранен ранее) + * *Также обратите внимание, что некоторые текстуры могут быть неправильно извлечены, и для их получения может + потребоваться `VTFEdit` + +- `Save as` *.blend файл и в меню сохранения откройте панель предпочтений (шестеренка в правом верхнем углу), + установите флажок `Сжать.` **Это удалит все текстуры из файла `blend` (текстуры теперь хранятся в каталоге рядом с + файлом `blend`) и сжимает его, что значительно уменьшает размер** + +- Экспортировать карту в формате FBX в ту же директорию, где был сохранен файл *.blend (все конфигурации по умолчанию). + Не изменяйте Масштаб здесь (!!!), так как это было учтено при импорте VMF +- В меню импорта измените следующие параметры: + * `Hierarchy Type` изменить на `Create Level Actors` + * Установите флажок `Create Content Folder Hierarchy` + * Удалить флажок связанный с skeletal meshes (если не нужно) + +### 4. Импорт в UE4 и постобработка + +- Скрипты должны выполняться в следующем порядке: +- Создайте уровень в UE4 и импортируйте этот FBX в него с помощью `File->Import Into Level` +- Исправьте статические коллизии с + помощью [FixStaticActorsCollisions.py](../../Content/Python/Map/FixStaticActorsCollisions.py) + * По умолчанию все коллизии, сгенерированные UE4 при импорте, неправильны (ChatGPT kinda polite) + (похоже, из-за другой последовательности обхода вершин CS:GO). Скрипт преобразует все коллизии + в сложные и удаляет геометрию с полностью неподдерживаемыми коллизиями. +- Исправьте коллизии динамических объектов с + помощью [FixPhysicsPropsCollisions.py](../../Content/Python/Map/FixPhysicsPropsCollisions.py) +- Исправьте освещение окружения на карте с + помощью [FixEnvironmentLight.py](../../Content/Python/Map/FixEnvironmentLight.py) + * Импортированное освещение `light_environment` должно быть заменено, так как оно статическое и не имеет теней и т.д. +- Исправьте источники света на карте с помощью FixLightSpotsSources.py + * Весь свет являются статическими, кроме Стационарного, поэтому, если требуются тени и хорошее освещение, необходимо + исправить все actor'ы `light_*` + * Импортированные источники света обычно слишком яркие, примерно в 10 раз ярче нормы +- Исправить непрозрачность материалов с текстурами с альфа-каналом с помощью [FixDecalsOverlays.py](../../Content/Python/Map/FixDecalsOverlays.py) + - `Blend mode` должен быть установлен на `Translucent` в узле материала + - Альфа-канал текстуры должен быть подключен к `Opaque pin` + - См. также https://docs.unrealengine.com/5.0/en-US/using-transparency-in-unreal-engine-materials/ +- Удалите "плохие" TriMesh с помощью [FixFailedTriMesh.py](../../Content/Python/Map/FixFailedTriMesh.py) + * Некоторые Mesh'и недействительны, и UE4 не может их правильно обработать (UE4 выведет это в файле журнала) + * Сохраните файл журнала с ошибками 'Failed to cook TriMesh' в виде `.txt` + в [fixups directory](../../Importing/fixups) + +P.S.: Скрипты разделены между собой, и каждый раз мы проходим по всем актерам, чтобы возможно было их запускать +независимо. + +### 6. Каталог импортированного материала в UE4 \ No newline at end of file diff --git a/Docs/CSGO/Requirements.MD b/Docs/CSGO/Requirements.MD index 50127b1d4..b830743ac 100644 --- a/Docs/CSGO/Requirements.MD +++ b/Docs/CSGO/Requirements.MD @@ -1,4 +1,4 @@ -## CS:GO Extractions and importing software +# CS:GO Extractions and importing software - Full list on [developer.valvesoftware.com](https://developer.valvesoftware.com/wiki/Category:Third_Party_Tools) - Map extractor [bspsrc](../../Programs/bspsrc_1.4.3.zip) diff --git a/Docs/CSGO/Skins.MD b/Docs/CSGO/Skins.MD index 971ece4f3..65edaf4a2 100644 --- a/Docs/CSGO/Skins.MD +++ b/Docs/CSGO/Skins.MD @@ -1,3 +1,3 @@ -### Extract and import skins of CS:GO +# Extract and import skins of CS:GO skins director: $CSGO_BASE_DIR\materials\models\weapons\customization\paints\custom\workshop \ No newline at end of file diff --git a/Docs/CSGO/Weapons.MD b/Docs/CSGO/Weapons.MD new file mode 100644 index 000000000..c4421cd31 --- /dev/null +++ b/Docs/CSGO/Weapons.MD @@ -0,0 +1,116 @@ +# Extract and import first-person model view (FOV) weapons of CS:GO + +## English version + +This guide only if you want to use high-resolution models (FOV) +for third person and thus all animation made in character models. + +### 1. Подготовка + +- Извлечь VPK-архив CS:GO + +### 2. Импорт + +- Open Blender and go to `File->Import->Plumber->Source Model (.mdl)` +- Select an extracted weapon model (e.g., `v_rif_m4a1_s.mdl/v_rif_ak47.mdl`) +- In the right bar (configuration) change the following parameters: + * Sets `Scale` to 1.0 (we downscale it later) + * Disable `Import animations` (because in this case animation used from a character model) +- Wait until the selected map is imported + + + +## Russian version + +Это руководство предназначено только для использования моделей высокого разрешения (FOV) для третьего лица и, +следовательно, все анимации созданы в моделях персонажей. + +[Видео на YouTube с ужасным звуком](https://www.youtube.com/watch?v=5n6vObcgKjw) + +### 1. Подготовка + +- Извлечь VPK-архив CS:GO +- Удалить все объекты, созданные в Blender при старте +- Открыть консольное окно Blender (необязательно, но процесс импорта можно отслеживать) + * `Окно->Toggle System Console` + +### 2. Импорт + +- Откройте Blender и перейдите в `File->Import->Plumber->Source Model (.mdl)` +- Выберите извлеченную модель оружия (например, `v_rif_m4a1_s.mdl/v_rif_ak47.mdl`) +- В правой панели (конфигурация) измените следующие параметры: + * Установите `Scale` на 1.0 (мы уменьшим его позже) + * Отключите `Import animations` (потому что в этом случае анимация используется из модели персонажа) +- Дождитесь завершения импорта выбранной модели + +### 3. Blender postprocess + +- **ЗАМЕЧАНИЕ**: Структура модели может различаться в зависимости от самой модели. Например, у модели AK47 отсутствует + разделение на объекты: модель базовой части оружия, магазина, затвора и т.п. Это сделано с помощью `Vertex Groups`. У + M4A1-S такое разделение частично есть, а частично также с помощью `Vertex Groups`. +- **ПРИМЕЧАНИЕ**: То что написано дальше очень неочевидно (для тех кто не работает с Blender) и потребуется для + редактирования модели. Blender находясь в режиме `Modeling` может быть в режиме редактирования Vertex'ов + или `Object Mode`. После нажатия на кнопку `Modeling` Blender будет в режиме редактирования Vertex'ов. Чтобы перейти + в `Object Mode` в правой меню Blender'а (где нарисована структура объекта), необходимо + выключить `Change the object in the current mode` (выглядит как квадрат с жирными точками в углах). Это необходимо для + объединения подмоделей (см. далее)... либо я ничего не понимаю как работать в этом редакторе. Режим редактирования + Vertex'ов необходим для разделения модели на подмодели. Также находясь в режиме редактирования Vertex'ов можно + выбирать какая подмодель сейчас редактируется. Для этого необходимо нажать не на квадрат возле подмодели, а на кружок + возле другой подмодели (после этого активной станет подмодель на кружок которой нажали). + +- Удалить данные об анимации/позе (элемент модели с зеленой иконкой) - она не понадобится. +- Установить точку привязки модели: + - Выбрать все "подмодели" (оранжевые перевернутые треугольники) с помощью CTRL + - Выравнять выбранные элементы так, чтобы **рукоятка модели** была в нулевой координате (по этой точке будет + делаться привязка к руке персонажа). + - **ПРИМЕЧАНИЕ**: Чтобы вращать и перемещать модель необходимо выбрать нужный инструмент + на левой панельке Blender'а (перемещение/поворот). + - **ВНИМАНИЕ**: модель может быть смещена по всем осям, а также у модели может быть поворот. +- Удалить все лишние "подмодели" (с оранжевыми иконками). Это могут пустые объекты или внутренняя часть, + которая будет в любом случае не видна. +- Удалить `Modifiers/Armature` в каждой подмодели - они не нужны для дальнейшей работы в случае использования модели для + третьего лица. Для этого необходимо нажать на нужно подмодель, выбрать `Modifier` (синяя иконка). После этого в правой + части панели управления Blender'а (ниже иерархии) необходимо также выбрать `Modifier` (синяя иконка с гаечным ключом), + далее в списки `Modifier` нажать справка крестик для его удаления. +- Объединить подмодели, которые не должны быть разделены. То есть при импорте в Blender могут быть созданы две + подмодели, которые не требуется импортировать Unreal Engine как две раздельные. Для этого необходимо находится в + `Object Mode` Blender'а и выбрать необходимые подмодели с помощью CTRL. После этого нажать сочетание клавиш `CTRL+J`. +- Разделить модель с помощью по `Vertex Group`ам (обычно магазин сшит с основной моделью в одну). + - Перейти в раздел `Modeling` в верхней части Blender'а. + - Раскрыть необходимую модель в иерархии объектов. + - В нижней части правой панельки Blender'а выбрать `Data` (зеленый треугольник направленный вниз). + - В появившемся окне выбрать нужную `Vertex Group`у, например `v_weapon.M4A1_Clip` и ниже нажать кнопку `Select`. + - В меню под выбором режимов (`Layout`, `Modeling`...), необходимо выбрать `Mesh->Separate-Selection` (или нажать + кнопку `P`). После этого в иерархии должна появиться новая подмодель. +- Переименовать подмодели в иерархии объектов. +- Удалить не нужные `Vertex Group`ы: + - Для этого необходимо в иерархии объектов выбрать нужную подмодель нажав на точку возле неё (необходимо находиться + в режиме `Modeling`). + - В нижней части правой панельки Blender'а в разделе `Data` появятся `Vertex Group`у их можно удалить с помощью + кнопки `-` рядом. +- Перейти в `Object Mode` и перенести все подмодели в нулевую координату. Это необходимо, что точки привязки после + импорта в Unreal Engine у всех моделей была в нуле (модель в Blender'е при этом станет не корректной). +- Сохранить модель в blend-файл. +- Извлечь ресурсы текстур модели из blend-файла [делается по аналогии с картами, п.3](Maps.MD) + +- **ВНИМАНИЕ: МАСШТАБ МОДЕЛИ ДЛЯ 1-ГО ЛИЦА МОЖЕТ ОТЛИЧАТЬСЯ ОТ МАСШТАБА МОДЕЛИ ДЛЯ 3-ГО ЛИЦА** + - Для deagle отличие составляло около 1.276 раза (модель 3-го лица должна быть больше на этот коэффициент) + - Для awp отличие составляет 1.08895 раза + - Для ak47 и m4a1s выглядит так что отличия нет + +**4. Blender export to fbx** + +- Выбраться `File->Export->FBX` +- Задать следующие настройки (могут отличаться в зависимости от задачи, здесь указаны принятые в проекте): + - Scale: **0.02** + - Apply Scaling: All locals + - Forward: **X Forward** + - Up: **Z Up** + - Apply unit: yes + - Use space transform: **NO** + - Apply transform: **NO** + - Bake Animation: NO + +**4. Import into UE4 and postprocess** + +- Импортировать fbx-модель в Unreal Engine путем перетаскивания в редактор \ No newline at end of file diff --git a/Docs/Notes.MD b/Docs/Notes.MD index c7d4ea667..0a69e42c7 100644 --- a/Docs/Notes.MD +++ b/Docs/Notes.MD @@ -1,4 +1,4 @@ -### Original character speed +# Original character speed With Knife: - Run = 250 diff --git a/Docs/Rider/FixPython.MD b/Docs/Rider/FixPython.MD index 9bc79dc3f..b8151a338 100644 --- a/Docs/Rider/FixPython.MD +++ b/Docs/Rider/FixPython.MD @@ -1,4 +1,4 @@ -### Fix Python plugin in JetBrains Rider +# Fix Python plugin in JetBrains Rider JetBrains Rider may incorrectly determine the Python interpreter or even ignore the configured Python interpreter. This is because JetBrains Rider does not have a default module system like other JetBrains IDEs. diff --git a/Docs/Unreal/CreateAnimBlueprintFunc.MD b/Docs/Unreal/CreateAnimBlueprintFunc.MD new file mode 100644 index 000000000..e1b7d3e99 --- /dev/null +++ b/Docs/Unreal/CreateAnimBlueprintFunc.MD @@ -0,0 +1,3 @@ +# Создание "функций" с параметрами в Animation Blueprint + +[Видео на YouTube](https://www.youtube.com/watch?v=hpZEGFimGYA) \ No newline at end of file diff --git a/Docs/Unreal/PythonInContentBrowser.MD b/Docs/Unreal/PythonInContentBrowser.MD index ca957dba6..75b937e29 100644 --- a/Docs/Unreal/PythonInContentBrowser.MD +++ b/Docs/Unreal/PythonInContentBrowser.MD @@ -1,4 +1,4 @@ -### Enable Python Content Browser Integration +# Enable Python Content Browser Integration By default, the only method to run a Python script is to use `File -> Execute Python script`. This may not be a convenient way to use Python scripts. But there is a simple fix in UE4 diff --git a/Docs/Unreal/PythonStub.MD b/Docs/Unreal/PythonStub.MD index 568473fa5..25b7d5325 100644 --- a/Docs/Unreal/PythonStub.MD +++ b/Docs/Unreal/PythonStub.MD @@ -1,4 +1,4 @@ -### Add Python Unreal Engine stub +# Add Python Unreal Engine stub See here [Generate Python Stub](https://blog.csdn.net/Jingsongmaru/article/details/89493620) diff --git a/Importing/deagle.blend b/Importing/deagle.blend deleted file mode 100644 index ce65c25fd..000000000 Binary files a/Importing/deagle.blend and /dev/null differ diff --git a/Importing/deagle.fbx b/Importing/deagle.fbx deleted file mode 100644 index a1c4ad88c..000000000 Binary files a/Importing/deagle.fbx and /dev/null differ diff --git a/Importing/textures/ak47_professional_normal.tga b/Importing/textures/ak47_professional_normal.tga new file mode 100644 index 000000000..eb09bda19 Binary files /dev/null and b/Importing/textures/ak47_professional_normal.tga differ diff --git a/Importing/textures/ak47_vulkan.tga b/Importing/textures/ak47_vulkan.tga new file mode 100644 index 000000000..684f47c13 Binary files /dev/null and b/Importing/textures/ak47_vulkan.tga differ diff --git a/Importing/textures/default_normal.png b/Importing/textures/default_normal.png new file mode 100644 index 000000000..6aee6519e Binary files /dev/null and b/Importing/textures/default_normal.png differ diff --git a/Importing/textures/materials_models_weapons_shared_scope_scope.png b/Importing/textures/materials_models_weapons_shared_scope_scope.png new file mode 100644 index 000000000..9684e4a67 Binary files /dev/null and b/Importing/textures/materials_models_weapons_shared_scope_scope.png differ diff --git a/Importing/textures/materials_models_weapons_shared_scope_scope_normal.png b/Importing/textures/materials_models_weapons_shared_scope_scope_normal.png new file mode 100644 index 000000000..2d4f30a3b Binary files /dev/null and b/Importing/textures/materials_models_weapons_shared_scope_scope_normal.png differ diff --git a/Importing/textures/materials_models_weapons_v_models_rif_ak47_ak47.png b/Importing/textures/materials_models_weapons_v_models_rif_ak47_ak47.png new file mode 100644 index 000000000..a0b28eae9 Binary files /dev/null and b/Importing/textures/materials_models_weapons_v_models_rif_ak47_ak47.png differ diff --git a/Importing/textures/materials_models_weapons_v_models_rif_m4a1_s_rif_m4a1_s.png b/Importing/textures/materials_models_weapons_v_models_rif_m4a1_s_rif_m4a1_s.png new file mode 100644 index 000000000..74c7c761f Binary files /dev/null and b/Importing/textures/materials_models_weapons_v_models_rif_m4a1_s_rif_m4a1_s.png differ diff --git a/Importing/textures/materials_models_weapons_v_models_shot_nova_shot_nova.png b/Importing/textures/materials_models_weapons_v_models_shot_nova_shot_nova.png new file mode 100644 index 000000000..26a9049a2 Binary files /dev/null and b/Importing/textures/materials_models_weapons_v_models_shot_nova_shot_nova.png differ diff --git a/Importing/textures/materials_models_weapons_v_models_snip_awp_awp.png b/Importing/textures/materials_models_weapons_v_models_snip_awp_awp.png new file mode 100644 index 000000000..737577057 Binary files /dev/null and b/Importing/textures/materials_models_weapons_v_models_snip_awp_awp.png differ diff --git a/Importing/textures/materials_models_weapons_v_models_snip_awp_awp_exponent.png b/Importing/textures/materials_models_weapons_v_models_snip_awp_awp_exponent.png new file mode 100644 index 000000000..6ce10c72b Binary files /dev/null and b/Importing/textures/materials_models_weapons_v_models_snip_awp_awp_exponent.png differ diff --git a/Importing/textures/materials_models_weapons_w_models_w_rif_ak47_ak47.png b/Importing/textures/materials_models_weapons_w_models_w_rif_ak47_ak47.png new file mode 100644 index 000000000..3d1733464 Binary files /dev/null and b/Importing/textures/materials_models_weapons_w_models_w_rif_ak47_ak47.png differ diff --git a/Importing/textures/models_weapons_w_models_w_rif_ak47_ak47.png b/Importing/textures/models_weapons_w_models_w_rif_ak47_ak47.png new file mode 100644 index 000000000..a8efca934 Binary files /dev/null and b/Importing/textures/models_weapons_w_models_w_rif_ak47_ak47.png differ diff --git a/Importing/textures/models_weapons_w_models_w_rif_ak47_ak47_exponent.png b/Importing/textures/models_weapons_w_models_w_rif_ak47_ak47_exponent.png new file mode 100644 index 000000000..bd156b607 Binary files /dev/null and b/Importing/textures/models_weapons_w_models_w_rif_ak47_ak47_exponent.png differ diff --git a/Importing/textures/nova_koi.tga b/Importing/textures/nova_koi.tga new file mode 100644 index 000000000..fbf8d8c69 Binary files /dev/null and b/Importing/textures/nova_koi.tga differ diff --git a/Importing/textures/p2000_decline.tga b/Importing/textures/p2000_decline.tga new file mode 100644 index 000000000..83edc9930 Binary files /dev/null and b/Importing/textures/p2000_decline.tga differ diff --git a/Importing/textures/p2000_decline_normal.tga b/Importing/textures/p2000_decline_normal.tga new file mode 100644 index 000000000..e436a664f Binary files /dev/null and b/Importing/textures/p2000_decline_normal.tga differ diff --git a/Importing/textures/pist_deagle_masks.tga b/Importing/textures/pist_deagle_masks.tga new file mode 100644 index 000000000..3c0b79778 Binary files /dev/null and b/Importing/textures/pist_deagle_masks.tga differ diff --git a/Importing/textures/pist_deagle_pos.tga b/Importing/textures/pist_deagle_pos.tga new file mode 100644 index 000000000..c8bc2dea7 Binary files /dev/null and b/Importing/textures/pist_deagle_pos.tga differ diff --git a/Importing/textures/pist_deagle_surface.tga b/Importing/textures/pist_deagle_surface.tga new file mode 100644 index 000000000..dd517afe7 Binary files /dev/null and b/Importing/textures/pist_deagle_surface.tga differ diff --git a/Importing/textures/~FOf6ta9B_v_models_pist_deagle_pist_deagle_exponent.png b/Importing/textures/~FOf6ta9B_v_models_pist_deagle_pist_deagle_exponent.png new file mode 100644 index 000000000..c789b1893 Binary files /dev/null and b/Importing/textures/~FOf6ta9B_v_models_pist_deagle_pist_deagle_exponent.png differ diff --git a/Importing/textures/~FOf6ta9B_v_models_pist_hkp2000_pist_hkp2000_exponent.png b/Importing/textures/~FOf6ta9B_v_models_pist_hkp2000_pist_hkp2000_exponent.png new file mode 100644 index 000000000..a6281a6b8 Binary files /dev/null and b/Importing/textures/~FOf6ta9B_v_models_pist_hkp2000_pist_hkp2000_exponent.png differ diff --git a/Importing/textures/~FOf6ta9B_v_models_rif_m4a1_s_rif_m4a1_s_exponent.png b/Importing/textures/~FOf6ta9B_v_models_rif_m4a1_s_rif_m4a1_s_exponent.png new file mode 100644 index 000000000..7055a07dd Binary files /dev/null and b/Importing/textures/~FOf6ta9B_v_models_rif_m4a1_s_rif_m4a1_s_exponent.png differ diff --git a/Importing/textures/~NOyTYmKw_weapons_shared_shells_shotgun_shell_shotgun.png b/Importing/textures/~NOyTYmKw_weapons_shared_shells_shotgun_shell_shotgun.png new file mode 100644 index 000000000..830fd16bd Binary files /dev/null and b/Importing/textures/~NOyTYmKw_weapons_shared_shells_shotgun_shell_shotgun.png differ diff --git a/Importing/textures/~NOyTYmKw_weapons_v_models_pist_deagle_pist_deagle.png b/Importing/textures/~NOyTYmKw_weapons_v_models_pist_deagle_pist_deagle.png new file mode 100644 index 000000000..bd43b9b3f Binary files /dev/null and b/Importing/textures/~NOyTYmKw_weapons_v_models_pist_deagle_pist_deagle.png differ diff --git a/Importing/textures/~NOyTYmKw_weapons_v_models_pist_hkp2000_pist_hkp2000.png b/Importing/textures/~NOyTYmKw_weapons_v_models_pist_hkp2000_pist_hkp2000.png new file mode 100644 index 000000000..a64a28129 Binary files /dev/null and b/Importing/textures/~NOyTYmKw_weapons_v_models_pist_hkp2000_pist_hkp2000.png differ diff --git a/Importing/textures/~NOyTYmKw_weapons_v_models_rif_ak47_ak47_exponent.png b/Importing/textures/~NOyTYmKw_weapons_v_models_rif_ak47_ak47_exponent.png new file mode 100644 index 000000000..e25747363 Binary files /dev/null and b/Importing/textures/~NOyTYmKw_weapons_v_models_rif_ak47_ak47_exponent.png differ diff --git a/Importing/textures/~NOyTYmKw_weapons_v_models_shot_nova_shot_nova_exponent.png b/Importing/textures/~NOyTYmKw_weapons_v_models_shot_nova_shot_nova_exponent.png new file mode 100644 index 000000000..292a3721d Binary files /dev/null and b/Importing/textures/~NOyTYmKw_weapons_v_models_shot_nova_shot_nova_exponent.png differ diff --git a/Importing/textures/~NOyTYmKw_weapons_w_models_w_rif_ak47_ak47_exponent.png b/Importing/textures/~NOyTYmKw_weapons_w_models_w_rif_ak47_ak47_exponent.png new file mode 100644 index 000000000..e02f10ed7 Binary files /dev/null and b/Importing/textures/~NOyTYmKw_weapons_w_models_w_rif_ak47_ak47_exponent.png differ diff --git a/Importing/tm_jungle_raider_variantb2.fbx b/Importing/tm_jungle_raider_variantb2.fbx index 961ea17ea..d77d70679 100644 Binary files a/Importing/tm_jungle_raider_variantb2.fbx and b/Importing/tm_jungle_raider_variantb2.fbx differ diff --git a/Importing/tm_jungle_raider_variantb2_fire.blend b/Importing/tm_jungle_raider_variantb2_fire.blend new file mode 100644 index 000000000..0c16ed421 Binary files /dev/null and b/Importing/tm_jungle_raider_variantb2_fire.blend differ diff --git a/Importing/tm_jungle_raider_variantb2_pistol.blend b/Importing/tm_jungle_raider_variantb2_pistol.blend deleted file mode 100644 index 3d8c11b8a..000000000 Binary files a/Importing/tm_jungle_raider_variantb2_pistol.blend and /dev/null differ diff --git a/Importing/w_pistol_deagle.blend b/Importing/w_pistol_deagle.blend index 8b2a9c093..aa08b19ed 100644 Binary files a/Importing/w_pistol_deagle.blend and b/Importing/w_pistol_deagle.blend differ diff --git a/Importing/w_pistol_deagle.fbx b/Importing/w_pistol_deagle.fbx index e2fbce18a..309cede82 100644 Binary files a/Importing/w_pistol_deagle.fbx and b/Importing/w_pistol_deagle.fbx differ diff --git a/Importing/w_pistol_hkp2000.blend b/Importing/w_pistol_hkp2000.blend new file mode 100644 index 000000000..840d06f24 Binary files /dev/null and b/Importing/w_pistol_hkp2000.blend differ diff --git a/Importing/w_pistol_hkp2000.fbx b/Importing/w_pistol_hkp2000.fbx new file mode 100644 index 000000000..a760d657f Binary files /dev/null and b/Importing/w_pistol_hkp2000.fbx differ diff --git a/Importing/w_rif_ak47.blend b/Importing/w_rif_ak47.blend new file mode 100644 index 000000000..43f80c479 Binary files /dev/null and b/Importing/w_rif_ak47.blend differ diff --git a/Importing/w_rif_m4a1s.blend b/Importing/w_rif_m4a1s.blend new file mode 100644 index 000000000..3f7e6bc52 Binary files /dev/null and b/Importing/w_rif_m4a1s.blend differ diff --git a/Importing/w_rifle_ak47.fbx b/Importing/w_rifle_ak47.fbx new file mode 100644 index 000000000..d99f87678 Binary files /dev/null and b/Importing/w_rifle_ak47.fbx differ diff --git a/Importing/w_rifle_m4a1s.fbx b/Importing/w_rifle_m4a1s.fbx new file mode 100644 index 000000000..007a21f9e Binary files /dev/null and b/Importing/w_rifle_m4a1s.fbx differ diff --git a/Importing/w_shotgun_nova.blend b/Importing/w_shotgun_nova.blend new file mode 100644 index 000000000..a237400b0 Binary files /dev/null and b/Importing/w_shotgun_nova.blend differ diff --git a/Importing/w_shotgun_nova.fbx b/Importing/w_shotgun_nova.fbx new file mode 100644 index 000000000..26f0a189a Binary files /dev/null and b/Importing/w_shotgun_nova.fbx differ diff --git a/Importing/w_sniper_awp.blend b/Importing/w_sniper_awp.blend index ab1f6cbfa..bafdd34cd 100644 Binary files a/Importing/w_sniper_awp.blend and b/Importing/w_sniper_awp.blend differ diff --git a/Importing/w_sniper_awp.fbx b/Importing/w_sniper_awp.fbx index 1f4a1d8b1..2dbc1cec5 100644 Binary files a/Importing/w_sniper_awp.fbx and b/Importing/w_sniper_awp.fbx differ diff --git a/Source/Cloud9/Character/Cloud9Character.cpp b/Source/Cloud9/Character/Cloud9Character.cpp index 9c75bc3fe..3ff3e2460 100644 --- a/Source/Cloud9/Character/Cloud9Character.cpp +++ b/Source/Cloud9/Character/Cloud9Character.cpp @@ -28,6 +28,7 @@ #include "Camera/CameraComponent.h" #include "Cloud9/Cloud9.h" #include "Cloud9/Game/Cloud9DeveloperSettings.h" +#include "Cloud9/Game/Cloud9GameInstance.h" #include "Cloud9/Game/Cloud9PlayerController.h" #include "Components/DecalComponent.h" #include "Components/CapsuleComponent.h" @@ -259,6 +260,10 @@ void ACloud9Character::OnConstruction(const FTransform& Transform) void ACloud9Character::BeginPlay() { Super::BeginPlay(); + + // FTransform Transform = FTransform::Identity; + // Transform.SetLocation({50, 329, -330}); + // GetGameInstance()->SpawnFirearmWeapon(EFirearm::Deagle); } void ACloud9Character::Tick(float DeltaSeconds) diff --git a/Source/Cloud9/Character/Components/Cloud9Inventory.cpp b/Source/Cloud9/Character/Components/Cloud9Inventory.cpp index 2259ba0c1..6772b5999 100644 --- a/Source/Cloud9/Character/Components/Cloud9Inventory.cpp +++ b/Source/Cloud9/Character/Components/Cloud9Inventory.cpp @@ -25,10 +25,8 @@ #include "Cloud9/Cloud9.h" #include "Cloud9/Character/Cloud9Character.h" -#include "Cloud9/Game/Cloud9GameInstance.h" #include "Cloud9/Weapon/Classes/Cloud9WeaponFirearm.h" #include "Cloud9/Weapon/Classes/Cloud9WeaponMelee.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponState.h" UCloud9Inventory::UCloud9Inventory() @@ -49,9 +47,14 @@ void UCloud9Inventory::BeginPlay() if (let MyOwner = GetOwner(); IsValid(MyOwner)) { - let MyGameInstance = MyOwner->GetGameInstance(); - let DefaultKnife = MyGameInstance->SpawnMeleeWeapon(DefaultKnifeName); - let DefaultPistol = MyGameInstance->SpawnFirearmWeapon(DefaultPistolName); + let DefaultKnife = GetWorld() | EUWorld::SpawnActor( + [this](let It) { return It->OnSpawn(DefaultKnifeName, FWeaponSkin::Lore); }); + + let DefaultPistol = GetWorld() | EUWorld::SpawnActor( + [this](let It) { return It->OnSpawn(DefaultPistolName, FWeaponSkin::OceanDrive); }); + + let DefaultMain = GetWorld() | EUWorld::SpawnActor( + [this](let It) { return It->OnSpawn(EFirearm::Ak47); }); if (not ShoveWeapon(EWeaponSlot::Knife, DefaultKnife)) { @@ -65,6 +68,12 @@ void UCloud9Inventory::BeginPlay() return; } + if (not ShoveWeapon(EWeaponSlot::Main, DefaultMain)) + { + log(Error, "Can't shove default pistol into inventory"); + return; + } + if (not SelectWeapon(EWeaponSlot::Knife)) { log(Error, "Can't select default weapon"); @@ -80,32 +89,46 @@ bool UCloud9Inventory::SelectWeapon(EWeaponSlot Slot) return false; } - if (Slot != SelectedWeaponSlot) + if (IsWeaponChanging()) { - if (let Character = GetOwner(); IsValid(Character)) - { - let PendingWeapon = GetWeaponAt(Slot); + log(Verbose, "[Weapon='%s'] Switching already in progress", *GetName()); + return false; + } - if (not PendingWeapon) - { - log(Verbose, "Weapon at slot='%d' not set", Slot); - return false; - } + if (Slot == SelectedWeaponSlot) + { + log(Verbose, "[Weapon='%s'] No switching will be performed", *GetName()); + return false; + } - if (let SelectedWeapon = GetWeaponAt(SelectedWeaponSlot)) - { - SelectedWeapon->ChangeState(EWeaponState::Holstered); - } + let PendingWeapon = GetWeaponAt(Slot); - PendingWeapon->ChangeState(EWeaponState::Armed); + if (not IsValid(PendingWeapon)) + { + log(Verbose, "[Weapon='%s'] Weapon at slot='%d' not set", *GetName(), Slot); + return false; + } + + if (SelectedWeaponSlot == EWeaponSlot::NotSelected) + { + if (PendingWeapon->ChangeState(EWeaponState::Armed)) + { PendingWeaponSlot = Slot; return true; } - log(Error, "Inventory owner wasn't set"); + log(Error, "[Weapon='%s'] Can't select starting weapon", *GetName()) return false; } + if (let SelectedWeapon = GetWeaponAt(SelectedWeaponSlot); IsValid(SelectedWeapon) + and SelectedWeapon->ChangeState(EWeaponState::Holstered) + and PendingWeapon->ChangeState(EWeaponState::Armed)) + { + PendingWeaponSlot = Slot; + return true; + } + return false; } @@ -175,18 +198,6 @@ bool UCloud9Inventory::ReplaceWeaponAt(EWeaponSlot Slot, ACloud9WeaponBase* Weap ACloud9WeaponBase* UCloud9Inventory::GetSelectedWeapon() const { return GetWeaponAt(SelectedWeaponSlot); } -bool UCloud9Inventory::IsWeaponChanging() const { return SelectedWeaponSlot != PendingWeaponSlot; } +ACloud9WeaponBase* UCloud9Inventory::GetPendingWeapon() const { return GetWeaponAt(PendingWeaponSlot); } -EWeaponType UCloud9Inventory::GetSelectedWeaponType() const -{ - let Weapon = GetWeaponAt(SelectedWeaponSlot); - return IsValid(Weapon) ? Weapon->GetWeaponType() : EWeaponType::NoWeapon; -} - -EWeaponType UCloud9Inventory::GetPendingWeaponType() const -{ - let Weapon = GetWeaponAt(PendingWeaponSlot); - return IsValid(Weapon) ? Weapon->GetWeaponType() : EWeaponType::NoWeapon; -} - -EWeaponSlot UCloud9Inventory::GetSelectedWeaponSlot() const { return SelectedWeaponSlot; } +bool UCloud9Inventory::IsWeaponChanging() const { return SelectedWeaponSlot != PendingWeaponSlot; } diff --git a/Source/Cloud9/Character/Components/Cloud9Inventory.h b/Source/Cloud9/Character/Components/Cloud9Inventory.h index 8ee4687fb..b3b559f33 100644 --- a/Source/Cloud9/Character/Components/Cloud9Inventory.h +++ b/Source/Cloud9/Character/Components/Cloud9Inventory.h @@ -24,13 +24,12 @@ #pragma once #include "CoreMinimal.h" +#include "Components/ActorComponent.h" #include "Cloud9CharacterComponent.h" #include "Cloud9/Cloud9.h" -#include "Cloud9/Weapon/Enums/Cloud9FirearmNames.h" -#include "Cloud9/Weapon/Enums/Cloud9MeleeNames.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponSlot.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponType.h" -#include "Components/ActorComponent.h" +#include "Cloud9/Weapon/Enums/FirearmNames.h" +#include "Cloud9/Weapon/Enums/MeleeNames.h" +#include "Cloud9/Weapon/Enums/WeaponSlot.h" #include "Cloud9Inventory.generated.h" class ACloud9WeaponBase; @@ -50,15 +49,6 @@ class CLOUD9_API UCloud9Inventory UFUNCTION(BlueprintCallable) bool SelectWeapon(EWeaponSlot Slot); - UFUNCTION(BlueprintCallable) - EWeaponType GetSelectedWeaponType() const; - - UFUNCTION(BlueprintCallable) - EWeaponType GetPendingWeaponType() const; - - UFUNCTION(BlueprintCallable) - EWeaponSlot GetSelectedWeaponSlot() const; - UFUNCTION(BlueprintCallable) ACloud9WeaponBase* GetWeaponAt(EWeaponSlot Slot) const; @@ -74,6 +64,9 @@ class CLOUD9_API UCloud9Inventory UFUNCTION(BlueprintCallable) ACloud9WeaponBase* GetSelectedWeapon() const; + UFUNCTION(BlueprintCallable) + ACloud9WeaponBase* GetPendingWeapon() const; + UFUNCTION(BlueprintCallable) bool IsWeaponChanging() const; @@ -101,12 +94,15 @@ class CLOUD9_API UCloud9Inventory UPROPERTY() TArray WeaponSlots; + UPROPERTY(Category=Weapon, BlueprintReadOnly) EWeaponSlot SelectedWeaponSlot; + + UPROPERTY(Category=Weapon, BlueprintReadOnly) EWeaponSlot PendingWeaponSlot; - UPROPERTY(EditDefaultsOnly, Category = Weapons, meta=(AllowPrivateAccess)) + UPROPERTY(Category=Weapon, EditDefaultsOnly) EMelee DefaultKnifeName; - UPROPERTY(EditDefaultsOnly, Category = Weapons, meta=(AllowPrivateAccess)) + UPROPERTY(Category=Weapon, EditDefaultsOnly) EFirearm DefaultPistolName; }; diff --git a/Source/Cloud9/Cloud9.h b/Source/Cloud9/Cloud9.h index 38c3b79f1..9e8c06070 100644 --- a/Source/Cloud9/Cloud9.h +++ b/Source/Cloud9/Cloud9.h @@ -85,25 +85,25 @@ class TOperator { public: template - constexpr friend auto operator|(SelfType* Self, const FunctionType& Function) + constexpr friend auto operator|(SelfType* Self, FunctionType&& Function) { return Function(Self); } template - constexpr friend auto operator|(const SelfType* Self, const FunctionType& Function) + constexpr friend auto operator|(const SelfType* Self, FunctionType&& Function) { return Function(Self); } template - constexpr friend auto operator|(SelfType& Self, const FunctionType& Function) + constexpr friend auto operator|(SelfType& Self, FunctionType&& Function) { - return Function(Forward(Self)); + return Function(Forward(Self)); // TODO: May be use Function(MoveTempIfPossible(Self)) ??? } template - constexpr friend auto operator|(SelfType&& Self, const FunctionType& Function) + constexpr friend auto operator|(SelfType&& Self, FunctionType&& Function) { return Function(Forward(Self)); } diff --git a/Source/Cloud9/Game/Cloud9AssetManager.cpp b/Source/Cloud9/Game/Cloud9AssetManager.cpp new file mode 100644 index 000000000..4ac114be1 --- /dev/null +++ b/Source/Cloud9/Game/Cloud9AssetManager.cpp @@ -0,0 +1,48 @@ +// Copyright (c) 2023 Alexei Gladkikh +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. + +#include "Cloud9AssetManager.h" +#include "Cloud9/Cloud9.h" + +UObject* UCloud9AssetManager::GetOrLoadAssetSync(FPrimaryAssetId PrimaryAssetId) +{ + static var& Manager = Get(); + + let Future = Manager.LoadPrimaryAsset(PrimaryAssetId); + + if (not Future) + { + log(Error, "Can't find asset: '%s'", *PrimaryAssetId.ToString()) + return nullptr; + } + + if (Future->WaitUntilComplete() == EAsyncPackageState::Complete) + { + let Asset = Future->GetLoadedAsset(); + Asset->AddToRoot(); // Prevent GC destroy asset + return Asset; + } + + log(Error, "Failed to loading asset: '%s'", *PrimaryAssetId.ToString()) + return nullptr; +} diff --git a/Source/Cloud9/Game/Cloud9AssetManager.h b/Source/Cloud9/Game/Cloud9AssetManager.h new file mode 100644 index 000000000..067673f93 --- /dev/null +++ b/Source/Cloud9/Game/Cloud9AssetManager.h @@ -0,0 +1,44 @@ +// Copyright (c) 2023 Alexei Gladkikh +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. + +#pragma once + +#include "CoreMinimal.h" +#include "Engine/AssetManager.h" +#include "Cloud9AssetManager.generated.h" + +UCLASS() +class CLOUD9_API UCloud9AssetManager : public UAssetManager +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintCallable) + static UObject* GetOrLoadAssetSync(FPrimaryAssetId PrimaryAssetId); + + template + static ClassType* GetOrLoadAssetSync(FPrimaryAssetId PrimaryAssetId = ClassType::PrimaryAssetId) + { + return Cast(GetOrLoadAssetSync(PrimaryAssetId)); + } +}; diff --git a/Source/Cloud9/Game/Cloud9GameInstance.cpp b/Source/Cloud9/Game/Cloud9GameInstance.cpp index fcdec4938..23cbb582d 100644 --- a/Source/Cloud9/Game/Cloud9GameInstance.cpp +++ b/Source/Cloud9/Game/Cloud9GameInstance.cpp @@ -22,111 +22,3 @@ // OTHER DEALINGS IN THE SOFTWARE. #include "Cloud9GameInstance.h" - -#include "Cloud9/Tools/Extensions/UEnum.h" -#include "Cloud9/Tools/Extensions/UWorld.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponType.h" -#include "Cloud9/Weapon/Tables/Cloud9WeaponTableFirearm.h" -#include "Cloud9/Weapon/Tables/Cloud9WeaponTableGrenade.h" -#include "Cloud9/Weapon/Tables/Cloud9WeaponTableMelee.h" - -template < - typename WeaponActorType, - typename WeaponInfoType, - typename WeaponEnumType, - typename ValidatorType -> -WeaponActorType* UCloud9GameInstance::SpawnWeaponIntern( - UDataTable* WeaponsInfoTable, - ValidatorType Validator, - WeaponEnumType WeaponId, - ACloud9Character* Character, - const FTransform& Transform) const -{ - if (WeaponsInfoTable == nullptr) - { - log(Error, "WeaponsInfoTable isn't set"); - return nullptr; - } - - let Name = WeaponId | EUEnum::GetValueName(); - - if (Name.IsNone()) - { - log(Error, "Can't get weapon identifier name"); - return nullptr; - } - - let WeaponInfo = WeaponsInfoTable->FindRow(Name, "", false); - - if (WeaponInfo == nullptr) - { - log(Error, "Can't get weapon info for '%s'", *Name.ToString()); - return nullptr; - } - - if (not Validator(WeaponInfo->Type)) - { - let TypeName = WeaponInfo->Type | EUEnum::GetEnumFullValueName(); - log(Fatal, "Specified weapon type '%s' is invalid", *TypeName.ToString()); - return nullptr; - } - - let Montages = WeaponActionMontages.Find(WeaponInfo->Type); - - if (Montages == nullptr) - { - let WeaponName = WeaponInfo->Type | EUEnum::GetValueName(); - log(Fatal, "Animation montages not defined for weapon type '%s'", *WeaponName.ToString()); - return nullptr; - } - - return GetWorld() | EUWorld::SpawnActorInitialized( - WeaponInfo->Class, - [=](let It) { return It->Initialize(WeaponInfo, Montages); }, - Transform, - Character - ); -} - -ACloud9WeaponFirearm* UCloud9GameInstance::SpawnFirearmWeapon( - EFirearm WeaponId, - ACloud9Character* Character, - const FTransform& Transform) const -{ - return SpawnWeaponIntern( - FirearmsWeaponsInfoTable, - &UCloud9WeaponType::IsFirearm, - WeaponId, - Character, - Transform - ); -} - -ACloud9WeaponMelee* UCloud9GameInstance::SpawnMeleeWeapon( - EMelee WeaponId, - ACloud9Character* Character, - const FTransform& Transform) const -{ - return SpawnWeaponIntern( - MeleeWeaponsInfoTable, - &UCloud9WeaponType::IsMelee, - WeaponId, - Character, - Transform - ); -} - -ACloud9WeaponGrenade* UCloud9GameInstance::SpawnGrenadeWeapon( - EGrenade WeaponId, - ACloud9Character* Character, - const FTransform& Transform) const -{ - return SpawnWeaponIntern( - GrenadeWeaponInfoTable, - &UCloud9WeaponType::IsGrenade, - WeaponId, - Character, - Transform - ); -} diff --git a/Source/Cloud9/Game/Cloud9GameInstance.h b/Source/Cloud9/Game/Cloud9GameInstance.h index f792499b7..fc001bf0c 100644 --- a/Source/Cloud9/Game/Cloud9GameInstance.h +++ b/Source/Cloud9/Game/Cloud9GameInstance.h @@ -24,107 +24,11 @@ #pragma once #include "CoreMinimal.h" -#include "Cloud9/Weapon/Enums/Cloud9FirearmNames.h" -#include "Cloud9/Weapon/Enums/Cloud9GrenadeNames.h" -#include "Cloud9/Weapon/Enums/Cloud9MeleeNames.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponType.h" #include "Engine/GameInstance.h" #include "Cloud9GameInstance.generated.h" -class UDataTable; -class ACloud9Character; -class ACloud9WeaponMelee; -class ACloud9WeaponGrenade; -class ACloud9WeaponFirearm; - -USTRUCT(BlueprintType) -struct FWeaponActionMontages -{ - GENERATED_BODY() - - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Action) - UAnimMontage* PrimaryActionMontage = nullptr; - - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Action) - UAnimMontage* SecondaryActionMontage = nullptr; - - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Reload) - UAnimMontage* ReloadMontage = nullptr; -}; - -USTRUCT(BlueprintType) -struct FWeaponPosesMontages -{ - GENERATED_BODY() - - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly) - FWeaponActionMontages OnStand; - - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly) - FWeaponActionMontages OnCrouch; - - const FWeaponActionMontages* GetPoseMontages(bool bIsCrouch) const { return bIsCrouch ? &OnCrouch : &OnStand; } -}; - UCLASS() class CLOUD9_API UCloud9GameInstance : public UGameInstance { GENERATED_BODY() - -public: // functions - /** - * Function spawns firearm weapon to given owner (Character) - */ - ACloud9WeaponFirearm* SpawnFirearmWeapon( - EFirearm WeaponId, - ACloud9Character* Character = nullptr, - const FTransform& Transform = FTransform::Identity) const; - - /** - * Function spawns melee weapon to given owner (Character) - */ - ACloud9WeaponMelee* SpawnMeleeWeapon( - EMelee WeaponId, - ACloud9Character* Character = nullptr, - const FTransform& Transform = FTransform::Identity) const; - - /** - * Function spawns grenade weapon to given owner (Character) - */ - ACloud9WeaponGrenade* SpawnGrenadeWeapon( - EGrenade WeaponId, - ACloud9Character* Character = nullptr, - const FTransform& Transform = FTransform::Identity) const; - -protected: // properties - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) - UDataTable* FirearmsWeaponsInfoTable; - - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) - UDataTable* MeleeWeaponsInfoTable; - - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) - UDataTable* GrenadeWeaponInfoTable; - - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) - TMap WeaponActionMontages; - - /** - * Weapon tracer - */ - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) - UParticleSystem* FirearmTracer = nullptr; - - template < - typename WeaponActorType, - typename WeaponInfoType, - typename WeaponEnumType, - typename ValidatorType - > - WeaponActorType* SpawnWeaponIntern( - UDataTable* WeaponsInfoTable, - ValidatorType Validator, - WeaponEnumType WeaponId, - ACloud9Character* Character, - const FTransform& Transform) const; }; diff --git a/Source/Cloud9/Tools/Components/CooldownActionComponent.cpp b/Source/Cloud9/Tools/Components/CooldownActionComponent.cpp index 37f068741..44ce7adf4 100644 --- a/Source/Cloud9/Tools/Components/CooldownActionComponent.cpp +++ b/Source/Cloud9/Tools/Components/CooldownActionComponent.cpp @@ -28,6 +28,7 @@ UCooldownActionComponent::UCooldownActionComponent() { PrimaryComponentTick.bCanEverTick = true; DefaultCooldownTime = 0.0f; + RemainTime = 0.0f; bIsActionInProcess = false; } @@ -37,7 +38,21 @@ UCooldownActionComponent* UCooldownActionComponent::Initialize(float NewDefaultC return this; } -bool UCooldownActionComponent::IsExecuting() const +void UCooldownActionComponent::TickComponent(float DeltaTime, ELevelTick TickType, + FActorComponentTickFunction* ThisTickFunction) { - return this | EUObject::IsTimerActive(ActionTimerHandle); + Super::TickComponent(DeltaTime, TickType, ThisTickFunction); + + if (bIsActionInProcess) + { + RemainTime -= DeltaTime; + + if (RemainTime <= 0.0f) + { + bIsActionInProcess = false; + SetComponentTickEnabled(false); + } + } } + +bool UCooldownActionComponent::IsExecuting() const { return bIsActionInProcess; } diff --git a/Source/Cloud9/Tools/Components/CooldownActionComponent.h b/Source/Cloud9/Tools/Components/CooldownActionComponent.h index 49fcce4d4..4a6f9d6fa 100644 --- a/Source/Cloud9/Tools/Components/CooldownActionComponent.h +++ b/Source/Cloud9/Tools/Components/CooldownActionComponent.h @@ -49,6 +49,12 @@ class CLOUD9_API UCooldownActionComponent : public UActorComponent UCooldownActionComponent* Initialize(float NewDefaultCooldownTime); public: + virtual void TickComponent( + float DeltaTime, + ELevelTick TickType, + FActorComponentTickFunction* ThisTickFunction + ) override; + /** * Function executes new action with specified function if cooldown * finished; also setups timer to wait new cooldown and returns true. @@ -65,13 +71,14 @@ class CLOUD9_API UCooldownActionComponent : public UActorComponent return false; } - if (let Time = OverrideCooldownTime < 0.0f ? DefaultCooldownTime : OverrideCooldownTime; Time > 0.0f) + RemainTime = OverrideCooldownTime < 0.0f ? DefaultCooldownTime : OverrideCooldownTime; + + if (RemainTime > 0.0f) { bIsActionInProcess = true; - ActionTimerHandle = this | EUObject::AsyncAfter([this] { bIsActionInProcess = false; }, Time); + SetComponentTickEnabled(true); + return true; } - - return true; } return false; @@ -85,18 +92,18 @@ class CLOUD9_API UCooldownActionComponent : public UActorComponent /** * Cooldown time - next action will be executed only after it */ - UPROPERTY(Category=Timer, BlueprintReadOnly, meta=(AllowPrivateAccess = "true")) + UPROPERTY(Category=Timer, BlueprintReadOnly, meta=(AllowPrivateAccess)) float DefaultCooldownTime; /** - * Action timer cooldown + * Remain cooldown time */ - UPROPERTY(Category=Implementation, BlueprintReadOnly, meta=(AllowPrivateAccess = "true")) - FTimerHandle ActionTimerHandle; + UPROPERTY(Category=Implementation, BlueprintReadOnly, meta=(AllowPrivateAccess)) + float RemainTime; /** * Whether or not action currently in process */ - UPROPERTY(Category=Implementation, BlueprintReadOnly, meta=(AllowPrivateAccess = "true")) + UPROPERTY(Category=Implementation, BlueprintReadOnly, meta=(AllowPrivateAccess)) bool bIsActionInProcess; }; diff --git a/Source/Cloud9/Tools/Extensions/TOptional.h b/Source/Cloud9/Tools/Extensions/TOptional.h new file mode 100644 index 000000000..32ee68dbf --- /dev/null +++ b/Source/Cloud9/Tools/Extensions/TOptional.h @@ -0,0 +1,131 @@ +// Copyright (c) 2023 Alexei Gladkikh +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. + +#pragma once + +#include "Cloud9/Cloud9.h" + +namespace ETOptional +{ + template + struct Get : TOperator> + { + public: + constexpr explicit Get() : DefaultValueGetter(NullOptionalDereference) {} + + template requires std::invocable + constexpr explicit Get(const T& Default) : DefaultValueGetter(Default) {} + + template requires not std::invocable + constexpr explicit Get(const T& Default) : DefaultValueGetter([&] { return Default; }) {} + + template + constexpr const ValueType& operator()(const TOptional& Self) + { + // or TIsSame::Value + + // nullptr_t is acceptable because we case crash on dereference + // using log(Fatal) if not default argument was set + static_assert( + TIsSame::Value or TIsSame::Value, + "Default value type and value type should be the same or default value type should be nullptr_t" + ); + + if (not Self.IsSet()) + { + DefaultValue = DefaultValueGetter(); + return *reinterpret_cast(&DefaultValue); + } + + return *Self; + } + + private: + TFunction DefaultValueGetter; + + DefaultValueType DefaultValue; + + constexpr static DefaultValueType NullOptionalDereference() + { + log(Fatal, "nullopt dereference"); + return {}; + } + }; + + Get() -> Get; + + template requires std::invocable + Get(const T&) -> Get>; + + template requires not std::invocable + Get(const T&) -> Get; + + template + struct OnNull : TOperator> + { + public: + constexpr explicit OnNull(BlockType Block) : Block(Block) {} + + template + constexpr const TOptional& operator()(const TOptional& Self) + { + if (not Self.IsSet()) + { + Block(); + } + + return Self; + } + + private: + BlockType Block; + }; + + template + struct OnSet : TOperator> + { + public: + constexpr explicit OnSet(BlockType Block) : Block(Block) {} + + template + constexpr const TOptional& operator()(const TOptional& Self) + { + if (Self.IsSet()) + { + Block(*Self); + } + + return Self; + } + + private: + BlockType Block; + }; + + struct IsSet : TOperator + { + public: + template + constexpr bool operator()(const TOptional& Self) { return Self.IsSet(); } + }; +} diff --git a/Source/Cloud9/Tools/Extensions/UWorld.h b/Source/Cloud9/Tools/Extensions/UWorld.h index 135a7c7e5..858069667 100644 --- a/Source/Cloud9/Tools/Extensions/UWorld.h +++ b/Source/Cloud9/Tools/Extensions/UWorld.h @@ -27,27 +27,26 @@ namespace EUWorld { - template - struct SpawnActorInitialized : TOperator> + template + struct SpawnActor : TOperator> { public: - SpawnActorInitialized( - UClass* Class, - TInitializer Initializer, + using FInitializerType = TFunction; + + FORCEINLINE explicit SpawnActor( + FInitializerType Initializer, const FTransform& Transform = {}, AActor* Owner = nullptr, APawn* Instigator = nullptr - ) - : Class(Class) - , Initializer(Initializer) - , Transform(Transform) - , Owner(Owner) - , Instigator(Instigator) { } + ) : Initializer(Initializer) + , Transform(Transform) + , Owner(Owner) + , Instigator(Instigator) {} - TClass* operator()(UWorld* World) const + FORCEINLINE ClassType* operator()(UWorld* Self) const { - let Actor = World->SpawnActorDeferred(Class, Transform, Owner, Instigator); - if (IsValid(Actor) && Initializer(Actor)) + let Actor = Self->SpawnActorDeferred(ClassType::StaticClass(), Transform, Owner, Instigator); + if (IsValid(Actor) and Initializer(Actor)) { Actor->FinishSpawning(Transform); return Actor; @@ -56,19 +55,12 @@ namespace EUWorld } private: - UClass* Class; - TInitializer Initializer; + FInitializerType Initializer; const FTransform& Transform; AActor* Owner = nullptr; APawn* Instigator = nullptr; }; - template typename TClassInfo, typename TClass, typename TInit> - SpawnActorInitialized( - TClassInfo Class, - TInit Init, - ...) -> SpawnActorInitialized; - template struct AsyncAfter : TOperator> { diff --git a/Source/Cloud9/Weapon/Assets/WeaponDefinitionsAsset.cpp b/Source/Cloud9/Weapon/Assets/WeaponDefinitionsAsset.cpp new file mode 100644 index 000000000..f83e938c8 --- /dev/null +++ b/Source/Cloud9/Weapon/Assets/WeaponDefinitionsAsset.cpp @@ -0,0 +1,106 @@ +// Copyright (c) 2023 Alexei Gladkikh +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. + +#include "WeaponDefinitionsAsset.h" + +#include "Cloud9/Weapon/Tables/WeaponTableFirearm.h" +#include "Cloud9/Weapon/Tables/WeaponTableGrenade.h" +#include "Cloud9/Weapon/Tables/WeaponTableMelee.h" + +const FPrimaryAssetId UWeaponDefinitionsAsset::PrimaryAssetId = FPrimaryAssetId("Weapon:Definitions"); + +template +TOptional UWeaponDefinitionsAsset::GetWeaponDefinition( + UDataTable* WeaponsInfoTable, + ValidatorType Validator, + FName WeaponName) const +{ + if (WeaponName.IsNone()) + { + log(Error, "WeaponName is invalid"); + return {}; + } + + if (WeaponsInfoTable == nullptr) + { + log(Error, "WeaponsInfoTable isn't set"); + return {}; + } + + let WeaponInfo = WeaponsInfoTable->FindRow(WeaponName, "", false); + + if (WeaponInfo == nullptr) + { + log(Error, "Can't get weapon info for '%s'", *WeaponName.ToString()); + return {}; + } + + if (not Validator(WeaponInfo->Type)) + { + let TypeName = WeaponInfo->Type | EUEnum::GetEnumFullValueName(); + log(Error, "Specified weapon type '%s' is invalid", *TypeName.ToString()); + return {}; + } + + let Montages = WeaponActionMontages.Find(WeaponInfo->Type); + + if (Montages == nullptr) + { + let TypeName = WeaponInfo->Type | EUEnum::GetValueName(); + log(Error, "Animation montages not defined for weapon type '%s'", *TypeName.ToString()); + return {}; + } + + return FWeaponDefinition{ + MakeShared(*WeaponInfo), + MakeShared(*Montages), + FirearmTracer + }; +} + +TOptional UWeaponDefinitionsAsset::GetWeaponDefinition( + EWeaponClass WeaponClass, FName WeaponName) const +{ + switch (WeaponClass) + { + case EWeaponClass::Firearm: + return GetWeaponDefinition( + FirearmsWeaponsInfoTable, + UWeaponType::IsFirearm, + WeaponName); + case EWeaponClass::Melee: + return GetWeaponDefinition( + MeleeWeaponsInfoTable, + UWeaponType::IsMelee, + WeaponName); + case EWeaponClass::Grenade: + return GetWeaponDefinition( + GrenadeWeaponInfoTable, + UWeaponType::IsGrenade, + WeaponName); + default: + return {}; + } +} + +FPrimaryAssetId UWeaponDefinitionsAsset::GetPrimaryAssetId() const { return PrimaryAssetId; } diff --git a/Source/Cloud9/Weapon/Assets/WeaponDefinitionsAsset.h b/Source/Cloud9/Weapon/Assets/WeaponDefinitionsAsset.h new file mode 100644 index 000000000..3dddb2cb2 --- /dev/null +++ b/Source/Cloud9/Weapon/Assets/WeaponDefinitionsAsset.h @@ -0,0 +1,84 @@ +// Copyright (c) 2023 Alexei Gladkikh +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. + +#pragma once + +#include "Engine/DataTable.h" +#include "Cloud9/Weapon/Enums/WeaponClass.h" +#include "Cloud9/Weapon/Enums/WeaponType.h" +#include "Cloud9/Weapon/Structures/WeaponDefinition.h" +#include "Cloud9/Weapon/Tables/WeaponMontages.h" +#include "WeaponDefinitionsAsset.generated.h" + +UCLASS(BlueprintType) +class CLOUD9_API UWeaponDefinitionsAsset : public UPrimaryDataAsset +{ + GENERATED_BODY() + +public: + static const FPrimaryAssetId PrimaryAssetId; + +public: // functions + TOptional GetWeaponDefinition(EWeaponClass WeaponClass, FName WeaponName) const; + +protected: // functions + virtual FPrimaryAssetId GetPrimaryAssetId() const override; + +protected: // properties + /** + * Weapon info table for firearms + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) + UDataTable* FirearmsWeaponsInfoTable; + + /** + * Weapon info table for melee + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) + UDataTable* MeleeWeaponsInfoTable; + + /** + * Weapon info table for grenades + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) + UDataTable* GrenadeWeaponInfoTable; + + /** + * Weapon montages for different types + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) + TMap WeaponActionMontages; + + /** + * Weapon tracer + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Weapon) + UParticleSystem* FirearmTracer; + +private: // functions + template + FORCEINLINE TOptional GetWeaponDefinition( + UDataTable* WeaponsInfoTable, + ValidatorType Validator, + FName WeaponName) const; +}; diff --git a/Source/Cloud9/Weapon/Classes/Cloud9WeaponBase.cpp b/Source/Cloud9/Weapon/Classes/Cloud9WeaponBase.cpp index e7fdc1232..f8bd11c46 100644 --- a/Source/Cloud9/Weapon/Classes/Cloud9WeaponBase.cpp +++ b/Source/Cloud9/Weapon/Classes/Cloud9WeaponBase.cpp @@ -25,8 +25,13 @@ #include "Cloud9/Cloud9.h" #include "Cloud9/Character/Cloud9Character.h" +#include "Cloud9/Game/Cloud9AssetManager.h" #include "Cloud9/Tools/Components/CooldownActionComponent.h" -#include "Cloud9/Weapon/Tables/Cloud9WeaponTableBase.h" +#include "Cloud9/Tools/Extensions/Range.h" +#include "Cloud9/Tools/Extensions/TOptional.h" +#include "Cloud9/Tools/Extensions/USoundBase.h" +#include "Cloud9/Weapon/Assets/WeaponDefinitionsAsset.h" +#include "Cloud9/Weapon/Enums/WeaponClass.h" const FName ACloud9WeaponBase::RootComponentName = TEXT("RootComponent"); const FName ACloud9WeaponBase::WeaponMeshCollisionProfile = TEXT("WeaponCollisionProfile"); @@ -39,13 +44,28 @@ ACloud9WeaponBase::ACloud9WeaponBase() State = EWeaponState::Dropped; Slot = EWeaponSlot::NotSelected; - bIsInitialized = false; - Info = nullptr; - Montages = nullptr; + Skin = FWeaponSkin::Default; bIsPrimaryActionActive = false; bIsSecondaryActionActive = false; + + SetActorTickEnabled(false); +} + +UWeaponDefinitionsAsset* ACloud9WeaponBase::GetWeaponDefinitionsAsset() +{ + // Without static won't work in packaged game + static let WeaponDefinitionsAsset = UCloud9AssetManager::GetOrLoadAssetSync(); + + if (not IsValid(WeaponDefinitionsAsset)) + { + // We have nothing to do if assets wasn't loaded + log(Fatal, "WeaponDefinitionsAsset loading failure"); + return nullptr; + } + + return WeaponDefinitionsAsset; } void ACloud9WeaponBase::OnConstruction(const FTransform& Transform) @@ -56,16 +76,21 @@ void ACloud9WeaponBase::OnConstruction(const FTransform& Transform) static_assert(AnyActionId == 0); static_assert(AnyActionIndex == -1); - let Class = GetWeaponClass(); - let Actions = GetWeaponActions(); + WeaponDefinition = GetWeaponDefinitionsAsset()->GetWeaponDefinition(GetWeaponClass(), GetWeaponName()); - // Use check to be sure compiler not discard functions calls - assert(Class != EWeaponClass::NoClass); - assert(Actions != nullptr); + if (not IsWeaponInitialized()) + { + log(Error, "[Weapon='%s'] Not initialized and Tick() will be disabled", *GetName()); + return; + } - assertf(bIsInitialized, "Weapon '%ls' wasn't initialized!", *GetName()); - assertf(Info != nullptr, "Weapon Info for '%ls' wasn't set!", *GetName()); - assertf(Montages != nullptr, "Weapon Montages '%ls' wasn't set!", *GetName()); + let Actions = GetWeaponActions(); + + if (not IsValid(Actions)) + { + log(Error, "[Weapon='%s'] Actions not specified", *GetName()); + return; + } for (int Id = AnyActionId + 1; Id < Actions->NumEnums(); Id++) { @@ -74,14 +99,11 @@ void ACloud9WeaponBase::OnConstruction(const FTransform& Transform) let CooldownActionComponent = CreateCooldownAction(FName(ComponentName)); Executors.Add(CooldownActionComponent); } -} -void ACloud9WeaponBase::BeginPlay() -{ - Super::BeginPlay(); + SetActorTickEnabled(true); } -UStaticMeshComponent* ACloud9WeaponBase::CreateMesh(FName ComponentName, FName SocketName) +UStaticMeshComponent* ACloud9WeaponBase::CreateMeshComponent(FName ComponentName, FName SocketName) { if (let Component = CreateDefaultSubobject(ComponentName); IsValid(Component)) { @@ -114,7 +136,7 @@ UStaticMeshComponent* ACloud9WeaponBase::CreateMesh(FName ComponentName, FName S return nullptr; } -UNiagaraComponent* ACloud9WeaponBase::CreateEffect(FName ComponentName, FName SocketName) +UNiagaraComponent* ACloud9WeaponBase::CreateEffectComponent(FName ComponentName, FName SocketName) { if (let Component = CreateDefaultSubobject(ComponentName); IsValid(Component)) { @@ -126,6 +148,106 @@ UNiagaraComponent* ACloud9WeaponBase::CreateEffect(FName ComponentName, FName So return nullptr; } +bool ACloud9WeaponBase::InitializeMeshComponent( + UStaticMeshComponent* Component, + UStaticMesh* Mesh, + const FWeaponSkin& SkinInfo) const +{ + if (SkinInfo.Material == nullptr) + { + log(Error, "[Weapon='%s'] Skin material is invalid", *GetName()); + return false; + } + + if (Mesh == nullptr) + { + log(Error, "[Weapon='%s'] Mesh is invalid", *GetName()); + return false; + } + + Component->SetStaticMesh(Mesh); + Component->SetMaterial(0, SkinInfo.Material); + + return true; +} + +bool ACloud9WeaponBase::InitializeEffectComponent(UNiagaraComponent* Component, UNiagaraSystem* Effect) const +{ + if (Effect == nullptr) + { + log(Error, "[Weapon='%s'] Effect is invalid", *GetName()); + return false; + } + + Component->SetAsset(Effect); + return true; +} + +UAnimInstance* ACloud9WeaponBase::GetAnimInstance() const +{ + let Character = GetOwner(); + + if (not IsValid(Character)) + { + log(Error, "[Weapon='%s'] Character is invalid", *GetName()); + return nullptr; + } + + let Mesh = Character->GetMesh(); + + if (not IsValid(Mesh)) + { + log(Error, "[Weapon='%s'] Mesh is invalid", *GetName()); + return nullptr; + } + + return Mesh->GetAnimInstance(); +} + +bool ACloud9WeaponBase::PlayAnimMontage(UAnimMontage* Montage) const +{ + let AnimInstance = GetAnimInstance(); + + if (not IsValid(AnimInstance)) + { + log(Error, "[Weapon='%s'] AnimInstance is invalid", *GetName()); + return false; + } + + if (not AnimInstance->Montage_Play(Montage)) + { + log(Error, "[Weapon='%s'] Can't play montage", *GetName()); + return false; + } + + return true; +} + +bool ACloud9WeaponBase::IsAnyMontagePlaying() const +{ + let AnimInstance = GetAnimInstance(); + + if (not IsValid(AnimInstance)) + { + log(Error, "[Weapon='%s'] AnimInstance is invalid", *GetName()); + return false; + } + + return AnimInstance->IsAnyMontagePlaying(); +} + +bool ACloud9WeaponBase::PlayRandomSound(const TArray& Sounds, float Volume) const +{ + using namespace ERange; + using namespace ETOptional; + + return Sounds + | Random() + | OnNull([&] { log(Error, "[Weapon='%s'] Can't play sound for ", *GetName()) }) + | OnSet([&](let& It) { It | EUSoundBase::Play(GetActorLocation(), Volume); }) + | IsSet(); +} + bool ACloud9WeaponBase::IsActionIndexValid(int Index) const { if (Index > Executors.Num() or Index < 0) @@ -157,8 +279,8 @@ UCooldownActionComponent* ACloud9WeaponBase::CreateCooldownAction(FName Componen return Component; } -#define SLOT_NAME *UCloud9WeaponSlot::ToString(NewSlot) -#define STATE_NAME *UCloud9WeaponState::ToString(NewState) +#define SLOT_NAME *UWeaponSlot::ToString(NewSlot) +#define STATE_NAME *UWeaponState::ToString(NewState) bool ACloud9WeaponBase::UpdateWeaponAttachment(EWeaponSlot NewSlot, EWeaponState NewState) { @@ -179,8 +301,8 @@ bool ACloud9WeaponBase::UpdateWeaponAttachment(EWeaponSlot NewSlot, EWeaponState } let SocketName = NewState == EWeaponState::Armed - ? UCloud9WeaponSlot::EquippedSocket() - : UCloud9WeaponSlot::HolsteredSocket(NewSlot); + ? UWeaponSlot::EquippedSocket() + : UWeaponSlot::HolsteredSocket(NewSlot); if (SocketName.IsNone()) { @@ -271,6 +393,9 @@ bool ACloud9WeaponBase::RemoveFromInventory() Slot = EWeaponSlot::NotSelected; State = EWeaponState::Dropped; + bIsPrimaryActionActive = false; + bIsSecondaryActionActive = false; + DetachFromActor(FDetachmentTransformRules::KeepRelativeTransform); SetOwner(nullptr); @@ -293,8 +418,13 @@ bool ACloud9WeaponBase::ChangeState(EWeaponState NewState) return false; } - UpdateWeaponAttachment(Slot, NewState); - return true; + if (not IsAnyMontagePlaying() and not IsActionInProgress()) + { + UpdateWeaponAttachment(Slot, NewState); + return true; + } + + return false; } void ACloud9WeaponBase::PrimaryAction(bool bIsReleased) @@ -336,11 +466,33 @@ bool ACloud9WeaponBase::ChangeActionFlag(bool Flag, bool bIsReleased) return Flag; } -EWeaponType ACloud9WeaponBase::GetWeaponType() const { return GetWeaponInfo()->Type; } +FName ACloud9WeaponBase::GetWeaponName() const +{ + log(Fatal, "[Weapon='%s'] Not implmemented", *GetName()) + return NAME_None; +} + +EWeaponType ACloud9WeaponBase::GetWeaponType() const +{ + assertf(WeaponDefinition.IsSet(), "[Weapon='%ls'] Not initialized", *GetName()); + return WeaponDefinition->GetWeaponInfo()->Type; +} + +const UStaticMeshSocket* ACloud9WeaponBase::GetSocketByName(FName SocketName) const +{ + log(Fatal, "[Weapon='%s'] Not implmemented", *GetName()) + return nullptr; +} + +const UStaticMeshComponent* ACloud9WeaponBase::GetWeaponMesh() const +{ + log(Fatal, "[Weapon='%s'] Not implmemented", *GetName()) + return nullptr; +} EWeaponClass ACloud9WeaponBase::GetWeaponClass() const { - log(Fatal, "[Weapon='%s'] Weapon class wasn't override", *GetName()) + log(Fatal, "[Weapon='%s'] Not implmemented", *GetName()) return EWeaponClass::NoClass; } @@ -348,6 +500,6 @@ bool ACloud9WeaponBase::CanBeDropped() const { return true; } const UEnum* ACloud9WeaponBase::GetWeaponActions() const { - log(Fatal, "[Weapon='%s'] Weapon actions wasn't override", *GetName()); + log(Fatal, "[Weapon='%s'] Not implmemented", *GetName()); return nullptr; } diff --git a/Source/Cloud9/Weapon/Classes/Cloud9WeaponBase.h b/Source/Cloud9/Weapon/Classes/Cloud9WeaponBase.h index 2ab6e400e..d06bb3c49 100644 --- a/Source/Cloud9/Weapon/Classes/Cloud9WeaponBase.h +++ b/Source/Cloud9/Weapon/Classes/Cloud9WeaponBase.h @@ -29,15 +29,13 @@ #include "Cloud9/Cloud9.h" #include "Cloud9/Character/Cloud9Character.h" #include "Cloud9/Tools/Components/CooldownActionComponent.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponClass.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponSlot.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponState.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponType.h" -#include "Cloud9/Weapon/Tables/Cloud9WeaponTableBase.h" +#include "Cloud9/Weapon/Assets/WeaponDefinitionsAsset.h" +#include "Cloud9/Weapon/Enums/WeaponClass.h" +#include "Cloud9/Weapon/Enums/WeaponState.h" +#include "Cloud9/Weapon/Structures/WeaponDefinition.h" #include "Cloud9WeaponBase.generated.h" class UCloud9Inventory; -struct FWeaponPosesMontages; UCLASS() class CLOUD9_API ACloud9WeaponBase : public AActor @@ -55,6 +53,9 @@ class CLOUD9_API ACloud9WeaponBase : public AActor public: ACloud9WeaponBase(); + UFUNCTION(BlueprintCallable) + virtual FName GetWeaponName() const; + UFUNCTION(BlueprintCallable) virtual EWeaponClass GetWeaponClass() const; @@ -67,22 +68,13 @@ class CLOUD9_API ACloud9WeaponBase : public AActor UFUNCTION(BlueprintCallable) EWeaponType GetWeaponType() const; - template - bool Initialize(const TWeaponInfo* NewWeaponInfo, const FWeaponPosesMontages* NewWeaponMontages) - { - assertf(not bIsInitialized, "Weapon '%ls' already initialized!", *Info->Label.ToString()); - bIsInitialized = true; - Montages = NewWeaponMontages; - Info = NewWeaponInfo; - return true; - } + UFUNCTION(BlueprintCallable) + virtual const UStaticMeshSocket* GetSocketByName(FName SocketName) const; - template - const WeaponInfoType* GetWeaponInfo() const - { - // All checks are done in OnConstruction - return static_cast(Info); - } + UFUNCTION(BlueprintCallable) + virtual const UStaticMeshComponent* GetWeaponMesh() const; + + bool IsWeaponInitialized() const { return WeaponDefinition.IsSet(); } bool AddToInventory(ACloud9Character* Character, EWeaponSlot NewSlot); bool RemoveFromInventory(); @@ -132,6 +124,9 @@ class CLOUD9_API ACloud9WeaponBase : public AActor return false; } + FORCEINLINE bool IsWeaponArmed() const { return State == EWeaponState::Armed; } + FORCEINLINE bool IsWeaponDisarmed() const { return State != EWeaponState::Armed; } + virtual void PrimaryAction(bool bIsReleased); virtual void SecondaryAction(bool bIsReleased); virtual void Reload(); @@ -149,46 +144,77 @@ class CLOUD9_API ACloud9WeaponBase : public AActor */ virtual void OnWeaponRemovedFromInventory(); + static UWeaponDefinitionsAsset* GetWeaponDefinitionsAsset(); + static bool ChangeActionFlag(bool Flag, bool bIsReleased); - UStaticMeshComponent* CreateMesh(FName ComponentName, FName SocketName = NAME_None); - UNiagaraComponent* CreateEffect(FName ComponentName, FName SocketName); + UStaticMeshComponent* CreateMeshComponent(FName ComponentName, FName SocketName = NAME_None); + UNiagaraComponent* CreateEffectComponent(FName ComponentName, FName SocketName); + + bool InitializeMeshComponent( + UStaticMeshComponent* Component, + UStaticMesh* Mesh, + const FWeaponSkin& SkinInfo + ) const; + + bool InitializeEffectComponent(UNiagaraComponent* Component, UNiagaraSystem* Effect) const; + + UAnimInstance* GetAnimInstance() const; + bool IsAnyMontagePlaying() const; + bool PlayAnimMontage(UAnimMontage* Montage) const; + + bool PlayRandomSound(const TArray& Sounds, float Volume) const; bool UpdateWeaponAttachment( EWeaponSlot NewSlot, EWeaponState NewState); virtual void OnConstruction(const FTransform& Transform) override; - virtual void BeginPlay() override; -protected: // properties - /** - * Flag sets to true on spawn through GameInstance spawners - * i.e. properties Montages and Info setups to valid values - */ - UPROPERTY(BlueprintReadOnly, meta=(AllowPrivateAccess)) - bool bIsInitialized; +#define WEAPON_IS_INITIALIZED_GUARD() \ + if (not IsWeaponInitialized()) \ + { \ + log(Error, "[Weapon='%s'] Not initialized", *GetName()); \ + return; \ + } +#define WEAPON_IS_ACTION_IN_PROGRESS_GUARD() \ + if (IsActionInProgress()) \ + { \ + log(Verbose, "[Weapon='%s'] Action already in progress during Tick", *GetName()); \ + return; \ + } + +#define WEAPON_IS_DISARMED_GUARD() \ + if (IsWeaponDisarmed()) \ + { \ + return; \ + } + + bool IsActionIndexValid(int Index) const; + +protected: // properties /** - * Base weapon info + * Current weapon skin name */ - const FBaseWeaponInfo* Info; + UPROPERTY(Category=Weapon, BlueprintReadOnly, EditDefaultsOnly, meta=(AllowPrivateAccess)) + FName Skin; /** - * Weapon montages + * Weapon cumulative data */ - const FWeaponPosesMontages* Montages; + TOptional WeaponDefinition; /** * Current weapon slot (main/pistol/knife/grenade) */ - UPROPERTY(BlueprintReadOnly, meta=(AllowPrivateAccess)) + UPROPERTY(Category=Weapon, BlueprintReadOnly, meta=(AllowPrivateAccess)) EWeaponSlot Slot; /** * Current weapon state (armed/holstered/dropped) */ - UPROPERTY(BlueprintReadOnly, meta=(AllowPrivateAccess)) + UPROPERTY(Category=Weapon, BlueprintReadOnly, meta=(AllowPrivateAccess)) EWeaponState State; /** @@ -210,8 +236,6 @@ class CLOUD9_API ACloud9WeaponBase : public AActor return static_cast(WeaponAction) - 1; } - FORCEINLINE bool IsActionIndexValid(int Index) const; - UCooldownActionComponent* CreateCooldownAction(FName ComponentName); /** diff --git a/Source/Cloud9/Weapon/Classes/Cloud9WeaponFirearm.cpp b/Source/Cloud9/Weapon/Classes/Cloud9WeaponFirearm.cpp index a86832bac..31eca7c54 100644 --- a/Source/Cloud9/Weapon/Classes/Cloud9WeaponFirearm.cpp +++ b/Source/Cloud9/Weapon/Classes/Cloud9WeaponFirearm.cpp @@ -23,16 +23,13 @@ #include "Cloud9WeaponFirearm.h" -#include "DrawDebugHelpers.h" #include "Cloud9/Tools/Extensions/AActor.h" -#include "Cloud9/Tools/Extensions/Range.h" #include "Cloud9/Game/Cloud9DeveloperSettings.h" -#include "Cloud9/Game/Cloud9GameInstance.h" -#include "Cloud9/Character/Cloud9Character.h" #include "Cloud9/Game/Cloud9PlayerController.h" -#include "Cloud9/Tools/Extensions/USoundBase.h" -#include "Cloud9/Weapon/Enums/Cloud9FirearmActions.h" -#include "Cloud9/Weapon/Tables/Cloud9WeaponTableFirearm.h" +#include "Cloud9/Character/Cloud9Character.h" +#include "Cloud9/Tools/Extensions/TOptional.h" +#include "Cloud9/Weapon/Enums/FirearmActions.h" +#include "Cloud9/Weapon/Tables/WeaponTableFirearm.h" const FName ACloud9WeaponFirearm::WeaponMeshComponentName = TEXT("WeaponMeshComponent"); const FName ACloud9WeaponFirearm::MagazineMeshComponentName = TEXT("MagazineMeshComponent"); @@ -43,126 +40,154 @@ const FName ACloud9WeaponFirearm::MuzzleFlashSocketName = TEXT("MuzzleFlashSocke ACloud9WeaponFirearm::ACloud9WeaponFirearm() { - if (WeaponMesh = CreateMesh(WeaponMeshComponentName); not IsValid(WeaponMesh)) + if (WeaponMesh = CreateMeshComponent(WeaponMeshComponentName); not IsValid(WeaponMesh)) { log(Error, "Failed to create WeaponMeshComponent"); return; } - if (MagazineMesh = CreateMesh(MagazineMeshComponentName, MagazineSocketName); not IsValid(MagazineMesh)) + if (MagazineMesh = CreateMeshComponent(MagazineMeshComponentName, MagazineSocketName); not IsValid(MagazineMesh)) { log(Error, "Failed to create MagazineMeshComponent"); return; } - if (MuzzleFlash = CreateEffect(MuzzleFlashComponentName, MuzzleFlashSocketName); not IsValid(MuzzleFlash)) + if (MuzzleFlash = CreateEffectComponent(MuzzleFlashComponentName, MuzzleFlashSocketName); not IsValid(MuzzleFlash)) { log(Error, "Failed to create MuzzleFlashComponent"); return; } } +FName ACloud9WeaponFirearm::GetWeaponName() const { return Name | EUEnum::GetValueName(); } + EWeaponClass ACloud9WeaponFirearm::GetWeaponClass() const { return EWeaponClass::Firearm; } const UEnum* ACloud9WeaponFirearm::GetWeaponActions() const { return StaticEnum(); } +const UStaticMeshSocket* ACloud9WeaponFirearm::GetSocketByName(FName SocketName) const +{ + return WeaponMesh->GetSocketByName(SocketName); +} + +const UStaticMeshComponent* ACloud9WeaponFirearm::GetWeaponMesh() const { return WeaponMesh; } + void ACloud9WeaponFirearm::OnConstruction(const FTransform& Transform) { + using namespace ETOptional; + using namespace EFWeaponInfo; + Super::OnConstruction(Transform); - let MyWeaponInfo = GetWeaponInfo(); - let Skin = MyWeaponInfo | EFWeaponInfo::GetSkinByName(); - WeaponMesh->SetStaticMesh(Skin->Weapon); - MagazineMesh->SetStaticMesh(Skin->Magazine); - MuzzleFlash->SetAsset(MyWeaponInfo->Effects.MuzzleFlash); + + if (not IsWeaponInitialized()) + { + WeaponMesh->SetStaticMesh(nullptr); + MagazineMesh->SetStaticMesh(nullptr); + MuzzleFlash->SetAsset(nullptr); + return; + } + + let MyWeaponInfo = WeaponDefinition->GetWeaponInfo(); + let SkinInfo = MyWeaponInfo + | GetSkinByName(Skin) + | Get([&] + { + log(Error, "[Weapon='%s'] Skin '%s' not found", *GetName(), *Skin.ToString()); + return MyWeaponInfo + | GetSkinByName() + | Get(); + } + ); + + InitializeMeshComponent(WeaponMesh, MyWeaponInfo->WeaponModel, SkinInfo); + InitializeMeshComponent(MagazineMesh, MyWeaponInfo->MagazineModel, SkinInfo); + InitializeEffectComponent(MuzzleFlash, MyWeaponInfo->Effects.MuzzleFlash); } void ACloud9WeaponFirearm::Tick(float DeltaSeconds) { Super::Tick(DeltaSeconds); - static let Settings = UCloud9DeveloperSettings::Get(); + WEAPON_IS_INITIALIZED_GUARD(); + WEAPON_IS_DISARMED_GUARD(); + WEAPON_IS_ACTION_IN_PROGRESS_GUARD(); - if (IsActionInProgress()) - { - return; - } + static let Settings = UCloud9DeveloperSettings::Get(); - let WeaponInfo = GetWeaponInfo(); let Character = GetOwner(); - let AnimInstance = Character->GetMesh()->GetAnimInstance(); - let PoseMontages = Montages->GetPoseMontages(Character->bIsCrouched); + let WeaponInfo = WeaponDefinition->GetWeaponInfo(); + let PoseMontages = WeaponDefinition->GetPoseMontages(Character->bIsCrouched); if (bIsPrimaryActionActive) { - ExecuteAction(EFirearmAction::Fire, WeaponInfo->CycleTime, [&] - { - MuzzleFlash->Activate(true); - - if (not AnimInstance->Montage_Play(PoseMontages->PrimaryActionMontage)) + ExecuteAction( + EFirearmAction::Fire, + WeaponInfo->CycleTime, [&] { - log(Error, "Can't play montage for '%s'", *Info->Label.ToString()) - return false; - } + if (PlayAnimMontage(PoseMontages->PrimaryActionMontage) and + PlayRandomSound(WeaponInfo->Sounds.FireSounds, Settings->Volume)) + { + MuzzleFlash->Activate(true); + return Fire(); + } - if (let FireSound = WeaponInfo->Sounds.FireSounds | ERange::Random()) - { - *FireSound | EUSoundBase::Play(GetActorLocation(), Settings->Volume); - } - - let Controller = Character->GetCloud9Controller(); - - if (not IsValid(Controller)) - { - log(Error, "Can't hit object because player controller isn't valid") return false; } + ); - FHitResult CursorHit; - if (not Controller->GetHitResultUnderCursor(ECC_Visibility, true, CursorHit)) - { - log(Error, "Cursor not hit anything") - return true; - } + if (not WeaponInfo->bIsFullAuto) + { + bIsPrimaryActionActive = false; + } + } + else {} +} - let StartLocation = MuzzleFlash->GetComponentLocation(); - let EndLocation = CursorHit.Location; +bool ACloud9WeaponFirearm::Fire() const +{ + let Character = GetOwner(); - FHitResult LineHit; - FCollisionQueryParams TraceParams(FName(TEXT("LineTraceSingle")), true); + if (not IsValid(Character)) + { + log(Error, "Character is invalid") + return false; + } - let bHit = GetWorld()->LineTraceSingleByChannel( - LineHit, - StartLocation, - EndLocation, - ECC_Visibility, - TraceParams - ); + let Controller = Character->GetCloud9Controller(); - if (not bHit) - { - log(Error, "LineTraceSingleByChannel not hit anything") - return true; - } + if (not IsValid(Controller)) + { + log(Error, "Can't hit object because player controller isn't valid") + return false; + } - let Target = LineHit.Component; + FHitResult CursorHit; + if (not Controller->GetHitResultUnderCursor(ECC_Visibility, true, CursorHit)) + { + log(Error, "Cursor not hit anything") + return true; + } - log(Error, "Target = %s Owner = %s", *Target->GetName(), *Target->GetOwner()->GetName()); + let StartLocation = MuzzleFlash->GetComponentLocation(); + let EndLocation = CursorHit.Location; - if (Target->IsSimulatingPhysics() and Target->Mobility == EComponentMobility::Movable) - { - var Direction = LineHit.Location - StartLocation; - log(Error, "Direction = %s", *Direction.ToString()) - Direction.Normalize(); - Target->AddImpulse(1000.0 * Direction, NAME_None, true); - } + FHitResult LineHit; + if (not GetWorld()->LineTraceSingleByChannel(LineHit, StartLocation, EndLocation, ECC_Visibility)) + { + log(Error, "LineTraceSingleByChannel not hit anything") + return true; + } - return true; - }); + let Target = LineHit.Component; - if (not WeaponInfo->bIsFullAuto) - { - bIsPrimaryActionActive = false; - } + log(Verbose, "Target = %s Owner = %s", *Target->GetName(), *Target->GetOwner()->GetName()); + + if (Target->IsSimulatingPhysics() and Target->Mobility == EComponentMobility::Movable) + { + var Direction = LineHit.Location - StartLocation; + Direction.Normalize(); + Target->AddImpulse(1000.0 * Direction, NAME_None, true); } - else { } + + return true; } diff --git a/Source/Cloud9/Weapon/Classes/Cloud9WeaponFirearm.h b/Source/Cloud9/Weapon/Classes/Cloud9WeaponFirearm.h index 17e550a17..0dfb72de8 100644 --- a/Source/Cloud9/Weapon/Classes/Cloud9WeaponFirearm.h +++ b/Source/Cloud9/Weapon/Classes/Cloud9WeaponFirearm.h @@ -47,14 +47,31 @@ class CLOUD9_API ACloud9WeaponFirearm : public ACloud9WeaponBase ACloud9WeaponFirearm(); + bool OnSpawn(EFirearm WeaponName, FName WeaponSkin = FWeaponSkin::Default) + { + Name = WeaponName; + Skin = WeaponSkin; + return true; + } + + virtual FName GetWeaponName() const override; virtual EWeaponClass GetWeaponClass() const override; virtual const UEnum* GetWeaponActions() const override; + virtual const UStaticMeshSocket* GetSocketByName(FName SocketName) const override; + virtual const UStaticMeshComponent* GetWeaponMesh() const override; protected: virtual void OnConstruction(const FTransform& Transform) override; virtual void Tick(float DeltaSeconds) override; + bool Fire() const; protected: // properties + /** + * Weapon Identifier + */ + UPROPERTY(Category=Weapon, EditDefaultsOnly, meta=(AllowPrivateAccess)) + EFirearm Name; + /** * Weapon mesh */ diff --git a/Source/Cloud9/Weapon/Classes/Cloud9WeaponGrenade.cpp b/Source/Cloud9/Weapon/Classes/Cloud9WeaponGrenade.cpp index c6586d40e..969614fee 100644 --- a/Source/Cloud9/Weapon/Classes/Cloud9WeaponGrenade.cpp +++ b/Source/Cloud9/Weapon/Classes/Cloud9WeaponGrenade.cpp @@ -23,7 +23,8 @@ #include "Cloud9WeaponGrenade.h" -#include "Cloud9/Weapon/Enums/Cloud9GrenadeActions.h" +#include "Cloud9/Weapon/Enums/WeaponClass.h" +#include "Cloud9/Weapon/Enums/GrenadeActions.h" ACloud9WeaponGrenade::ACloud9WeaponGrenade() {} diff --git a/Source/Cloud9/Weapon/Classes/Cloud9WeaponMelee.cpp b/Source/Cloud9/Weapon/Classes/Cloud9WeaponMelee.cpp index f20cac3df..c80ce40f6 100644 --- a/Source/Cloud9/Weapon/Classes/Cloud9WeaponMelee.cpp +++ b/Source/Cloud9/Weapon/Classes/Cloud9WeaponMelee.cpp @@ -24,92 +24,104 @@ #include "Cloud9WeaponMelee.h" #include "Cloud9/Game/Cloud9DeveloperSettings.h" -#include "Cloud9/Game/Cloud9GameInstance.h" #include "Cloud9/Tools/Extensions/Range.h" -#include "Cloud9/Tools/Extensions/USoundBase.h" -#include "Cloud9/Weapon/Enums/Cloud9MeleeActions.h" -#include "Cloud9/Weapon/Tables/Cloud9WeaponTableMelee.h" -#include "Kismet/GameplayStatics.h" +#include "Cloud9/Tools/Extensions/TOptional.h" +#include "Cloud9/Weapon/Enums/MeleeActions.h" +#include "Cloud9/Weapon/Enums/WeaponClass.h" +#include "Cloud9/Weapon/Tables/WeaponTableMelee.h" +#include "Cloud9/Weapon/Structures/WeaponDefinition.h" const FName ACloud9WeaponMelee::WeaponMeshComponentName = TEXT("WeaponMeshComponent"); ACloud9WeaponMelee::ACloud9WeaponMelee() { - if (WeaponMesh = CreateMesh(WeaponMeshComponentName); not IsValid(WeaponMesh)) + if (WeaponMesh = CreateMeshComponent(WeaponMeshComponentName); not IsValid(WeaponMesh)) { log(Error, "Failed to create WeaponMeshComponent"); return; } } +FName ACloud9WeaponMelee::GetWeaponName() const { return Name | EUEnum::GetValueName(); } + EWeaponClass ACloud9WeaponMelee::GetWeaponClass() const { return EWeaponClass::Melee; } const UEnum* ACloud9WeaponMelee::GetWeaponActions() const { return StaticEnum(); } bool ACloud9WeaponMelee::CanBeDropped() const { return false; } -void ACloud9WeaponMelee::Tick(float DeltaSeconds) +const UStaticMeshSocket* ACloud9WeaponMelee::GetSocketByName(FName SocketName) const { - Super::Tick(DeltaSeconds); + return WeaponMesh->GetSocketByName(SocketName); +} - static let Settings = UCloud9DeveloperSettings::Get(); +const UStaticMeshComponent* ACloud9WeaponMelee::GetWeaponMesh() const { return WeaponMesh; } + +void ACloud9WeaponMelee::OnConstruction(const FTransform& Transform) +{ + using namespace ETOptional; + using namespace EFWeaponInfo; + + Super::OnConstruction(Transform); - // Check if any other action in progress on this weapon - if (IsActionInProgress()) + if (not IsWeaponInitialized()) { + WeaponMesh->SetStaticMesh(nullptr); return; } - let WeaponInfo = GetWeaponInfo(); + let MyWeaponInfo = WeaponDefinition->GetWeaponInfo(); + let SkinInfo = MyWeaponInfo + | GetSkinByName(Skin) + | Get([&] + { + log(Error, "[Weapon='%s'] Skin '%s' not found", *GetName(), *Skin.ToString()); + return MyWeaponInfo + | GetSkinByName() + | Get(); + } + ); + + InitializeMeshComponent(WeaponMesh, MyWeaponInfo->WeaponModel, SkinInfo); +} + +void ACloud9WeaponMelee::Tick(float DeltaSeconds) +{ + Super::Tick(DeltaSeconds); + + WEAPON_IS_INITIALIZED_GUARD(); + WEAPON_IS_DISARMED_GUARD(); + WEAPON_IS_ACTION_IN_PROGRESS_GUARD(); + + static let Settings = UCloud9DeveloperSettings::Get(); + let Character = GetOwner(); - let AnimInstance = Character->GetMesh()->GetAnimInstance(); - let PoseMontages = Montages->GetPoseMontages(Character->bIsCrouched); + let WeaponInfo = WeaponDefinition->GetWeaponInfo(); + let PoseMontages = WeaponDefinition->GetPoseMontages(Character->bIsCrouched); if (bIsPrimaryActionActive) { - ExecuteAction(EMeleeAction::Slash, WeaponInfo->SlashCycleTime, [&] - { - if (not AnimInstance->Montage_Play(PoseMontages->PrimaryActionMontage)) + ExecuteAction( + EMeleeAction::Slash, + WeaponInfo->SlashCycleTime, [&] { - log(Error, "Can't play montage for '%s'", *Info->Label.ToString()) - return false; + return PlayAnimMontage(PoseMontages->PrimaryActionMontage) and + PlayRandomSound(WeaponInfo->Sounds.SlashSounds, Settings->Volume); } - - if (let FireSound = WeaponInfo->Sounds.SlashSounds | ERange::Random()) - { - *FireSound | EUSoundBase::Play(GetActorLocation(), Settings->Volume); - } - - return true; - }); + ); } else if (bIsSecondaryActionActive) { - ExecuteAction(EMeleeAction::Slash, WeaponInfo->StabCycleTime, [&] - { - if (not AnimInstance->Montage_Play(PoseMontages->SecondaryActionMontage)) + ExecuteAction( + EMeleeAction::Slash, + WeaponInfo->StabCycleTime, [&] { - log(Error, "Can't play montage for '%s'", *Info->Label.ToString()) - return false; + return PlayAnimMontage(PoseMontages->SecondaryActionMontage) and + PlayRandomSound(WeaponInfo->Sounds.StabSounds, Settings->Volume); } - - if (let FireSound = WeaponInfo->Sounds.StabSounds | ERange::Random()) - { - *FireSound | EUSoundBase::Play(GetActorLocation(), Settings->Volume); - } - - return true; - }); + ); // no auto stab bIsSecondaryActionActive = false; } } - -void ACloud9WeaponMelee::OnConstruction(const FTransform& Transform) -{ - Super::OnConstruction(Transform); - let MyWeaponInfo = GetWeaponInfo(); - let Skin = MyWeaponInfo | EFWeaponInfo::GetSkinByName(); - WeaponMesh->SetStaticMesh(Skin->Weapon); -} diff --git a/Source/Cloud9/Weapon/Classes/Cloud9WeaponMelee.h b/Source/Cloud9/Weapon/Classes/Cloud9WeaponMelee.h index 06a117bd4..abd60b3d6 100644 --- a/Source/Cloud9/Weapon/Classes/Cloud9WeaponMelee.h +++ b/Source/Cloud9/Weapon/Classes/Cloud9WeaponMelee.h @@ -40,15 +40,31 @@ class CLOUD9_API ACloud9WeaponMelee : public ACloud9WeaponBase public: ACloud9WeaponMelee(); + bool OnSpawn(EMelee WeaponName, FName WeaponSkin = FWeaponSkin::Default) + { + Name = WeaponName; + Skin = WeaponSkin; + return true; + } + + virtual FName GetWeaponName() const override; virtual EWeaponClass GetWeaponClass() const override; virtual const UEnum* GetWeaponActions() const override; virtual bool CanBeDropped() const override; + virtual const UStaticMeshSocket* GetSocketByName(FName SocketName) const override; + virtual const UStaticMeshComponent* GetWeaponMesh() const override; protected: virtual void OnConstruction(const FTransform& Transform) override; virtual void Tick(float DeltaSeconds) override; protected: + /** + * Weapon Identifier + */ + UPROPERTY(Category=Weapon, EditDefaultsOnly, meta=(AllowPrivateAccess)) + EMelee Name; + /** * Weapon mesh */ diff --git a/Source/Cloud9/Weapon/Enums/Cloud9FirearmActions.h b/Source/Cloud9/Weapon/Enums/FirearmActions.h similarity index 100% rename from Source/Cloud9/Weapon/Enums/Cloud9FirearmActions.h rename to Source/Cloud9/Weapon/Enums/FirearmActions.h diff --git a/Source/Cloud9/Weapon/Enums/Cloud9FirearmNames.h b/Source/Cloud9/Weapon/Enums/FirearmNames.h similarity index 100% rename from Source/Cloud9/Weapon/Enums/Cloud9FirearmNames.h rename to Source/Cloud9/Weapon/Enums/FirearmNames.h diff --git a/Source/Cloud9/Weapon/Enums/Cloud9GrenadeActions.h b/Source/Cloud9/Weapon/Enums/GrenadeActions.h similarity index 100% rename from Source/Cloud9/Weapon/Enums/Cloud9GrenadeActions.h rename to Source/Cloud9/Weapon/Enums/GrenadeActions.h diff --git a/Source/Cloud9/Weapon/Enums/Cloud9GrenadeNames.h b/Source/Cloud9/Weapon/Enums/GrenadeNames.h similarity index 100% rename from Source/Cloud9/Weapon/Enums/Cloud9GrenadeNames.h rename to Source/Cloud9/Weapon/Enums/GrenadeNames.h diff --git a/Source/Cloud9/Weapon/Enums/Cloud9MeleeActions.h b/Source/Cloud9/Weapon/Enums/MeleeActions.h similarity index 100% rename from Source/Cloud9/Weapon/Enums/Cloud9MeleeActions.h rename to Source/Cloud9/Weapon/Enums/MeleeActions.h diff --git a/Source/Cloud9/Weapon/Enums/Cloud9MeleeNames.h b/Source/Cloud9/Weapon/Enums/MeleeNames.h similarity index 100% rename from Source/Cloud9/Weapon/Enums/Cloud9MeleeNames.h rename to Source/Cloud9/Weapon/Enums/MeleeNames.h diff --git a/Source/Cloud9/Weapon/Enums/Cloud9WeaponClass.h b/Source/Cloud9/Weapon/Enums/WeaponClass.h similarity index 100% rename from Source/Cloud9/Weapon/Enums/Cloud9WeaponClass.h rename to Source/Cloud9/Weapon/Enums/WeaponClass.h diff --git a/Source/Cloud9/Weapon/Enums/Cloud9WeaponSlot.h b/Source/Cloud9/Weapon/Enums/WeaponSlot.h similarity index 95% rename from Source/Cloud9/Weapon/Enums/Cloud9WeaponSlot.h rename to Source/Cloud9/Weapon/Enums/WeaponSlot.h index e8060f30a..b158e3f47 100644 --- a/Source/Cloud9/Weapon/Enums/Cloud9WeaponSlot.h +++ b/Source/Cloud9/Weapon/Enums/WeaponSlot.h @@ -26,7 +26,7 @@ #include "Kismet/BlueprintFunctionLibrary.h" #include "Cloud9/Tools/Extensions/FName.h" #include "Cloud9/Tools/Extensions/UEnum.h" -#include "Cloud9WeaponSlot.generated.h" +#include "WeaponSlot.generated.h" UENUM(BlueprintType) enum class EWeaponSlot : uint8 @@ -44,7 +44,7 @@ enum class EWeaponSlot : uint8 * Function to work with EWeaponType. */ UCLASS() -class CLOUD9_API UCloud9WeaponSlot : public UBlueprintFunctionLibrary +class CLOUD9_API UWeaponSlot : public UBlueprintFunctionLibrary { GENERATED_BODY() diff --git a/Source/Cloud9/Weapon/Enums/Cloud9WeaponState.h b/Source/Cloud9/Weapon/Enums/WeaponState.h similarity index 94% rename from Source/Cloud9/Weapon/Enums/Cloud9WeaponState.h rename to Source/Cloud9/Weapon/Enums/WeaponState.h index dc63a7fd0..e4fc447d7 100644 --- a/Source/Cloud9/Weapon/Enums/Cloud9WeaponState.h +++ b/Source/Cloud9/Weapon/Enums/WeaponState.h @@ -27,7 +27,7 @@ #include "Cloud9/Tools/Extensions/FName.h" #include "Cloud9/Tools/Extensions/UEnum.h" #include "Kismet/BlueprintFunctionLibrary.h" -#include "Cloud9WeaponState.generated.h" +#include "WeaponState.generated.h" UENUM(BlueprintType) enum class EWeaponState : uint8 @@ -42,7 +42,7 @@ enum class EWeaponState : uint8 * Function to work with EWeaponState. */ UCLASS() -class CLOUD9_API UCloud9WeaponState : public UBlueprintFunctionLibrary +class CLOUD9_API UWeaponState : public UBlueprintFunctionLibrary { GENERATED_BODY() diff --git a/Source/Cloud9/Weapon/Enums/Cloud9WeaponType.h b/Source/Cloud9/Weapon/Enums/WeaponType.h similarity index 95% rename from Source/Cloud9/Weapon/Enums/Cloud9WeaponType.h rename to Source/Cloud9/Weapon/Enums/WeaponType.h index d1ddf56b2..3bb62960e 100644 --- a/Source/Cloud9/Weapon/Enums/Cloud9WeaponType.h +++ b/Source/Cloud9/Weapon/Enums/WeaponType.h @@ -24,10 +24,10 @@ #pragma once #include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" #include "Cloud9/Tools/Extensions/FName.h" #include "Cloud9/Tools/Extensions/UEnum.h" -#include "Kismet/BlueprintFunctionLibrary.h" -#include "Cloud9WeaponType.generated.h" +#include "WeaponType.generated.h" UENUM(BlueprintType) enum class EWeaponType : uint8 @@ -52,7 +52,7 @@ enum class EWeaponType : uint8 * Function to work with EWeaponType. */ UCLASS() -class CLOUD9_API UCloud9WeaponType : public UBlueprintFunctionLibrary +class CLOUD9_API UWeaponType : public UBlueprintFunctionLibrary { GENERATED_BODY() diff --git a/Source/Cloud9/Weapon/Structures/WeaponDefinition.h b/Source/Cloud9/Weapon/Structures/WeaponDefinition.h new file mode 100644 index 000000000..022e72491 --- /dev/null +++ b/Source/Cloud9/Weapon/Structures/WeaponDefinition.h @@ -0,0 +1,52 @@ +// Copyright (c) 2023 Alexei Gladkikh +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. + +#pragma once + +#include "Cloud9/Weapon/Tables/WeaponTableBase.h" +#include "Cloud9/Weapon/Tables/WeaponMontages.h" +#include "WeaponDefinition.generated.h" + +USTRUCT() +struct FWeaponDefinition +{ + GENERATED_BODY() + + template + FORCEINLINE TSharedPtr GetWeaponInfo() const + { + return StaticCastSharedPtr(Info); + } + + FORCEINLINE const FWeaponActionMontages* GetPoseMontages(bool bIsCrouch) const + { + return not bIsCrouch ? &Montages->OnStand : &Montages->OnCrouch; + } + + TSharedPtr Info; + + TSharedPtr Montages; + + UPROPERTY() + UParticleSystem* Tracer; +}; diff --git a/Source/Cloud9/Weapon/Tables/WeaponMontages.h b/Source/Cloud9/Weapon/Tables/WeaponMontages.h new file mode 100644 index 000000000..55868b2fa --- /dev/null +++ b/Source/Cloud9/Weapon/Tables/WeaponMontages.h @@ -0,0 +1,53 @@ +// Copyright (c) 2023 Alexei Gladkikh +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. + +#pragma once + +#include "WeaponMontages.generated.h" + +USTRUCT(BlueprintType) +struct FWeaponActionMontages +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Action) + UAnimMontage* PrimaryActionMontage = nullptr; + + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Action) + UAnimMontage* SecondaryActionMontage = nullptr; + + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Reload) + UAnimMontage* ReloadMontage = nullptr; +}; + +USTRUCT(BlueprintType) +struct FWeaponPosesMontages +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly) + FWeaponActionMontages OnStand; + + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly) + FWeaponActionMontages OnCrouch; +}; diff --git a/Source/Cloud9/Weapon/Tables/Cloud9WeaponTableBase.h b/Source/Cloud9/Weapon/Tables/WeaponTableBase.h similarity index 76% rename from Source/Cloud9/Weapon/Tables/Cloud9WeaponTableBase.h rename to Source/Cloud9/Weapon/Tables/WeaponTableBase.h index 2812182c3..182ef9118 100644 --- a/Source/Cloud9/Weapon/Tables/Cloud9WeaponTableBase.h +++ b/Source/Cloud9/Weapon/Tables/WeaponTableBase.h @@ -25,15 +25,17 @@ #include "Engine/DataTable.h" #include "Cloud9/Cloud9.h" -#include "Cloud9/Weapon/Enums/Cloud9WeaponType.h" -#include "Cloud9WeaponTableBase.generated.h" +#include "Cloud9/Weapon/Enums/WeaponType.h" +#include "WeaponTableBase.generated.h" USTRUCT(BlueprintType) -struct FBaseWeaponSkin +struct FWeaponSkin { GENERATED_BODY() inline static const FName Default = TEXT("default"); + inline static const FName OceanDrive = TEXT("ocean_drive"); + inline static const FName Lore = TEXT("lore"); /** * Unique name of skin @@ -52,6 +54,12 @@ struct FBaseWeaponSkin */ UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Base) FText Description; + + /** + * Skin material to be used + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Visual) + UMaterialInstance* Material; }; USTRUCT(BlueprintType) @@ -80,23 +88,27 @@ struct FBaseWeaponInfo : public FTableRowBase namespace EFWeaponInfo { - template - struct GetSkinByName : TOperator> + struct GetSkinByName : TOperator { - explicit GetSkinByName(FName SkinName = FBaseWeaponSkin::Default) : SkinName(SkinName) { } + explicit GetSkinByName(FName SkinName = FWeaponSkin::Default) : SkinName(SkinName) {} template - TOptional operator()(WeaponInfoType Self) const + TOptional operator()(WeaponInfoType Self) const { let Skin = Self->Skins.FindByPredicate([this](let& It) { return It.Name == SkinName; }); - if (not Skin and SkinName == FBaseWeaponSkin::Default) + if (Skin == nullptr) { - log(Fatal, "Can't get default skin"); + if (SkinName == FWeaponSkin::Default) + { + // Crash if have no even default skin + log(Fatal, "Can't get default skin"); + } + return {}; } - return *static_cast(Skin); + return *Skin; } private: diff --git a/Source/Cloud9/Weapon/Tables/Cloud9WeaponTableFirearm.h b/Source/Cloud9/Weapon/Tables/WeaponTableFirearm.h similarity index 97% rename from Source/Cloud9/Weapon/Tables/Cloud9WeaponTableFirearm.h rename to Source/Cloud9/Weapon/Tables/WeaponTableFirearm.h index 47a404242..d50ac09bb 100644 --- a/Source/Cloud9/Weapon/Tables/Cloud9WeaponTableFirearm.h +++ b/Source/Cloud9/Weapon/Tables/WeaponTableFirearm.h @@ -24,9 +24,9 @@ #pragma once #include "NiagaraComponent.h" -#include "Cloud9WeaponTableBase.h" +#include "WeaponTableBase.h" #include "Cloud9/Weapon/Classes/Cloud9WeaponFirearm.h" -#include "Cloud9WeaponTableFirearm.generated.h" +#include "WeaponTableFirearm.generated.h" class ACloud9WeaponFirearm; @@ -86,24 +86,6 @@ struct FFirearmWeaponEffects UNiagaraSystem* MuzzleSmoke = nullptr; }; -USTRUCT(BlueprintType) -struct FFirearmWeaponSkin : public FBaseWeaponSkin -{ - GENERATED_BODY() - - /** - * Base mesh corpus to show - */ - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Visual) - UStaticMesh* Weapon = nullptr; - - /** - * Mesh for dropout magazine on reload - */ - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Visual) - UStaticMesh* Magazine = nullptr; -}; - USTRUCT(BlueprintType) struct FFirearmInaccuracy { @@ -313,11 +295,23 @@ struct FFirearmWeaponInfo : public FBaseWeaponInfo UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=VFX) FFirearmWeaponSounds Sounds; + /** + * Base mesh corpus to show + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Visual) + UStaticMesh* WeaponModel = nullptr; + + /** + * Mesh for dropout magazine on reload + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Visual) + UStaticMesh* MagazineModel = nullptr; + /** * Available skins for weapon and it magazines */ UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=VFX) - TArray Skins; + TArray Skins; /** * Weapon price in buy menu diff --git a/Source/Cloud9/Weapon/Tables/Cloud9WeaponTableGrenade.h b/Source/Cloud9/Weapon/Tables/WeaponTableGrenade.h similarity index 96% rename from Source/Cloud9/Weapon/Tables/Cloud9WeaponTableGrenade.h rename to Source/Cloud9/Weapon/Tables/WeaponTableGrenade.h index e430ff700..fd19c1481 100644 --- a/Source/Cloud9/Weapon/Tables/Cloud9WeaponTableGrenade.h +++ b/Source/Cloud9/Weapon/Tables/WeaponTableGrenade.h @@ -24,9 +24,9 @@ #pragma once #include "NiagaraComponent.h" -#include "Cloud9WeaponTableBase.h" +#include "Cloud9/Weapon/Tables/WeaponTableBase.h" #include "Cloud9/Weapon/Classes/Cloud9WeaponGrenade.h" -#include "Cloud9WeaponTableGrenade.generated.h" +#include "WeaponTableGrenade.generated.h" USTRUCT(BlueprintType) @@ -83,18 +83,6 @@ struct FGrenadeWeaponEffects UNiagaraSystem* Action = nullptr; }; -USTRUCT(BlueprintType) -struct FGrenadeWeaponSkin : public FBaseWeaponSkin -{ - GENERATED_BODY() - - /** - * Base mesh corpus to show - */ - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Visual) - UStaticMesh* Weapon = nullptr; -}; - /** * Grenade weapon description structure. */ @@ -198,11 +186,17 @@ struct FGrenadeWeaponInfo : public FBaseWeaponInfo UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=VFX) FGrenadeWeaponSounds Sounds; + /** + * Base mesh corpus to show + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Visual) + UStaticMesh* WeaponModel = nullptr; + /** * Available skins for weapon and it magazines */ UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=VFX) - TArray Skins; + TArray Skins; /** * Weapon price in buy menu diff --git a/Source/Cloud9/Weapon/Tables/Cloud9WeaponTableMelee.h b/Source/Cloud9/Weapon/Tables/WeaponTableMelee.h similarity index 95% rename from Source/Cloud9/Weapon/Tables/Cloud9WeaponTableMelee.h rename to Source/Cloud9/Weapon/Tables/WeaponTableMelee.h index 0c3fe9916..c0d953d8e 100644 --- a/Source/Cloud9/Weapon/Tables/Cloud9WeaponTableMelee.h +++ b/Source/Cloud9/Weapon/Tables/WeaponTableMelee.h @@ -23,9 +23,8 @@ #pragma once -#include "Cloud9WeaponTableBase.h" #include "Cloud9/Weapon/Classes/Cloud9WeaponMelee.h" -#include "Cloud9WeaponTableMelee.generated.h" +#include "WeaponTableMelee.generated.h" USTRUCT(BlueprintType) struct FMeleeWeaponSounds @@ -63,18 +62,6 @@ struct FMeleeWeaponSounds USoundBase* DeploySound = nullptr; }; -USTRUCT(BlueprintType) -struct FMeleeWeaponSkin : public FBaseWeaponSkin -{ - GENERATED_BODY() - - /** - * Base mesh corpus to show - */ - UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Visual) - UStaticMesh* Weapon = nullptr; -}; - /** * Melee weapon description structure. */ @@ -177,11 +164,17 @@ struct FMeleeWeaponInfo : public FBaseWeaponInfo UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=VFX) FMeleeWeaponSounds Sounds; + /** + * Base mesh corpus to show + */ + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Visual) + UStaticMesh* WeaponModel = nullptr; + /** * Available skins for weapon */ UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=VFX) - TArray Skins; + TArray Skins; /** * Money award for kill enemy with this gun