upload niagara ndc

This commit is contained in:
ouczbs 2025-05-11 22:07:21 +08:00
commit 6ea5c8d975
1317 changed files with 218264 additions and 0 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
.vs
.vscode
Binaries
Intermediate
Content/AdvancedLocomotionV4
Content/AdvancedVillagePack
Content/PlayerBuildingSystem
#Content/Genshin/
Content/Ultimate_Traversal_Anims
Content/Table/*.ini
Content/Script/GameConfig/Table/*
Plugins/**/Binaries
Plugins/**/Intermediate
Saved
*.sln
*.uproject
*.log
*.pyc
*.pb
*.pb.cc
*.pb.h
!Plugins/**/*.pb.cc
!Plugins/**/*.pb.h
/**/.ipynb_checkpoints

13
.idea/.idea.zworld/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,13 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# Rider 忽略的文件
/projectSettingsUpdater.xml
/modules.xml
/contentModel.xml
/.idea.zworld.iml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

13
.vsconfig Normal file
View File

@ -0,0 +1,13 @@
{
"version": "1.0",
"components": [
"Microsoft.Net.Component.4.6.2.TargetingPack",
"Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Windows10SDK.22621",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NativeDesktop",
"Microsoft.VisualStudio.Workload.NativeGame"
]
}

0
Config/DefaultEditor.ini Normal file
View File

94
Config/DefaultEngine.ini Normal file
View File

