-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.lua
More file actions
executable file
·77 lines (62 loc) · 2.44 KB
/
main.lua
File metadata and controls
executable file
·77 lines (62 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
local UEHelpers = require("UEHelpers")
RegisterKeyBind(Key.F1, {}, function()
local main_menu = FindFirstOf("UMG_MainMenu_C")
if main_menu then
local visibility = main_menu:GetVisibility()
main_menu:SetVisibility(visibility ~= 1 and 1)
end
local inst = FindFirstOf("CACA_BigScreen_B12Flat_C")
inst.UI_Screen.Text = ""
inst.UI_Screen.WritingText = ""
local camera = UEHelpers:GetPlayerController().PlayerCameraManager
local cam_loc = camera:GetCameraLocation()
local cam_rot = camera:GetCameraRotation()
local fov = camera:GetFOVAngle()
print(string.format(
"Camera at (%.3f, %.3f, %.3f), rot (%.3f, %.3f, %.3f), FOV %.3f\n",
cam_loc.X, cam_loc.Y, cam_loc.Z,
cam_rot.Pitch, cam_rot.Yaw, cam_rot.Roll,
fov
))
local origin = {X=0.0, Y=0.0, Z=0.0}
local extent = {X=0.0, Y=0.0, Z=0.0}
inst:GetActorBounds(false, origin, extent, true)
local rotation = inst:K2_GetActorRotation()
local location = inst:K2_GetActorLocation()
print(string.format(
"Screen at (%.3f, %.3f, %.3f), extent (%.3f, %.3f, %.3f), rot (%.3f, %.3f, %.3f), loc (%.3f, %.3f, %.3f)\n",
origin.X, origin.Y, origin.Z,
extent.X, extent.Y, extent.Z,
rotation.Pitch, rotation.Yaw, rotation.Roll,
location.X, location.Y, location.Z
))
local wind_sound = FindObject("SoundWave", "amb_wind_menu_loop_01")
wind_sound.Volume = 0
local player = FindAllOf("LevelSequencePlayer")[1]
player:JumpToSeconds(0)
end)
NotifyOnNewObject("/Script/LevelSequence.LevelSequencePlayer", function(s_player)
local s_name = s_player:GetFullName()
if not s_name:find("Gamemenu_anim.AnimationPlayer", 1, true) then
return
end
ExecuteInGameThread(function()
local screenAsset = LoadAsset("/Game/Team/Alex/B12Flat_BPs_Alex/CACA_BigScreen_B12Flat.CACA_BigScreen_B12Flat_C")
if not screenAsset then
print("Couldn't get screen asset\n")
return
end
local world = s_player:GetWorld()
if not world then
print("Couldn't get world\n")
return
end
local loc = { X = 590, Y = 130, Z = -120 }
local rot = { Pitch = 10, Yaw = 120, Roll = -20 }
local spawned = world:SpawnActor(screenAsset, loc, rot)
if not spawned then
print("Couldn't spawn asset\n")
end
end)
return true
end)