-
Notifications
You must be signed in to change notification settings - Fork 0
/
VictoryBPFunctionLibrary.h
1983 lines (1576 loc) · 104 KB
/
VictoryBPFunctionLibrary.h
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
By Rama
*/
#pragma once
//to prevent nodes from getting called in constructors:
//meta=(UnsafeDuringActorConstruction = "true")
#include "VictoryISM.h"
//~~~~~~~~~~~~ UMG ~~~~~~~~~~~~~~~
#include "Runtime/UMG/Public/UMG.h"
#include "Runtime/UMG/Public/UMGStyle.h"
#include "Runtime/UMG/Public/Slate/SObjectWidget.h"
#include "Runtime/UMG/Public/IUMGModule.h"
#include "Runtime/UMG/Public/Blueprint/UserWidget.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//AI
#include "AIController.h" //MoveToWithFilter
//Audio
#include "Components/AudioComponent.h"
#include "AudioDecompress.h"
#include "AudioDevice.h"
#include "ActiveSound.h"
#include "Audio.h"
#include "Developer/TargetPlatform/Public/Interfaces/IAudioFormat.h"
#include "VorbisAudioInfo.h"
#include "Runtime/Engine/Classes/Engine/LevelStreamingDynamic.h"
//Texture2D
//#include "Engine/Texture2D.h"
#include "DDSLoader.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "VictoryBPFunctionLibrary.generated.h"
// BP Library for You
//
// Written by Rama
//note about UBlueprintFunctionLibrary
// This class is a base class for any function libraries exposed to blueprints.
// Methods in subclasses are expected to be static, and no methods should be added to the base class.
//~~~~~~~~~~~~~~~~~~~~~~
// Key Modifiers
//~~~~~~~~~~~~~~~~~~~~~~
UENUM(BlueprintType)
enum class EJoyImageFormats : uint8
{
JPG UMETA(DisplayName="JPG "),
PNG UMETA(DisplayName="PNG "),
BMP UMETA(DisplayName="BMP "),
ICO UMETA(DisplayName="ICO "),
EXR UMETA(DisplayName="EXR "),
ICNS UMETA(DisplayName="ICNS ")
};
//! REMOVE THIS AFTER A FEW VERSIONS
//!
//!
UENUM(BlueprintType)
enum class EVictoryHMDDevice : uint8
{
None UMETA(DisplayName="None"),
OculusRift UMETA(DisplayName="Oculus Rift"),
Morpheus UMETA(DisplayName="Morpheus"),
ES2GenericStereoMesh UMETA(DisplayName="ES2 Generic Stereo Mesh"),
SteamVR UMETA(DisplayName="Vive (Steam VR)"),
GearVR UMETA(DisplayName="Gear VR")
};
USTRUCT(BlueprintType)
struct FVictoryInput
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
FString ActionName;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
FKey Key;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
FString KeyAsString;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
uint32 bShift:1;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
uint32 bCtrl:1;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
uint32 bAlt:1;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
uint32 bCmd:1;
FVictoryInput(){}
FVictoryInput(const FString InActionName, const FKey InKey, const bool bInShift, const bool bInCtrl, const bool bInAlt, const bool bInCmd)
: Key(InKey)
, KeyAsString(InKey.GetDisplayName().ToString())
, bShift(bInShift)
, bCtrl(bInCtrl)
, bAlt(bInAlt)
, bCmd(bInCmd)
{
ActionName = InActionName;
}
FVictoryInput(const FInputActionKeyMapping& Action)
: Key(Action.Key)
, KeyAsString(Action.Key.GetDisplayName().ToString())
, bShift(Action.bShift)
, bCtrl(Action.bCtrl)
, bAlt(Action.bAlt)
, bCmd(Action.bCmd)
{
ActionName = Action.ActionName.ToString();
}
};
USTRUCT(BlueprintType)
struct FVictoryInputAxis
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
FString AxisName = "";
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
FString KeyAsString = "";
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
FKey Key;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song")
float Scale = 1;
FVictoryInputAxis(){}
FVictoryInputAxis(const FString InAxisName, FKey InKey, float InScale)
: AxisName(InAxisName)
, KeyAsString(InKey.GetDisplayName().ToString())
, Key(InKey)
, Scale(InScale)
{ }
FVictoryInputAxis(const FInputAxisKeyMapping& Axis)
: KeyAsString(Axis.Key.GetDisplayName().ToString())
, Key(Axis.Key)
, Scale(Axis.Scale)
{
AxisName = Axis.AxisName.ToString();
}
};
UENUM(BlueprintType)
namespace EJoyGraphicsFullScreen
{
//256 entries max
enum Type
{
FullScreen UMETA(DisplayName="Regular Full Screen"),
WindowedFullScreen UMETA(DisplayName="Windowed Full Screen High Quality"),
WindowedFullScreenPerformance UMETA(DisplayName="Windowed Full Screen (Default)"),
//~~~
//256th entry
EJoyGraphicsFullScreen_Max UMETA(Hidden),
};
}
USTRUCT(BlueprintType)
struct FLevelStreamInstanceInfo
{
GENERATED_USTRUCT_BODY()
UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite)
FName PackageName;
UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite)
FName PackageNameToLoad;
UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite)
FVector Location;
UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite)
FRotator Rotation;
UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite)
uint8 bShouldBeLoaded:1;
UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite)
uint8 bShouldBeVisible:1;
UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite)
uint8 bShouldBlockOnLoad:1;
UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite)
int32 LODIndex;
FLevelStreamInstanceInfo() {}
FLevelStreamInstanceInfo(ULevelStreamingDynamic* LevelInstance);
FString ToString() const
{
return FString::Printf(TEXT("PackageName: %s\nPackageNameToLoad:%s\nLocation:%s\nRotation:%s\nbShouldBeLoaded:%s\nbShouldBeVisible:%s\nbShouldBlockOnLoad:%s\nLODIndex:%i")
, *PackageName.ToString()
, *PackageNameToLoad.ToString()
, *Location.ToString()
, *Rotation.ToString()
, (bShouldBeLoaded) ? TEXT("True") : TEXT("False")
, (bShouldBeVisible) ? TEXT("True") : TEXT("False")
, (bShouldBlockOnLoad) ? TEXT("True") : TEXT("False")
, LODIndex);
}
};
UCLASS()
class VICTORYBPLIBRARY_API UVictoryBPFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_UCLASS_BODY()
//~~~~~~~~~~~~~~~~~~
// Level Generation
//~~~~~~~~~~~~~~~~~~
/** Load a level to a specific location and rotation, can create multiple of the same level!
*
* Ensure that each InstanceNumber is unique to spawn multiple instances of the same level!
*
* <3 Rama
*
* @param MapFolderOffOfContent - Maps or Maps/TileSets/TileSet1 etc
* @param LevelName - Just the level name itself, such as Tile1
* @param InstanceNumber - Ensure this is unique by keeping count to spawn as many instances of same level as you want!
* @param Location - Worldspace location where the level should be spawned
* @param Rotation - Worldspace rotation for rotating the entire level
* @return false if the level name was not found
*/
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Dynamic Level Generation",meta=(DeprecatedFunction, DeprecationMessage="My LoadLevelInstance BP node is in the main UE4 Engine as of 4.13! This version is deprecated and will be removed in the near future. <3 -Rama",WorldContext="WorldContextObject"))
static ULevelStreaming* VictoryLoadLevelInstance(UObject* WorldContextObject, FString MapFolderOffOfContent, FString LevelName, int32 InstanceNumber, FVector Location, FRotator Rotation,bool& Success);
//~~~~~~~~~~
// AI
//~~~~~~~~~~
/** Move to Location with optional Query Filter!
*
* 1. Create Custon Nav Area Classes.
*
* 2. Use Nav Modifier Volumes to apply custom area class data within the level, then
*
* 3. Create Query Filters which alter/exclude those custom nav areas.
*
* 4. Can then choose to use the filters per character or even per Move To using this node.
*
* <3 Rama
*
* @param FilterClass - Allows different types of units to path in different ways all the time, or path differently per Move To using this node!
* @param bProjectDestinationToNavigation - Whether to attempt to find a nearby point on the nav mesh below/above/close to the supplied point. Uses the Agent's Nav Extent for the projection
* @param bStopOnOverlap - Add pawn's radius to AcceptanceRadius
* @param bCanStrafe - Set focus related flag: bAllowStrafe
* @return Whether the Pawn's AI Controller is valid and goal can be pathed to
*/
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|AI")
static EPathFollowingRequestResult::Type Victory_AI_MoveToWithFilter(
APawn* Pawn,
const FVector& Dest,
TSubclassOf<UNavigationQueryFilter> FilterClass = NULL,
float AcceptanceRadius = 0,
bool bProjectDestinationToNavigation = false,
bool bStopOnOverlap = false,
bool bCanStrafe = false
);
//~~~~~~~~~~~~~~~~
// GPU <3 Rama
//~~~~~~~~~~~~~~~~
UFUNCTION(BlueprintPure,Category="Victory BP Library|GPU")
static FString Victory_GetGPUBrand()
{
return FPlatformMisc::GetPrimaryGPUBrand();
}
UFUNCTION(BlueprintPure,Category="Victory BP Library|GPU", meta=(Keywords="GPU"))
static FString Victory_GetGRHIAdapterName()
{
return GRHIAdapterName;
}
UFUNCTION(BlueprintPure,Category="Victory BP Library|GPU")
static void Victory_GetGPUInfo(FString& DeviceDescription, FString& Provider, FString& DriverVersion, FString& DriverDate);
//~~~~~~~~~~
// Core
//~~~~~~~~~~
/**
Launch a new process, if it is not set to be detached, UE4 will not fully close until the other process completes.
The new process id is returned!
Priority options: -2 idle, -1 low, 0 normal, 1 high, 2 higher
♥ Rama
*/
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|System")
static void VictoryCreateProc(int32& ProcessId, FString FullPathOfProgramToRun,TArray<FString> CommandlineArgs,bool Detach,bool Hidden, int32 Priority=0, FString OptionalWorkingDirectory="");
/** You can obtain ProcessID from processes you initiate via VictoryCreateProc */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|System")
static FString VictoryGetApplicationName(int32 ProcessId)
{
//Please note it should really be uint32 but that is not supported by BP yet
return FPlatformProcess::GetApplicationName(ProcessId);
}
/** You can obtain ProcessID from processes you initiate via VictoryCreateProc */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|System")
static bool VictoryIsApplicationRunning( int32 ProcessId )
{
//Please note it should really be uint32 but that is not supported by BP yet
return FPlatformProcess::IsApplicationRunning(ProcessId);
}
/* Blueprints does not support int64 so at some pt in future int32 will not be enough, probably by then dolphins will rule the world, or UE4 BP will support int64, or both! <3 Rama*/
UFUNCTION(BlueprintPure, Category = "Victory BP Library|System")
static int32 GetUnixTimeStamp(const FDateTime& UTCTime)
{
//Please note it should really be int64 but that is not supported by BP yet
return UTCTime.ToUnixTimestamp();
}
/* Blueprints does not support int64 so at some pt in future int32 will not be enough, probably by then dolphins will rule the world, or UE4 BP will support int64, or both! <3 Rama*/
UFUNCTION(BlueprintPure, Category = "Victory BP Library|System")
static void GetUTCFromUnixTimeStamp(int32 UnixTimeStamp, FDateTime& UTCTime)
{
//Please note it should really be int64 but that is not supported by BP yet
UTCTime = FDateTime::FromUnixTimestamp( UnixTimeStamp );
}
UFUNCTION(BlueprintPure, Category = "Rama Save System|File IO")
static void UTCToLocal(const FDateTime& UTCTime, FDateTime& LocalTime)
{
//Turn UTC into local ♥ Rama
FTimespan UTCOffset = FDateTime::Now() - FDateTime::UtcNow();
LocalTime = UTCTime;
LocalTime += UTCOffset;
//♥ Rama
}
/** Game thread may pause while hashing is ocurring. Please note that hashing multi-gb size files is very very slow, smaller files will process much faster :) <3 Rama*/
UFUNCTION(BlueprintCallable,Category="Victory BP Library|MD5")
static bool CreateMD5Hash(FString FileToHash, FString FileToStoreHashTo );
/** Game thread may pause while hashing is ocurring. Please note that hashing multi-gb size files is very very slow, smaller files will process much faster :) <3 Rama */
UFUNCTION(BlueprintCallable,Category="Victory BP Library|MD5")
static bool CompareMD5Hash(FString MD5HashFile1, FString MD5HashFile2 );
/** Dynamically change how frequently in seconds a component will tick! Can be altered at any point during game-time! ♥ Rama */
UFUNCTION(BlueprintCallable,Category="Victory BP Library|System")
static void SetComponentTickRate(UActorComponent* Component, float Seconds)
{
if(!Component) return;
Component->PrimaryComponentTick.TickInterval = Seconds;
}
/** Retrieves command line arguments that were passed into unreal */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|System")
static const FString GetCommandLine()
{
return FCommandLine::Get();
}
/**
* Create a new Texture Render Target 2D, ideal for use with Scene Capture Components created during runtime that need their own unique Render Targets
* @param Width Texture Width
* @param Height Texture Height
* @param ClearColor The color the texture is cleared to
* @param Gamma Will override FTextureRenderTarget2DResource::GetDisplayGamma if > 0.
* @return A new Texture Render Target 2D!
*
*/
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc")
static UTextureRenderTarget2D* CreateTextureRenderTarget2D(int32 Width=256, int32 Height=256, FLinearColor ClearColor = FLinearColor::White, float Gamma = 1)
{
UTextureRenderTarget2D* NewRenderTarget2D = NewObject<UTextureRenderTarget2D>();
if(!NewRenderTarget2D)
{
return nullptr;
}
NewRenderTarget2D->ClearColor = FLinearColor::White;
NewRenderTarget2D->TargetGamma = Gamma;
NewRenderTarget2D->InitAutoFormat(Width, Height);
return NewRenderTarget2D;
}
//~~~~~~~~~~
// Physics
//~~~~~~~~~~
/** Update the Angular Damping during runtime! Make sure the component is simulating physics before calling this! Returns false if the new value could not be set. */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics")
static bool VictoryPhysics_UpdateAngularDamping(UPrimitiveComponent* CompToUpdate, float NewAngularDamping);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Physics", meta=(Keywords="Closest Surface"))
static float GetDistanceToCollision(UPrimitiveComponent* CollisionComponent, const FVector& Point, FVector& ClosestPointOnCollision);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Physics", meta=(Keywords="Closest Surface"))
static float GetDistanceBetweenComponentSurfaces(UPrimitiveComponent* CollisionComponent1, UPrimitiveComponent* CollisionComponent2, FVector& PointOnSurface1, FVector& PointOnSurface2);
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics", meta=(Keywords="APEX Piece fracture damage PhysX Physics"))
static bool VictoryDestructible_DestroyChunk(UDestructibleComponent* DestructibleComp, int32 HitItem);
//~~~~~~~~~~
// Joy ISM
//~~~~~~~~~~
/** Retrieve an array of all of the Victory Instanced Static Mesh Actors that have been created during runtime! */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Instanced Static Mesh",meta=(WorldContext="WorldContextObject"))
static void VictoryISM_GetAllVictoryISMActors(UObject* WorldContextObject, TArray<AVictoryISM*>& Out);
/** Finds all instances of a specified Blueprint or class, and all subclasses of this class, and converts them into a single Instanced Static Mesh Actor! Returns the created Victory ISM actors. Please note all actors of subclasses are found as well, so use a very specific blueprint / class if you only want to generate Victory ISM actors for specific classes! Ignores actor classes that dont have a static mesh component. Please note that instanced static mesh actors can only be created for actors sharing the same static mesh asset. Different Instanced Static Mesh Actors are created for each unique static mesh asset found in the whole group of actors! */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Instanced Static Mesh",meta=(WorldContext="WorldContextObject"))
static void VictoryISM_ConvertToVictoryISMActors(UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, TArray<AVictoryISM*>& CreatedISMActors, bool DestroyOriginalActors=true, int32 MinCountToCreateISM=2);
//~~~~~~~~~~
// File I/O
//~~~~~~~~~~
/** Obtain all files in a provided directory, with optional extension filter. All files are returned if Ext is left blank. Returns false if operation could not occur. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO")
static bool JoyFileIO_GetFiles(TArray<FString>& Files, FString RootFolderFullPath, FString Ext);
/** Obtain all files in a provided root directory, including all subdirectories, with optional extension filter. All files are returned if Ext is left blank. The full file path is returned because the file could be in any subdirectory. Returns false if operation could not occur. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO")
static bool JoyFileIO_GetFilesInRootAndAllSubFolders(TArray<FString>& Files, FString RootFolderFullPath, FString Ext);
/** Obtain a listing of all SaveGame file names that were saved using the Blueprint Save Game system. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO")
static void SaveGameObject_GetAllSaveSlotFileNames(TArray<FString>& FileNames);
/** Returns false if the new file could not be created. The folder path must be absolute, such as C:\Users\Self\Documents\YourProject\MyPics. You can use my other Paths nodes to easily get absolute paths related to your project! <3 Rama */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Screenshots", meta=(Keywords="High resolution"))
static bool ScreenShots_Rename_Move_Most_Recent(FString& OriginalFileName, FString NewName, FString NewAbsoluteFolderPath, bool HighResolution=true);
//~~~~ Key Re Binding ! ~~~~
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding")
static void VictoryGetAllAxisAndActionMappingsForKey(FKey Key, TArray<FVictoryInput>& ActionBindings, TArray<FVictoryInputAxis>& AxisBindings);
// Axis Mapping
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding")
static FVictoryInputAxis VictoryGetVictoryInputAxis(const FKeyEvent& KeyEvent);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding")
static void VictoryGetAllAxisKeyBindings(TArray<FVictoryInputAxis>& Bindings);
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Key Rebinding")
static void VictoryRemoveAxisKeyBind(FVictoryInputAxis ToRemove);
/** You can leave the AsString field blank :) Returns false if the key could not be found as an existing mapping! Enjoy! <3 Rama */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Key Rebinding")
static bool VictoryReBindAxisKey(FVictoryInputAxis Original, FVictoryInputAxis NewBinding);
static FORCEINLINE void UpdateAxisMapping(FInputAxisKeyMapping& Destination, const FVictoryInputAxis& VictoryInputBind)
{
Destination.Key = VictoryInputBind.Key;
Destination.Scale = VictoryInputBind.Scale;
}
// Action Mapping
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding")
static FVictoryInput VictoryGetVictoryInput(const FKeyEvent& KeyEvent);
static FORCEINLINE void UpdateActionMapping(FInputActionKeyMapping& Destination, const FVictoryInput& VictoryInputBind)
{
Destination.Key = VictoryInputBind.Key;
Destination.bShift = VictoryInputBind.bShift;
Destination.bCtrl = VictoryInputBind.bCtrl;
Destination.bAlt = VictoryInputBind.bAlt;
Destination.bCmd = VictoryInputBind.bCmd;
}
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding")
static void VictoryGetAllActionKeyBindings(TArray<FVictoryInput>& Bindings);
/** You can leave the AsString field blank :) Returns false if the key could not be found as an existing mapping! Enjoy! <3 Rama */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Key Rebinding")
static bool VictoryReBindActionKey(FVictoryInput Original, FVictoryInput NewBinding);
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Key Rebinding")
static void VictoryRemoveActionKeyBind(FVictoryInput ToRemove);
//~~~~~~~~~~~~~~~~~~~~
/** Change volume of Sound class of your choosing, sets the volume instantly! Returns false if the sound class was not found and volume was not set. */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Sound")
static bool VictorySoundVolumeChange(USoundClass* SoundClassObject, float NewVolume);
/** Get Current Sound Volume! Returns -1 if sound class was not found*/
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Sound")
static float VictoryGetSoundVolume(USoundClass* SoundClassObject);
//~~~~~~~~~~~~~~~~~~~~
/** The number of seconds that this actor has been in play, relative to Get Game Time In Seconds. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Actor")
static float GetTimeInPlay(AActor* Actor)
{
if(!Actor) return -1;
UWorld* World = Actor->GetWorld();
//Use FApp Current Time as a back up
float CurrentTime = (World) ? World->GetTimeSeconds() : FApp::GetCurrentTime();
return CurrentTime - Actor->CreationTime;
}
/**
* Creates a plane centered on a world space point with a facing direction of Normal.
*
* @param Center The world space point the plane should be centered on (easy to observe with DrawDebugPlane)
* @param Normal The facing direction of the plane (can receive a Rotator)
* @return Plane coordinates
*/
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Math|Plane", meta=(Keywords="make base plane"))
static FPlane CreatePlane(FVector Center, FVector Normal)
{
return FPlane(Center,Normal);
}
/** >0: point is in front of the plane, <0: behind, =0: on the plane **/
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Math|Plane")
static void PointDistanceToPlane(const FPlane& Plane, FVector Point,float& Distance)
{
Distance = Plane.PlaneDot(Point);
}
/** Use a larger tolerance to allow inaccuracy of measurement in certain situations */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Math|Plane")
static bool IsPointOnPlane(const FPlane& Plane, FVector Point, float Tolerance= 0.01)
{
return FMath::Abs(Plane.PlaneDot(Point)) < Tolerance;
}
/** Easily add to an integer! <3 Rama*/
UFUNCTION(BlueprintCallable, meta = (CompactNodeTitle = "+=",Keywords = "increment integer"), Category = "Victory BP Library|Math|Integer")
static void VictoryIntPlusEquals(UPARAM(ref) int32& Int, int32 Add, int32& IntOut);
/** Easily subtract from an integer! <3 Rama*/
UFUNCTION(BlueprintCallable, meta = (CompactNodeTitle = "-=",Keywords = "decrement integer"), Category = "Victory BP Library|Math|Integer")
static void VictoryIntMinusEquals(UPARAM(ref) int32& Int, int32 Sub, int32& IntOut);
/** Easily add to a float! <3 Rama*/
UFUNCTION(BlueprintCallable, meta = (CompactNodeTitle = "+=",Keywords = "increment float"), Category = "Victory BP Library|Math|Float")
static void VictoryFloatPlusEquals(UPARAM(ref) float& Float, float Add, float& FloatOut);
/** Easily subtract from a float! <3 Rama*/
UFUNCTION(BlueprintCallable, meta = (CompactNodeTitle = "-=",Keywords = "decrement float"), Category = "Victory BP Library|Math|Float")
static void VictoryFloatMinusEquals(UPARAM(ref) float& Float, float Sub, float& FloatOut);
/** Sort an integer array, smallest value will be at index 0 after sorting. Modifies the input array, no new data created. <3 Rama */
UFUNCTION(BlueprintCallable, meta = (Keywords = "sort integer array"), Category = "Victory BP Library|Array")
static void VictorySortIntArray(UPARAM(ref) TArray<int32>& IntArray, TArray<int32>& IntArrayRef);
/** Sort a float array, smallest value will be at index 0 after sorting. Modifies the input array, no new data created. */
UFUNCTION(BlueprintCallable, meta = (Keywords = "sort float array"), Category = "Victory BP Library|Array")
static void VictorySortFloatArray(UPARAM(ref) TArray<float>& FloatArray, TArray<float>& FloatArrayRef);
/* Returns true if vector2D A is equal to vector2D B (A == B) within a specified error tolerance */
UFUNCTION(BlueprintPure, meta=(DisplayName = "Equal (vector2D)", CompactNodeTitle = "==", Keywords = "== equal"), Category="Victory BP Library|Math|Vector2D")
static bool EqualEqual_Vector2DVector2D(FVector2D A, FVector2D B, float ErrorTolerance = 1.e-4f)
{
return A.Equals(B,ErrorTolerance);
}
/* Returns true if vector2D A is not equal to vector2D B (A != B) within a specified error tolerance */
UFUNCTION(BlueprintPure, meta=(DisplayName = "Not Equal (vector2D)", CompactNodeTitle = "!=", Keywords = "!= not equal"), Category="Victory BP Library|Math|Vector2D")
static bool NotEqual_Vector2DVector2D(FVector2D A, FVector2D B, float ErrorTolerance = 1.e-4f)
{
return !A.Equals(B,ErrorTolerance);
}
//~~~
/**
* Tries to reach Target based on distance from Current position, giving a nice smooth feeling when tracking a position.
*
* @param Current Actual position
* @param Target Target position
* @param DeltaTime Time since last tick
* @param InterpSpeed Interpolation speed
* @return New interpolated position
*/
//UFUNCTION(BlueprintPure, Category="Math|Interpolation", meta=(Keywords="position"))
UFUNCTION(BlueprintPure, Category="Victory BP Library|Math", meta=(Keywords="position"))
static FVector2D Vector2DInterpTo(FVector2D Current, FVector2D Target, float DeltaTime, float InterpSpeed);
/**
* Tries to reach Target at a constant rate.
*
* @param Current Actual position
* @param Target Target position
* @param DeltaTime Time since last tick
* @param InterpSpeed Interpolation speed
* @return New interpolated position
*/
//UFUNCTION(BlueprintPure, Category="Math|Interpolation", meta=(Keywords="position"))
UFUNCTION(BlueprintPure, Category="Victory BP Library|Math", meta=(Keywords="position"))
static FVector2D Vector2DInterpTo_Constant(FVector2D Current, FVector2D Target, float DeltaTime, float InterpSpeed);
//~~~ Text To Number ~~~
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion")
static bool Text_IsNumeric(const FText& Text)
{
return Text.IsNumeric();
}
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion", meta=(AdvancedDisplay = "1"))
static float Text_ToFloat(const FText& Text, bool UseDotForThousands=false)
{
//because commas lead to string number being truncated, FText 10,000 becomes 10 for FString
FString StrFloat = Text.ToString();
TextNumFormat(StrFloat,UseDotForThousands);
return FCString::Atof(*StrFloat);
}
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion", meta=(AdvancedDisplay = "1"))
static int32 Text_ToInt(const FText& Text, bool UseDotForThousands=false)
{
//because commas lead to string number being truncated, FText 10,000 becomes 10 for FString
FString StrInt = Text.ToString();
TextNumFormat(StrInt,UseDotForThousands);
return FCString::Atoi(*StrInt);
}
static void TextNumFormat(FString& StrNum, bool UseDotForThousands)
{
//10.000.000,997
if(UseDotForThousands)
{
StrNum.ReplaceInline(TEXT("."),TEXT("")); //no dots as they truncate
StrNum.ReplaceInline(TEXT(","),TEXT(".")); //commas become decimal
}
//10,000,000.997
else
{
StrNum.ReplaceInline(TEXT(","),TEXT("")); //decimal can stay, commas would truncate so remove
}
}
//~~~ End of Text To Number ~~~
/** Returns Value mapped from one range into another where the value is clamped to the output range. (e.g. 0.5 normalized from the range 0->1 to 0->50 would result in 25) */
UFUNCTION(BlueprintPure, Category="Victory BP Library|Math", meta=(Keywords = "get mapped value clamped"))
static float MapRangeClamped(float Value, float InRangeA, float InRangeB, float OutRangeA, float OutRangeB);
/** Server Travel! This is an async load level process which allows you to put up a UMG widget while the level loading occurs! */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|System",meta=(WorldContext="WorldContextObject"))
static void ServerTravel(UObject* WorldContextObject,FString MapName, bool bSkipNotifyPlayers=false);
/** Get a Player Start by Name! */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|System",meta=(WorldContext="WorldContextObject"))
static APlayerStart* GetPlayerStart(UObject* WorldContextObject,FString PlayerStartName);
/** Convert String Back To Vector. IsValid indicates whether or not the string could be successfully converted. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion",meta=(DisplayName = "String to Vector", CompactNodeTitle = "->"))
static void Conversions__StringToVector(const FString& String, FVector& ConvertedVector, bool& IsValid);
/** Convert String Back To Rotator. IsValid indicates whether or not the string could be successfully converted. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion",meta=(DisplayName = "String to Rotator", CompactNodeTitle = "->"))
static void Conversions__StringToRotator(const FString& String, FRotator& ConvertedRotator, bool& IsValid);
/** Convert String Back To Color. IsValid indicates whether or not the string could be successfully converted. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion",meta=(DisplayName = "String to Color", CompactNodeTitle = "->"))
static void Conversions__StringToColor(const FString& String, FLinearColor& ConvertedColor, bool& IsValid);
/** Convert Color to String! */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion",meta=(DisplayName = "Color to String ", CompactNodeTitle = "~>"))
static void Conversions__ColorToString(const FLinearColor& Color, FString& ColorAsString);
/** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
//UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars!")
//static uint8 Victory_ConvertStringToByte(UEnum* Enum,FString String);
//! not working yet, always getting 255
/** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars")
static bool VictoryGetCustomConfigVar_Bool(FString SectionName, FString VariableName, bool& IsValid);
/** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars")
static int32 VictoryGetCustomConfigVar_Int(FString SectionName, FString VariableName, bool& IsValid);
/** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars")
static float VictoryGetCustomConfigVar_Float(FString SectionName, FString VariableName, bool& IsValid);
/** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars")
static FVector VictoryGetCustomConfigVar_Vector(FString SectionName, FString VariableName, bool& IsValid);
/** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars")
static FRotator VictoryGetCustomConfigVar_Rotator(FString SectionName, FString VariableName, bool& IsValid);
/** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars")
static FLinearColor VictoryGetCustomConfigVar_Color(FString SectionName, FString VariableName, bool& IsValid);
/** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars")
static FString VictoryGetCustomConfigVar_String(FString SectionName, FString VariableName, bool& IsValid);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars")
static FVector2D VictoryGetCustomConfigVar_Vector2D(FString SectionName, FString VariableName, bool& IsValid);
//~~~~~~~~~~~~~~~~~~~~
/** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars")
static void VictorySetCustomConfigVar_Vector2D(FString SectionName, FString VariableName, FVector2D Value);
/** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars")
static void VictorySetCustomConfigVar_Bool(FString SectionName, FString VariableName, bool Value);
/** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars")
static void VictorySetCustomConfigVar_Int(FString SectionName, FString VariableName, int32 Value);
/** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars")
static void VictorySetCustomConfigVar_Float(FString SectionName, FString VariableName, float Value);
/** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars")
static void VictorySetCustomConfigVar_Vector(FString SectionName, FString VariableName, FVector Value);
/** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars")
static void VictorySetCustomConfigVar_Rotator(FString SectionName, FString VariableName, FRotator Value);
/** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars")
static void VictorySetCustomConfigVar_Color(FString SectionName, FString VariableName, FLinearColor Value);
/** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars")
static void VictorySetCustomConfigVar_String(FString SectionName, FString VariableName, FString Value);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Transform")
FRotator TransformVectorToActorSpaceAngle(AActor* Actor, const FVector& InVector);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Transform")
FVector TransformVectorToActorSpace(AActor* Actor, const FVector& InVector);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|UMG", meta=(keywords="HMD vive oculus rift gearvr morpheus"))
static FName GetHeadMountedDisplayDeviceType();
/** The FName that is expected is the exact same format as when you right click on asset -> Copy Reference! You can directly paste copied references into this node! IsValid lets you know if the path was correct or not and I was able to load the object. MAKE SURE TO SAVE THE RETURNED OBJECT AS A VARIABLE. Otherwise your shiny new asset will get garbage collected. I recommend you cast the return value to the appropriate object and then promote it to a variable :) -Rama */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc")
static UObject* LoadObjectFromAssetPath(TSubclassOf<UObject> ObjectClass, FName Path, bool& IsValid);
/** Uses the same format as I use for LoadObjectFromAssetPath! Use this node to get the asset path of objects in the world! -Rama */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Misc")
static FName GetObjectPath(UObject* Obj);
/** Find all widgets of a certain class! Top level only means only widgets that are directly added to the viewport will be found */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|UMG", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject", DeterminesOutputType = "WidgetClass", DynamicOutputParam = "FoundWidgets"))
static void GetAllWidgetsOfClass(UObject* WorldContextObject, TSubclassOf<UUserWidget> WidgetClass, TArray<UUserWidget*>& FoundWidgets, bool TopLevelOnly = true);
/** Remove all widgets of a certain class from viewport! */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|UMG", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static void RemoveAllWidgetsOfClass(UObject* WorldContextObject, TSubclassOf<UUserWidget> WidgetClass);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|UMG", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static bool IsWidgetOfClassInViewport(UObject* WorldContextObject, TSubclassOf<UUserWidget> WidgetClass);
/** Handy helper to check if a Key Event was for specified Key ♥ Rama*/
UFUNCTION(BlueprintPure,Category="Victory BP Library|UMG", meta = (Keywords = "== match same equal"))
static void JoyIsKey(const FKeyEvent& KeyEvent, FKey Key, bool& Ctrl, bool& Shift, bool& Alt, bool& Cmd, bool& Match)
{
Ctrl = KeyEvent.IsControlDown();
Alt = KeyEvent.IsAltDown();
Shift = KeyEvent.IsShiftDown();
Cmd = KeyEvent.IsCommandDown();
Match = KeyEvent.GetKey() == Key;
}
/** Retrieves the unique net ID for the local player as a number! The number itself will vary based on what Online Subsystem is being used, but you are guaranteed that this number is unique per player! */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Networking")
static int32 GetPlayerUniqueNetID();
/** Call this periodically in a huge loop you are intentionally using to reset the BP runaway loop system. Caution, if you have an infinite loop this will permanently hang your system until you turn your computer off. Use very very carefully! When constructing a new loop and you are not sure if it is totally stable, do NOT use this node! Always test new loops normally to ensure you dont truly have a runaway loop that would hang your computer forever. */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc")
static void Loops_ResetBPRunawayCounter();
/** Set the Max Frame Rate. Min value is 10. */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Graphics Settings")
static void GraphicsSettings__SetFrameRateCap(float NewValue);
/** Only hardware dependent, no smoothing */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Graphics Settings")
static void GraphicsSettings__SetFrameRateToBeUnbound();
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc")
static FVector2D ProjectWorldToScreenPosition(const FVector& WorldLocation);
/** Make sure to save off the return value as a global variable in one of your BPs or else it will get garbage collected! */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc", meta = (DeprecatedFunction, DeprecationMessage="Epic has introduced Construct Object as of 4.9.0, I recommend you use that instead! -Rama", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static UObject* CreateObject(UObject* WorldContextObject, UClass* TheObjectClass);
/** Make sure to save off the return value as a global variable in one of your BPs or else it will get garbage collected! */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static UPrimitiveComponent* CreatePrimitiveComponent(UObject* WorldContextObject, TSubclassOf<UPrimitiveComponent> CompClass, FName Name, FVector Location, FRotator Rotation);
/** Spawn an Actor and choose which level you want them to spawn into! */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Actor", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static AActor* SpawnActorIntoLevel(UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, FName Level = NAME_None, FVector Location = FVector::ZeroVector, FRotator Rotation = FRotator::ZeroRotator, bool SpawnEvenIfColliding = true);
/** Get the names of all currently loaded and visible levels! */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|System", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static void GetNamesOfLoadedLevels(UObject* WorldContextObject, TArray<FString>& NamesOfLoadedLevels);
/** Obtain the scaled,rotated, and translated vertex positions for any static mesh! Returns false if operation could not occur because the comp or static mesh asset was invalid. <3 Rama */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Actor")
static bool GetStaticMeshVertexLocations(UStaticMeshComponent* Comp, TArray<FVector>& VertexPositions);
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Actor")
static void AddToActorRotation(AActor* TheActor, FRotator AddRot);
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static void DrawCircle(
UObject* WorldContextObject,
FVector Center,
float Radius,
int32 NumPoints = 32,
float Thickness = 7,
FLinearColor LineColor = FLinearColor::Red,
FVector YAxis = FVector(0, 1, 0),
FVector ZAxis = FVector(0, 0, 1),
float Duration = 0,
bool PersistentLines = false
);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|AI",meta=(WorldContext="WorldContextObject"))
static AActor* GetClosestActorOfClassInRadiusOfLocation(UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, FVector Center, float Radius, bool& IsValid);
UFUNCTION(BlueprintPure, Category = "Victory BP Library|AI",meta=(WorldContext="WorldContextObject"))
static AActor* GetClosestActorOfClassInRadiusOfActor(UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, AActor* ActorCenter, float Radius, bool& IsValid);
/**
* Generates a box that is guaranteed to contain all of the supplied points.
*
* @param Points The world space points that the box will encompass.
*/
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Misc")
static void GetBoxContainingWorldPoints(const TArray<FVector>& Points, FVector& Center, FVector& Extent)
{
FBox Box(ForceInit);
for(const FVector& Each : Points)
{
Box += Each;
}
Center = Box.GetCenter();
Extent = Box.GetExtent();
}
/** Implementation of a Selection Marquee / Selection Box as a BP Node. AnchorPoint is the first clicked point, which user then drags from to make the box. Class filter is optional way to narrow the scope of actors that can be selected by the selection box! -Rama*/
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static void Selection_SelectionBox(UObject* WorldContextObject, TArray<AActor*>& SelectedActors, FVector2D AnchorPoint, FVector2D DraggedPoint, TSubclassOf<AActor> ClassFilter);
/** Get the Controller ID for a supplied Player Controller <3 Rama. Returns false if operation could not occur. */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Controller")
static bool PlayerController_GetControllerID(APlayerController* ThePC, int32& ControllerID);
/** Get the Unique PlayerID from the PlayerState for a supplied Player Controller. Returns false if operation could not occur. Epic accepted my pull request for this a while back so now you can just GetPlayerState and directly access <3 Rama*/
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Networking")
static bool PlayerState_GetPlayerID(APlayerController* ThePC, int32& PlayerID);
/** Returns whether this game instance is single player. <3 Rama*/
UFUNCTION(BlueprintPure, Category="Victory BP Library|Networking", meta=(Keywords="SinglePlayer multiplayer", WorldContext="WorldContextObject"))
static bool IsStandAlone(UObject* WorldContextObject)
{
UWorld* World = GEngine->GetWorldFromContextObjectChecked( WorldContextObject );
return World ? (World->GetNetMode() == NM_Standalone) : false;
}
/** Launches the specified URL in the OS default web browser :) <3 Rama */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|System")
static void Open_URL_In_Web_Browser(FString TheURL);
/** Returns which platform the game code is running in.*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System")
static void OperatingSystem__GetCurrentPlatform(
bool& Windows_,
bool& Mac,
bool& Linux,
bool& iOS,
bool& Android,
bool& Android_ARM,
bool& Android_Vulkan,
bool& PS4,
bool& XBoxOne,
bool& HTML5,
bool& Apple
);
//~~~
/** Retrieves the OS system Date and Time as a string at the instant this BP node runs. Use my other RealWorldTime node to get the time passed since the return value of this node! You can use this to record milliseconds/seconds/minutes/hours between events in game logic! */
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System")
static FString RealWorldTime__GetCurrentOSTime(
int32& MilliSeconds,
int32& Seconds,
int32& Minutes,
int32& Hours12,
int32& Hours24,
int32& Day,
int32& Month,
int32& Year
);
/** Get the amount of seconds/minutes/hours since the the supplied DateTime string! You can use this to record milliseconds/seconds/minutes/hours between events in game logic! */
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System")
static void RealWorldTime__GetTimePassedSincePreviousTime(
const FString& PreviousTime,
float& Milliseconds,
float& Seconds,
float& Minutes,
float& Hours
);
/** Get the difference between two recorded times! You can use this to record milliseconds/seconds/minutes/hours between events in game logic! */
UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System")
static void RealWorldTime__GetDifferenceBetweenTimes(
const FString& PreviousTime1,
const FString& PreviousTime2,
float& Milliseconds,
float& Seconds,
float& Minutes,
float& Hours
);
//~~~
/** Loads a text file from hard disk and parses it into a String array, where each entry in the string array is 1 line from the text file. Option to exclude lines that are only whitespace characters or '\n'. Returns the size of the final String Array that was created. Returns false if the file could be loaded from hard disk. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO")
static bool LoadStringArrayFromFile(TArray<FString>& StringArray, int32& ArraySize, FString FullFilePath = "Enter Full File Path", bool ExcludeEmptyLines = false);
/** Load a text file to a single string that you can use ParseIntoArray on newline characters if you want same format as LoadStringArrayFromFile. This version supports unicode characters! */
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|File IO")
static bool LoadStringFromFile(FString& Result, FString FullFilePath = "Enter Full File Path")
{
return FFileHelper::LoadFileToString( Result, *FullFilePath);
}
//~~~
/** Max of all array entries. Returns -1 if the supplied array is empty. Returns the index of the max value as well as the value itself. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Array")
static void MaxOfFloatArray(const TArray<float>& FloatArray, int32& IndexOfMaxValue, float& MaxValue);
/** Max of all array entries. Returns -1 if the supplied array is empty. Returns the index of the max value as well as the value itself. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Array")
static void MaxOfIntArray(const TArray<int32>& IntArray, int32& IndexOfMaxValue, int32& MaxValue);
/** Min of all array entries. Returns -1 if the supplied array is empty. Returns the index of the min value as well as the value itself. */
UFUNCTION(BlueprintPure, Category = "Victory BP Library|Array")
static void MinOfFloatArray(const TArray<float>& FloatArray, int32& IndexOfMinValue, float& MinValue);