@ -0,0 +1,94 @@
[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/Maps/Main.Main
EditorStartupMap=/Game/Maps/Main.Main
GameInstanceClass=/Script/zworld.MMOGameInstance
GlobalDefaultGameMode=/Game/BP/MMOGameMode.MMOGameMode_C
[/Script/WindowsTargetPlatform.WindowsTargetSettings]
DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
-D3D12TargetedShaderFormats=PCD3D_SM5
+D3D12TargetedShaderFormats=PCD3D_SM6
-D3D11TargetedShaderFormats=PCD3D_SM5
+D3D11TargetedShaderFormats=PCD3D_SM5
Compiler=Default
AudioSampleRate=48000
AudioCallbackBufferFrameSize=1024
AudioNumBuffersToEnqueue=1
AudioMaxChannels=0
AudioNumSourceWorkers=4
SpatializationPlugin=
SourceDataOverridePlugin=
ReverbPlugin=
OcclusionPlugin=
CompressionOverrides=(bOverrideCompressionTimes=False,DurationThreshold=5.000000,MaxNumRandomBranches=0,SoundCueQualityIndex=0)
CacheSizeKB=65536
MaxChunkSizeOverrideKB=0
bResampleForDevice=False
MaxSampleRate=48000.000000
HighSampleRate=32000.000000
MedSampleRate=24000.000000
LowSampleRate=12000.000000
MinSampleRate=8000.000000
CompressionQualityModifier=1.000000
AutoStreamingThreshold=0.000000
SoundCueCookQualityIndex=-1
[/Script/Engine.RendererSettings]
r.Mobile.EnableNoPrecomputedLightingCSMShader=True
r.GenerateMeshDistanceFields=True
r.DynamicGlobalIlluminationMethod=1
r.ReflectionMethod=1
r.Shadow.Virtual.Enable=1
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
r.DefaultFeature.LocalExposure.HighlightContrastScale=0.8
r.DefaultFeature.LocalExposure.ShadowContrastScale=0.8
[/Script/LinuxTargetPlatform.LinuxTargetSettings]
-TargetedRHIs=SF_VULKAN_SM5
+TargetedRHIs=SF_VULKAN_SM6
[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
AppliedTargetedHardwareClass=Desktop
DefaultGraphicsPerformance=Maximum
AppliedDefaultGraphicsPerformance=Maximum
[/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet'
[/Script/Engine.UserInterfaceSettings]
bAuthorizeAutomaticWidgetVariableCreation=False
FontDPIPreset=Standard
FontDPI=72
[/Script/Engine.Engine]
+ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/zworld")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/zworld")
[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]
bEnablePlugin=True
bAllowNetworkConnection=True
SecurityToken=8F8E9C6F4397E48988F07DAA827FE28B
bIncludeInShipping=False
bAllowExternalStartInShipping=False
bCompileAFSProject=False
bUseCompression=False
bLogFiles=False
bReportStats=False
ConnectionType=USBOnly
bUseManualIPAddress=False
ManualIPAddress=
[CoreRedirects]
+ClassRedirects=(OldName="/Script/zworld.UNameRegisterLibrary",NewName="/Script/zworld.NameRegisterLibrary")

101
Config/DefaultGame.ini Normal file
View File

@ -0,0 +1,101 @@
[/Script/EngineSettings.GeneralProjectSettings]
ProjectID=F4B5A2B148FA9DE40CF314AB97C62F4E
[/Script/UnrealEd.ProjectPackagingSettings]
Build=IfProjectHasCode
BuildConfiguration=PPBC_Development
BuildTarget=
FullRebuild=False
ForDistribution=False
IncludeDebugFiles=False
BlueprintNativizationMethod=Disabled
bIncludeNativizedAssetsInProjectGeneration=False
bExcludeMonolithicEngineHeadersInNativizedCode=False
UsePakFile=True
bUseIoStore=True
bUseZenStore=False
bMakeBinaryConfig=False
bGenerateChunks=False
bGenerateNoChunks=False
bChunkHardReferencesOnly=False
bForceOneChunkPerFile=False
MaxChunkSize=0
bBuildHttpChunkInstallData=False
HttpChunkInstallDataDirectory=(Path="")
WriteBackMetadataToAssetRegistry=Disabled
bWritePluginSizeSummaryJsons=False
bCompressed=True
PackageCompressionFormat=Oodle
bForceUseProjectCompressionFormatIgnoreHardwareOverride=False
PackageAdditionalCompressionOptions=
PackageCompressionMethod=Kraken
PackageCompressionLevel_DebugDevelopment=4
PackageCompressionLevel_TestShipping=4
PackageCompressionLevel_Distribution=7
PackageCompressionMinBytesSaved=1024
PackageCompressionMinPercentSaved=5
bPackageCompressionEnableDDC=False
PackageCompressionMinSizeToConsiderDDC=0
HttpChunkInstallDataVersion=
IncludePrerequisites=True
IncludeAppLocalPrerequisites=False
bShareMaterialShaderCode=True
bDeterministicShaderCodeOrder=False
bSharedMaterialNativeLibraries=True
ApplocalPrerequisitesDirectory=(Path="")
IncludeCrashReporter=False
InternationalizationPreset=English
-CulturesToStage=en
+CulturesToStage=en
LocalizationTargetCatchAllChunkId=0
bCookAll=False
bCookMapsOnly=False
bSkipEditorContent=False
bSkipMovies=False
-IniKeyDenylist=KeyStorePassword
-IniKeyDenylist=KeyPassword
-IniKeyDenylist=rsa.privateexp
-IniKeyDenylist=rsa.modulus
-IniKeyDenylist=rsa.publicexp
-IniKeyDenylist=aes.key
-IniKeyDenylist=SigningPublicExponent
-IniKeyDenylist=SigningModulus
-IniKeyDenylist=SigningPrivateExponent
-IniKeyDenylist=EncryptionKey
-IniKeyDenylist=DevCenterUsername
-IniKeyDenylist=DevCenterPassword
-IniKeyDenylist=IOSTeamID
-IniKeyDenylist=SigningCertificate
-IniKeyDenylist=MobileProvision
-IniKeyDenylist=IniKeyDenylist
-IniKeyDenylist=IniSectionDenylist
+IniKeyDenylist=KeyStorePassword
+IniKeyDenylist=KeyPassword
+IniKeyDenylist=rsa.privateexp
+IniKeyDenylist=rsa.modulus
+IniKeyDenylist=rsa.publicexp
+IniKeyDenylist=aes.key
+IniKeyDenylist=SigningPublicExponent
+IniKeyDenylist=SigningModulus
+IniKeyDenylist=SigningPrivateExponent
+IniKeyDenylist=EncryptionKey
+IniKeyDenylist=DevCenterUsername
+IniKeyDenylist=DevCenterPassword
+IniKeyDenylist=IOSTeamID
+IniKeyDenylist=SigningCertificate
+IniKeyDenylist=MobileProvision
+IniKeyDenylist=IniKeyDenylist
+IniKeyDenylist=IniSectionDenylist
-IniSectionDenylist=HordeStorageServers
-IniSectionDenylist=StorageServers
+IniSectionDenylist=HordeStorageServers
+IniSectionDenylist=StorageServers
+DirectoriesToAlwaysStageAsUFS=(Path="Script")
+DirectoriesToAlwaysStageAsUFS=(Path="../Plugins/UnLua/Content/Script")
+DirectoriesToAlwaysStageAsUFS=(Path="../Plugins/UnLuaExtensions/LuaProtobuf/Content/Script")
+DirectoriesToAlwaysStageAsUFS=(Path="../Plugins/UnLuaExtensions/LuaSocket/Content/Script")
bRetainStagedDirectory=False
CustomStageCopyHandler=

87
Config/DefaultInput.ini Normal file
View File

@ -0,0 +1,87 @@
[/Script/Engine.InputSettings]
-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
-AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
+AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
bAltEnterTogglesFullscreen=True
bF11TogglesFullscreen=True
bUseMouseForTouch=False
bEnableMouseSmoothing=True
bEnableFOVScaling=True
bCaptureMouseOnLaunch=True
bEnableLegacyInputScales=True
bEnableMotionControls=True
bFilterInputByPlatformUser=False
bEnableInputDeviceSubsystem=True
bShouldFlushPressedKeysOnViewportFocusLost=True
bEnableDynamicComponentInputBinding=True
bAlwaysShowTouchInterface=False
bShowConsoleOnFourFingerTap=True
bEnableGestureRecognizer=False
bUseAutocorrect=False
DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown
DefaultViewportMouseLockMode=LockOnCapture
FOVScale=0.011110
DoubleClickTime=0.200000
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks
-ConsoleKeys=Tilde
+ConsoleKeys=Tilde
+ConsoleKeys=Caret

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Main.umap Normal file

Binary file not shown.

Binary file not shown.

BIN
Content/Maps/Main.umap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,44 @@
--
-- DESCRIPTION
--
-- @COMPANY **
-- @AUTHOR **
-- @DATE ${date} ${time}
--
require "UnLua"
---@type NiagaraActor_C
local M = UnLua.Class()
-- function M:Initialize(Initializer)
-- end
-- function M:UserConstructionScript()
-- end
local BindKey = UnLua.Input.BindKey
BindKey(M, "Q", "Pressed", function(self, Key)
self:CreateNiagara(3)
-- local FVector = UE.FVector
-- local Pos = self:K2_GetActorLocation()
-- print("ouczbs",Pos.x, Pos.y, Pos.z)
-- local NDCWriter = self:CreateNiagara(3)
-- print("ouczbs ", NDCWriter,Pos.x, Pos.y, Pos.z)
-- NDCWriter:WriteVector("Position", 0, FVector(Pos.x + 10,Pos.y + 10, Pos.z))
-- NDCWriter:WriteVector("Position", 1, FVector(Pos.x + 20,Pos.y + 10, Pos.z))
-- NDCWriter:WriteVector("Position", 2, FVector(Pos.x + 30,Pos.y + 10, Pos.z))
end)
-- function M:ReceiveEndPlay()
-- end
-- function M:ReceiveTick(DeltaSeconds)
-- end
-- function M:ReceiveAnyDamage(Damage, DamageType, InstigatedBy, DamageCauser)
-- end
-- function M:ReceiveActorBeginOverlap(OtherActor)
-- end
-- function M:ReceiveActorEndOverlap(OtherActor)
-- end
return M

View File

@ -0,0 +1,35 @@
--
-- DESCRIPTION
--
-- @COMPANY **
-- @AUTHOR **
-- @DATE ${date} ${time}
--
require "UnLua"
---@type NiagaraActor_C
local M = UnLua.Class()
-- function M:Initialize(Initializer)
-- end
-- function M:UserConstructionScript()
-- end
function M:ReceiveBeginPlay()
end
-- function M:ReceiveEndPlay()
-- end
-- function M:ReceiveTick(DeltaSeconds)
-- end
-- function M:ReceiveAnyDamage(Damage, DamageType, InstigatedBy, DamageCauser)
-- end
-- function M:ReceiveActorBeginOverlap(OtherActor)
-- end
-- function M:ReceiveActorEndOverlap(OtherActor)
-- end
return M

View File

@ -0,0 +1,3 @@
require "Core.Functions"
require "Core.DataMgr"

View File

@ -0,0 +1,146 @@
local DataMgr = setmetatable({},{
__index = function(t, key)
return require("Datas."..key)
end})
function DataMgr.Print_t ( t )
-- print table
local print_r_cache={}
local function sub_print_r(t,indent)
if (print_r_cache[tostring(t)]) then
print(indent.."*"..tostring(t))
else
print_r_cache[tostring(t)]=true
if (type(t)=="table") then
for pos,val in pairs(t) do
if (type(val)=="table") then
print(indent.."["..pos.."] => "..tostring(t).." {")
sub_print_r(val,indent..string.rep(" ",string.len(pos)+8))
print(indent..string.rep(" ",string.len(pos)+6).."}")
elseif (type(val)=="string") then
print(indent.."["..pos..'] => "'..val..'"')
else
print(indent.."["..pos.."] => "..tostring(val))
end
end
else
print(indent..tostring(t))
end
end
end
if (type(t)=="table") then
print(tostring(t).." {")
sub_print_r(t," ")
print("}")
else
sub_print_r(t," ")
end
print()
end
function DataMgr.GetData(filename)
local pro_path = UE4.UKismetSystemLibrary.GetProjectContentDirectory()
local file = io.open(pro_path..'../Datas/'..filename .. '.json', "r")
local info = file:read("*a")
file:close()
local json= require("rapidjson")
local res = json.decode(info)
return res
end
function DataMgr.GetLevelLoaderJsonData(shortname)
local pro_path = UE4.UKismetSystemLibrary.GetProjectContentDirectory()
local path=pro_path..'Script/Datas/Houdini_data/'..shortname .. '.json'
local info = UE4.URuntimeCommonFunctionLibrary.LoadFile(path)
-- local file = io.open(path, "r")
-- local info = file:read("*a")
-- file:close()
local json= require("rapidjson")
local res = json.decode(info)
return res
end
-- 预加载数据表将所有的数据表全部加载到内存中减少之后读表index的时间消耗
function DataMgr.PreLoad()
local DataNames = require("Datas.DataNames")
for _, DataName in pairs(DataNames) do
require("Datas."..DataName)
end
end
local all_tables = {}
function DataMgr.CollectTable(Table)
for k, tbl in pairs(all_tables) do
if tbl == Table then
all_tables[k] = nil
for k, v in pairs(tbl) do
if type(v) == "table" then
DataMgr.CollectTable(v)
end
end
break
end
end
end
DataMgr.ReadOnly_NewIndex = function(t, k, v)
local rawset = rawset
local getmetatable = getmetatable
error("没法对导表数据【" .. tostring(t.__name) .."】中字段【" .. tostring(k) .. "】进行写操作")
end
function DataMgr.CleanAllTable()
all_tables = {}
local DataNames = require("Datas.DataNames")
local HotFix = require("HotFix")
local data_module_table = rawget(HotFix, "data_module_table")
for _, DataName in pairs(DataNames) do
if not (data_module_table and data_module_table[DataName]) then
require("UnLuaHotReload").RemoveLoadedModule("Datas."..DataName)
end
end
end
function read_only(name, tbl)
if not all_tables[tbl] then
local tbl_mt = getmetatable(tbl)
if not tbl_mt then
tbl_mt = {}
setmetatable(tbl, tbl_mt)
end
local proxy = tbl_mt.__read_only_proxy
if not proxy then
proxy = {__name = name}
tbl_mt.__read_only_proxy = proxy
local proxy_mt = {
__index = tbl,
__newindex = DataMgr.ReadOnly_NewIndex,
__pairs = function (t) return pairs(tbl) end,
-- __ipairs = function (t) return ipairs(tbl) end, 5.3版本不需要此方法
__len = function (t) return #tbl end,
__read_only_proxy = proxy
}
setmetatable(proxy, proxy_mt)
end
all_tables[tbl] = proxy
for k, v in pairs(tbl) do
if type(v) == "table" then
tbl[k] = read_only(name, v)
end
end
end
return all_tables[tbl]
end
--if URuntimeCommonFunctionLibrary.IsDebugDataTable() then
if true then
DataMgr.ReadOnly = read_only
else
DataMgr.ReadOnly = function (name, tbl)
return tbl
end
end
_G.DataMgr = DataMgr
return DataMgr

View File

@ -0,0 +1,541 @@
--[[
Copyright (c) 2011-2014 chukong-inc.com
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.
]]
local function dump_value_(v)
if type(v) == "string" then
v = "\"" .. v .. "\""
end
return tostring(v)
end
function dump(value, desciption, nesting)
if type(nesting) ~= "number" then nesting = 3 end
local lookupTable = {}
local result = {}
local traceback = string.split(debug.traceback("", 2), "\n")
print("dump from: " .. string.trim(traceback[3]))
local function dump_(value, desciption, indent, nest, keylen)
desciption = desciption or "<var>"
local spc = ""
if type(keylen) == "number" then
spc = string.rep(" ", keylen - string.len(dump_value_(desciption)))
end
if type(value) ~= "table" then
result[#result +1 ] = string.format("%s%s%s = %s", indent, dump_value_(desciption), spc, dump_value_(value))
elseif lookupTable[tostring(value)] then
result[#result +1 ] = string.format("%s%s%s = *REF*", indent, dump_value_(desciption), spc)
else
lookupTable[tostring(value)] = true
if nest > nesting then
result[#result +1 ] = string.format("%s%s = *MAX NESTING*", indent, dump_value_(desciption))
else
result[#result +1 ] = string.format("%s%s = {", indent, dump_value_(desciption))
local indent2 = indent.." "
local keys = {}
local keylen = 0
local values = {}
for k, v in pairs(value) do
keys[#keys + 1] = k
local vk = dump_value_(k)
local vkl = string.len(vk)
if vkl > keylen then keylen = vkl end
values[k] = v
end
table.sort(keys, function(a, b)
if type(a) == "number" and type(b) == "number" then
return a < b
else
return tostring(a) < tostring(b)
end
end)
for i, k in ipairs(keys) do
dump_(values[k], k, indent2, nest + 1, keylen)
end
result[#result +1] = string.format("%s}", indent)
end
end
end
dump_(value, desciption, "- ", 1)
for i, line in ipairs(result) do
print(line)
end
end
function checknumber(value, base)
return tonumber(value, base) or 0
end
function checkint(value)
return math.round(checknumber(value))
end
function checkbool(value)
return (value ~= nil and value ~= false)
end
function checktable(value)
if type(value) ~= "table" then value = {} end
return value
end
function isset(hashtable, key)
local t = type(hashtable)
return (t == "table" or t == "userdata") and hashtable[key] ~= nil
end
local setmetatableindex_
setmetatableindex_ = function(t, index)
if type(t) == "userdata" then
--@TODO: no tolua here
--[[
local peer = tolua.getpeer(t)
if not peer then
peer = {}
tolua.setpeer(t, peer)
end
setmetatableindex_(peer, index)
]]
else
local mt = getmetatable(t)
if not mt then mt = {} end
if not mt.__index then
mt.__index = index
setmetatable(t, mt)
elseif mt.__index ~= index then
setmetatableindex_(mt, index)
end
end
end
setmetatableindex = setmetatableindex_
function clone(object,shallow)
local lookup_table = {}
local function _copy(object)
if type(object) ~= "table" then
return object
elseif lookup_table[object] then
return lookup_table[object]
end
local new_table = {}
lookup_table[object] = new_table
for key, value in pairs(object) do
new_table[_copy(key)] = _copy(value)
end
if shallow then
return new_table
else
return setmetatable(new_table, getmetatable(object))
end
end
return _copy(object)
end
local classTb,hotswap = {},true
local function _unpack(t,i)
i = i or 1
if i <= #t then
return t[i],_unpack(t,i+1)
end
end
local function _pack(...)
local n = select('#', ...)
local t = {}
for i = 1, n do
t[i] = select(i, ...)
end
return t
end
local function class(module, classname, super)
if classname == nil and super == nil then
module , classname = nil , module
end
local superType = type(super)
local class
if superType ~= "function" and superType ~= "table" then
superType = nil
super = nil
end
if superType == "function" or (super and super.__ctype == 1) then
-- inherited from native C++ Object
class = {}
if superType == "table" then
-- copy fields from super
for k,v in pairs(super) do class[k] = v end
class.__create = super.__create
class.super = super
else
class.__create = super
end
class.ctor = function() end
class.__cname = classname
class.__ctype = 1
function class.new(...)
local instance = class.__create(...)
-- copy fields from class to native object
for k,v in pairs(class) do instance[k] = v end
instance.class = class
instance:ctor(...)
return instance
end
else
-- inherited from Lua Object
if super then
-- class = clone(super)
class = setmetatable({}, {__index = super})
class.super = super
else
class = {ctor = function() end}
end
class.__cname = classname
class.__ctype = 2 -- lua
class.__index = class
function class.new(...)
local instance = setmetatable({}, class)
-- local instance = clone(class)
-- instance = setmetatable(instance, instance.super)
instance.class = class
instance:ctor(...)
return instance
end
end
if module ~= nil then
module[classname] = class
end
return class
end
function isKindofClass(obj, class)
local t = type(obj)
if t ~= "table" then return false end
local mt = obj.class
while mt do
if mt == class then
return true
else
mt = mt.super
end
end
return false
end
function class_new(classname, ...)
local class = {__cname = classname}
local supers = {...}
for _, super in ipairs(supers) do
local superType = type(super)
assert(superType == "nil" or superType == "table" or superType == "function",
string.format("class() - create class \"%s\" with invalid super class type \"%s\"",
classname, superType))
if superType == "function" then
assert(class.__create == nil,
string.format("class() - create class \"%s\" with more than one creating function",
classname));
-- if super is function, set it to __create
class.__create = super
elseif superType == "table" then
if super[".isclass"] then
-- super is native class
assert(class.__create == nil,
string.format("class() - create class \"%s\" with more than one creating function or native class",
classname));
class.__create = function() return super:create() end
else
-- super is pure lua class
class.__supers = class.__supers or {}
class.__supers[#class.__supers + 1] = super
if not class.super then
-- set first super pure lua class as class.super
class.super = super
end
end
else
error(string.format("class() - create class \"%s\" with invalid super type",
classname), 0)
end
end
class.__index = class
if not class.__supers or #class.__supers == 1 then
setmetatable(class, {__index = class.super})
else
setmetatable(class, {__index = function(_, key)
local supers = class.__supers
for i = 1, #supers do
local super = supers[i]
if super[key] then return super[key] end
end
end})
end
if not class.ctor then
-- add default constructor
class.ctor = function() end
end
class.new = function(...)
local instance
if class.__create then
instance = class.__create(...)
else
instance = {}
end
setmetatableindex(instance, class)
instance.class = class
instance:ctor(...)
return instance
end
class.create = function(_, ...)
return class.new(...)
end
return class
end
local iskindof_
iskindof_ = function(class, name)
local __index = rawget(class, "__index")
if type(__index) == "table" and rawget(__index, "__cname") == name then return true end
if rawget(class, "__cname") == name then return true end
local __supers = rawget(class, "__supers")
if not __supers then return false end
for _, super in ipairs(__supers) do
if iskindof_(super, name) then return true end
end
return false
end
function iskindof(obj, classname)
local t = type(obj)
if t ~= "table" and t ~= "userdata" then return false end
local mt
if t == "userdata" then
-- TODO: reg a typeof method from slua
--[[
if tolua.iskindof(obj, classname) then return true end
mt = tolua.getpeer(obj)
]]
else
mt = getmetatable(obj)
end
if mt then
return iskindof_(mt, classname)
end
return false
end
function handler(obj, method)
return function(...)
return method(obj, ...)
end
end
function io.exists(path)
local file = io.open(path, "r")
if file then
io.close(file)
return true
end
return false
end
function io.readfile(path)
local file = io.open(path, "r")
if file then
local content = file:read("*a")
io.close(file)
return content
end
return nil
end
function io.writefile(path, content, mode)
mode = mode or "w+b"
local file = io.open(path, mode)
if file then
if file:write(content) == nil then return false end
io.close(file)
return true
else
return false
end
end
function io.pathinfo(path)
local pos = string.len(path)
local extpos = pos + 1
while pos > 0 do
local b = string.byte(path, pos)
if b == 46 then -- 46 = char "."
extpos = pos
elseif b == 47 then -- 47 = char "/"
break
end
pos = pos - 1
end
local dirname = string.sub(path, 1, pos)
local filename = string.sub(path, pos + 1)
extpos = extpos - pos
local basename = string.sub(filename, 1, extpos - 1)
local extname = string.sub(filename, extpos)
return {
dirname = dirname,
filename = filename,
basename = basename,
extname = extname
}
end
function io.filesize(path)
local size = false
local file = io.open(path, "r")
if file then
local current = file:seek()
size = file:seek("end")
file:seek("set", current)
io.close(file)
end
return size
end
-- @Nullptr and null UObject.
function isValid(_object)
if _object then
--@strange that this method often causes an exception when using PreviewLine.
--local kismet = LoadClass("KismetSystemLibrary")
--return kismet:IsValid(_object)
return true
else
return false
end
end
local unpack = table.unpack
function toDelegate(func, ...)
local args = {...}
local function callback(...)
if select('#', ...) == 0 then
func(unpack(args))
else
local len = #args
if len == 0 then
func(...)
elseif len == 1 then
func(args[1], ...)
else
local new_args = {}
for i,v in pairs(args) do
table.insert(new_args,v)
end
for i,v in pairs({...}) do
table.insert(new_args,v)
end
func(unpack(new_args))
end
end
end
return callback
end
--------------------------------------------------------------------------------
-- 序列化为字符串 ...
--------------------------------------------------------------------------------
function serialize(obj)
local lua = ""
local t = type(obj)
if t == "number" then
lua = lua .. obj
elseif t == "boolean" then
lua = lua .. tostring(obj)
elseif t == "string" then
lua = lua .. string.format("%q", obj)
elseif t == "table" then
lua = lua .. "{\n"
for k, v in pairs(obj) do
lua = lua .. "[" .. serialize(k) .. "]=" .. serialize(v) .. ",\n"
end
local metatable = getmetatable(obj)
if metatable ~= nil and type(metatable.__index) == "table" then
for k, v in pairs(metatable.__index) do
lua = lua .. "[" .. serialize(k) .. "]=" .. serialize(v) .. ",\n"
end
end
lua = lua .. "}"
elseif t == "nil" then
return nil
else
error("can not serialize a " .. t .. " type.")
end
return lua
end
--------------------------------------------------------------------------------
-- 从字符串反序列化 ...
--------------------------------------------------------------------------------
function unserialize(lua)
local t = type(lua)
if t == "nil" or lua == "" then
return nil
elseif t == "number" or t == "string" or t == "boolean" then
lua = tostring(lua)
else
error("can not unserialize a " .. t .. " type.")
end
lua = "return " .. lua
-- 5.3 replaced loadstring with load
local func = load(lua)
if func == nil then
return nil
end
return func()
end
-- @Note: this is only a simplicity to avoid writing if-else, while
-- taking no responsibility to call a interrupt and return to parent stack.
-- The reason lua assert is not recommanded to use is that it has a chance leading
-- to memory leak in our project.
function check(condition, msg)
if not condition then
logE(msg)
end
end
_G.class = class

View File

@ -0,0 +1,17 @@
require "UnLuaDefine"
require "Core.Core_Module"
function logE(...)
UnLua.LogError("ouczbs", ...)
end
local GA = {
initManagerList = {}
}
_G.GA = GA
function GA:AddInitManager(name, UManager)
self.initManagerList[name] = UManager
end
function GA.CreateGlobalVar()
_print = print
print = logE
gWorld = GA.World.new()
end

3606
Content/Script/LuaPanda.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
--
-- DESCRIPTION
--
-- @COMPANY **
-- @AUTHOR **
-- @DATE ${date} ${time}
--
require "World"
---@type BP_MMOGameInstance_C
local class = UnLua.Class()
function class:OverrideInitGame()
print("OverrideInitGame")
GA.CreateGlobalVar()
-- GA.Config.TestBP = pbc.DecodeConfig("BPConfig")
-- 创建各种message
local WorldContext = self:GetWorld()
gWorld:InitializeWorld(WorldContext)
end
function class:OverrideWorldChanged(_ , NewWorld)
if gWorld then
gWorld:ReInitializeWorld(NewWorld)
end
end
function class:ReceiveBeginPlay()
print("BP_MMOGameInstance_C ReceiveBeginPlay")
if gWorld then
gWorld:beginPlay()
end
end
function class:ReceiveTick(dt)
if gWorld then
gWorld:tick(dt)
gWorld:lateTick(dt)
end
end
return class

View File

@ -0,0 +1,66 @@
local rawget = _G.rawget
local rawset = _G.rawset
local rawequal = _G.rawequal
local type = _G.type
local getmetatable = _G.getmetatable
local require = _G.require
local GetUProperty = GetUProperty
local SetUProperty = SetUProperty
local NotExist = {}
local function Index(t, k)
local mt = getmetatable(t)
local super = mt
while super do
local v = rawget(super, k)
if v ~= nil and not rawequal(v, NotExist) then
rawset(t, k, v)
return v
end
super = rawget(super, "Super")
end
local p = mt[k]
if p ~= nil then
if type(p) == "userdata" then
return GetUProperty(t, p)
elseif type(p) == "function" then
rawset(t, k, p)
elseif rawequal(p, NotExist) then
return nil
end
else
rawset(mt, k, NotExist)
end
return p
end
local function NewIndex(t, k, v)
local mt = getmetatable(t)
local p = mt[k]
if type(p) == "userdata" then
return SetUProperty(t, p, v)
end
rawset(t, k, v)
end
local function Class(super)
local new_class = {}
local super_class = nil
if type(super) == "table" then --lua class
for k,v in pairs(super) do
new_class[k] = v
end
elseif super ~= nil then -- c++ class
super_class = require(super)
end
new_class.__index = Index
new_class.__newindex = NewIndex
new_class.Super = super_class
return new_class
end
_G.import = import
UnLua.Class = Class

85
Content/Script/World.lua Normal file
View File

@ -0,0 +1,85 @@
local WITH_LUAIDE_DEBUG = true
print("import World.lua")
if WITH_LUAIDE_DEBUG then
require "socket.core"
require("LuaPanda").start("127.0.0.1", 8818)
end
require "GameGlobal"
local class = class(GA, "World")
function class:ctor()
self._uWorldContext = nil
self._registerManager = {}
end
function class:registerLuaManager(key, luaclass)
if self[key] then
return
end
local manager = luaclass.new()
manager:init()
self[key] = manager
table.insert(self._registerManager, manager)
end
function class:registerUManager(key, uclass, script)
local manager = self:spawnLuaActor(uclass, script, UE.FVector(0.0, 0.0, 0.0), UE.FRotator(0, 0, 0))
manager:init()
self[key] = manager
table.insert(self._registerManager, manager)
end
function class:CreateSubSystem()
end
function class:ReInitializeWorld(WorldContext)
self._uWorldContext = WorldContext
end
function class:InitializeWorld(WorldContext)
self:CreateSubSystem()
self._uWorldContext = WorldContext
for key, luaclass in pairs(GA.initManagerList) do
self:registerLuaManager(key, luaclass)
end
GA.initManagerList = nil
end
function class:getWorldContext()
return self._uWorldContext
end
function class:getWorldObject()
return self._uWorldContext
end
function class:getMainController()
return UE.UGameplayStatics.GetPlayerController(self._uWorldContext, 0)
end
function class:getMainPlayer()
return UE.UGameplayStatics.GetPlayerPawn(self._uWorldContext, 0)
end
function class:beginPlay()
print("world beginPlay " , self._uWorldContext:GetName())
end
function class:tick(dt)
for _, manager in pairs(self._registerManager) do
if manager.tick then
manager:tick(dt)
end
end
end
function class:lateTick(dt)
for _, manager in pairs(self._registerManager) do
if manager.lateTick then
manager:lateTick(dt)
end
end
end
function class:spawnActor(uclass, uLocation, uRotation, params)
local transform = UE.FTransform(uRotation:ToQuat(), uLocation)
return self._uWorldContext:SpawnActor(uclass, transform, params and params.collisionHandle or
UE.ESpawnActorCollisionHandlingMethod.AlwaysSpawn)
end
function class:spawnLuaActor(uclass, script, uLocation, uRotation, params)
local transform = UE.FTransform(uRotation:ToQuat(), uLocation)
return self._uWorldContext:SpawnActor(uclass, transform, params and params.collisionHandle or
UE.ESpawnActorCollisionHandlingMethod.AlwaysSpawn, self, self, script)
end
return class

Some files were not shown because too many files have changed in this diff Show More