├── .gitignore ├── Config └── FilterPlugin.ini ├── LICENSE.md ├── README.md ├── Resources └── Icon128.png ├── Source └── VictoryBPLibrary │ ├── Private │ ├── TKMathFunctionLibrary.cpp │ ├── VictoryBPFunctionLibrary.cpp │ ├── VictoryBPFunctionLibrary_WinOS.cpp │ ├── VictoryBPHTML.cpp │ ├── VictoryBPLibrary.cpp │ └── VictoryBPLibraryPrivatePCH.h │ ├── Public │ ├── TKMathFunctionLibrary.h │ ├── VictoryBPFunctionLibrary.h │ ├── VictoryBPHTML.h │ ├── VictoryBPLibrary.h │ ├── VictoryISM.cpp │ ├── VictoryISM.h │ ├── VictoryPC.cpp │ ├── VictoryPC.h │ ├── VictoryTMapComp.cpp │ └── VictoryTMapComp.h │ └── VictoryBPLibrary.Build.cs └── VictoryBPLibrary.uplugin /.gitignore: -------------------------------------------------------------------------------- 1 | Binaries/ 2 | DerivedDataCache/ 3 | Intermediate/ 4 | Saved/ 5 | Rama/ 6 | Build/ 7 | *.pdb 8 | *.sdf 9 | *.opensdf 10 | *.sln 11 | *.suo 12 | *.opendb 13 | 14 | # Windows image file caches 15 | Thumbs.db 16 | ehthumbs.db 17 | 18 | # Folder config file 19 | Desktop.ini 20 | 21 | # Recycle Bin used on file shares 22 | $RECYCLE.BIN/ 23 | 24 | # Windows Installer files 25 | *.cab 26 | *.msi 27 | *.msm 28 | *.msp 29 | *.pdb 30 | 31 | # ========================= 32 | # Operating System Files 33 | # ========================= 34 | 35 | # OSX 36 | # ========================= 37 | 38 | .DS_Store 39 | .AppleDouble 40 | .LSOverride 41 | 42 | # Icon must end with two \r 43 | Icon 44 | # Thumbnails 45 | ._* 46 | 47 | # Files that might appear on external disk 48 | .Spotlight-V100 49 | .Trashes 50 | 51 | # Directories potentially created on remote AFP share 52 | .AppleDB 53 | .AppleDesktop 54 | Network Trash Folder 55 | Temporary Items 56 | .apdisk 57 | -------------------------------------------------------------------------------- /Config/FilterPlugin.ini: -------------------------------------------------------------------------------- 1 | [FilterPlugin] 2 | ; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and 3 | ; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. 4 | ; 5 | ; Examples: 6 | ; /README.txt 7 | ; /Extras/... 8 | ; /Binaries/ThirdParty/*.dll 9 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2020 by Nathan "Rama" Iyer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VictoryPlugin 2 | Rama's Victory Blueprint Library 3 | 4 | 100+ Extra Blueprint Nodes For you! 5 | 6 | UE4 Forum Link ~ Victory BP Library Thread ~ https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/4014-39-rama-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required 7 | 8 | 9 | 10 | # Software License 11 | 12 | https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/4014-39-rama-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required?p=1718286#post1718286 13 | 14 | ♥ 15 | 16 | Rama 17 | -------------------------------------------------------------------------------- /Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EverNewJoy/VictoryPlugin/4a05929b718dd14f47a0a949481ae8f7c21d2eaa/Resources/Icon128.png -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Private/TKMathFunctionLibrary.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | By TK-Master 3 | */ 4 | #include "VictoryBPLibraryPrivatePCH.h" 5 | 6 | #include "TKMathFunctionLibrary.h" 7 | 8 | #include "StaticMeshResources.h" 9 | 10 | //UTKMathFunctionLibrary 11 | 12 | float UTKMathFunctionLibrary::GetConsoleVariableFloat(FString VariableName) 13 | { 14 | const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataFloat(*VariableName); 15 | 16 | if (CVar) 17 | { 18 | return CVar->GetValueOnGameThread(); 19 | //return CVar->GetValueOnAnyThread(); 20 | } 21 | 22 | return 0.f; 23 | } 24 | 25 | int32 UTKMathFunctionLibrary::GetConsoleVariableInt(FString VariableName) 26 | { 27 | const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(*VariableName); 28 | 29 | if (CVar) 30 | { 31 | return CVar->GetValueOnGameThread(); 32 | //return CVar->GetValueOnAnyThread(); 33 | } 34 | return 0; 35 | } 36 | 37 | float UTKMathFunctionLibrary::NegateFloat(float A) 38 | { 39 | return -A; 40 | } 41 | 42 | int32 UTKMathFunctionLibrary::NegateInt(int32 A) 43 | { 44 | return -A; 45 | } 46 | 47 | FVector2D UTKMathFunctionLibrary::NegateVector2D(FVector2D A) 48 | { 49 | return -A; 50 | } 51 | 52 | FVector UTKMathFunctionLibrary::SetVectorLength(FVector A, float size) 53 | { 54 | return A.GetSafeNormal() * size; 55 | } 56 | 57 | FVector UTKMathFunctionLibrary::VectorRadiansToDegrees(FVector RadVector) 58 | { 59 | return FVector::RadiansToDegrees(RadVector); 60 | } 61 | 62 | FVector UTKMathFunctionLibrary::VectorDegreesToRadians(FVector DegVector) 63 | { 64 | return FVector::DegreesToRadians(DegVector); 65 | } 66 | 67 | int32 UTKMathFunctionLibrary::RoundToLowerMultiple(int32 A, int32 Multiple, bool skipSelf) 68 | { 69 | int32 result = (A / Multiple) * Multiple; 70 | if (skipSelf && result == A && result != 0) 71 | { 72 | return ((A-1) / Multiple) * Multiple; 73 | } 74 | return result; 75 | } 76 | 77 | int32 UTKMathFunctionLibrary::RoundToUpperMultiple(int32 A, int32 Multiple, bool skipSelf) 78 | { 79 | if (skipSelf || FMath::Fmod(A, Multiple) != 0) 80 | { 81 | A = ((A + Multiple) / Multiple) * Multiple; 82 | } 83 | return A; 84 | } 85 | 86 | int32 UTKMathFunctionLibrary::RoundToNearestMultiple(int32 A, int32 Multiple) 87 | { 88 | return ((A + Multiple / 2) / Multiple) * Multiple; 89 | } 90 | 91 | bool UTKMathFunctionLibrary::IsPowerOfTwo(int32 x) 92 | { 93 | //return x && ((x&-x) == x); 94 | return FMath::IsPowerOfTwo(x); 95 | } 96 | 97 | bool UTKMathFunctionLibrary::IsMultipleOf(int32 A, int32 Multiple) 98 | { 99 | return FMath::Fmod(A, Multiple) == 0; 100 | } 101 | 102 | bool UTKMathFunctionLibrary::IsEvenNumber(float A) 103 | { 104 | return FMath::Fmod(A, 2) == 0; 105 | } 106 | 107 | FVector UTKMathFunctionLibrary::ClosestPointOnSphereToLine(FVector SphereOrigin, float SphereRadius, FVector LineOrigin, FVector LineDir) 108 | { 109 | static FVector OutClosestPoint; 110 | FMath::SphereDistToLine(SphereOrigin, SphereRadius, LineOrigin, LineDir.GetSafeNormal(), OutClosestPoint); 111 | return OutClosestPoint; 112 | } 113 | 114 | FVector UTKMathFunctionLibrary::ClosestPointOnLineSeqment(FVector Point, FVector LineStart, FVector LineEnd) 115 | { 116 | return FMath::ClosestPointOnLine(LineStart, LineEnd, Point); 117 | } 118 | 119 | bool UTKMathFunctionLibrary::IsPointInsideBox(FVector Point, FVector BoxOrigin, FVector BoxExtent) 120 | { 121 | FBox Box = FBox::BuildAABB(BoxOrigin, BoxExtent); 122 | return FMath::PointBoxIntersection(Point, Box); 123 | } 124 | 125 | bool UTKMathFunctionLibrary::SphereBoxIntersection(FVector SphereOrigin, float SphereRadius, FVector BoxOrigin, FVector BoxExtent) 126 | { 127 | FBox Box = FBox::BuildAABB(BoxOrigin, BoxExtent); 128 | return FMath::SphereAABBIntersection(SphereOrigin, FMath::Square(SphereRadius), Box); 129 | } 130 | 131 | bool UTKMathFunctionLibrary::IsLineInsideSphere(FVector LineStart, FVector LineDir, float LineLength, FVector SphereOrigin, float SphereRadius) 132 | { 133 | return FMath::LineSphereIntersection(LineStart, LineDir, LineLength, SphereOrigin, SphereRadius); 134 | } 135 | 136 | bool UTKMathFunctionLibrary::LineExtentBoxIntersection(FBox inBox, FVector Start, FVector End, FVector Extent, FVector& HitLocation, FVector& HitNormal, float& HitTime) 137 | { 138 | return FMath::LineExtentBoxIntersection(inBox, Start, End, Extent, HitLocation, HitNormal, HitTime); 139 | } 140 | 141 | float UTKMathFunctionLibrary::SignedDistancePlanePoint(FVector planeNormal, FVector planePoint, FVector point) 142 | { 143 | return FVector::DotProduct(planeNormal, (point - planePoint)); 144 | } 145 | 146 | FVector UTKMathFunctionLibrary::ProjectPointOnLine(FVector LineOrigin, FVector LineDirection, FVector Point) 147 | { 148 | //FVector linePointToPoint = point - linePoint; 149 | //float t = FVector::DotProduct(linePointToPoint, lineDir); 150 | //return linePoint + lineDir * t; 151 | 152 | //FVector closestPoint; 153 | //OutDistance = FMath::PointDistToLine(point, lineDir, linePoint, closestPoint); 154 | //return closestPoint; 155 | 156 | FVector SafeDir = LineDirection.GetSafeNormal(); 157 | return LineOrigin + (SafeDir * ((Point - LineOrigin) | SafeDir)); 158 | } 159 | 160 | void UTKMathFunctionLibrary::ClosestPointsOfLineSegments(FVector Line1Start, FVector Line1End, FVector Line2Start, FVector Line2End, FVector& LinePoint1, FVector& LinePoint2) 161 | { 162 | FMath::SegmentDistToSegmentSafe(Line1Start, Line1End, Line2Start, Line2End, LinePoint1, LinePoint2); 163 | } 164 | 165 | bool UTKMathFunctionLibrary::LineToLineIntersection(FVector& IntersectionPoint, FVector LinePoint1, FVector LineDir1, FVector LinePoint2, FVector LineDir2) 166 | { 167 | //Are lines coplanar? 168 | if (!FVector::Coplanar(LinePoint1, LineDir1, LinePoint2, LineDir2, DELTA)) 169 | { 170 | return false; 171 | } 172 | 173 | FVector LineDir3 = LinePoint2 - LinePoint1; 174 | FVector CrossDir1And2 = FVector::CrossProduct(LineDir1, LineDir2); 175 | FVector CrossDir3And2 = FVector::CrossProduct(LineDir3, LineDir2); 176 | 177 | float s = FVector::DotProduct(CrossDir3And2, CrossDir1And2) / CrossDir1And2.SizeSquared(); 178 | 179 | if (s > 1.0f || s < 0.0f) 180 | { 181 | return false; 182 | } 183 | else 184 | { 185 | IntersectionPoint = LinePoint1 + (LineDir1 * s); 186 | return true; 187 | } 188 | } 189 | 190 | bool UTKMathFunctionLibrary::ClosestPointsOnTwoLines(FVector& closestPointLine1, FVector& closestPointLine2, FVector linePoint1, FVector lineVec1, FVector linePoint2, FVector lineVec2) 191 | { 192 | float a = FVector::DotProduct(lineVec1, lineVec1); 193 | float b = FVector::DotProduct(lineVec1, lineVec2); 194 | float e = FVector::DotProduct(lineVec2, lineVec2); 195 | 196 | float d = a*e - b*b; 197 | 198 | //lines are not parallel 199 | if (d != 0.0f) 200 | { 201 | FVector r = linePoint1 - linePoint2; 202 | float c = FVector::DotProduct(lineVec1, r); 203 | float f = FVector::DotProduct(lineVec2, r); 204 | 205 | float s = (b*f - c*e) / d; 206 | float t = (a*f - c*b) / d; 207 | 208 | closestPointLine1 = linePoint1 + lineVec1 * s; 209 | closestPointLine2 = linePoint2 + lineVec2 * t; 210 | 211 | return true; 212 | } 213 | else 214 | { 215 | return false; 216 | } 217 | } 218 | 219 | int32 UTKMathFunctionLibrary::PointOnWhichSideOfLineSegment(FVector linePoint1, FVector linePoint2, FVector point) 220 | { 221 | FVector lineVec = linePoint2 - linePoint1; 222 | FVector pointVec = point - linePoint1; 223 | 224 | float dot = FVector::DotProduct(pointVec, lineVec); 225 | 226 | //point is on side of linePoint2, compared to linePoint1 227 | if (dot > 0) 228 | { 229 | //point is on the line segment 230 | if (pointVec.Size() <= lineVec.Size()) 231 | { 232 | return 0; 233 | } 234 | 235 | //point is not on the line segment and it is on the side of linePoint2 236 | else 237 | { 238 | return 2; 239 | } 240 | } 241 | 242 | //Point is not on side of linePoint2, compared to linePoint1. 243 | //Point is not on the line segment and it is on the side of linePoint1. 244 | else 245 | { 246 | return 1; 247 | } 248 | } 249 | 250 | bool UTKMathFunctionLibrary::AreLineSegmentsCrossing(FVector pointA1, FVector pointA2, FVector pointB1, FVector pointB2) 251 | { 252 | FVector closestPointA; 253 | FVector closestPointB; 254 | int32 sideA; 255 | int32 sideB; 256 | 257 | FVector lineVecA = pointA2 - pointA1; 258 | FVector lineVecB = pointB2 - pointB1; 259 | 260 | bool valid = ClosestPointsOnTwoLines(closestPointA, closestPointB, pointA1, lineVecA.GetSafeNormal(), pointB1, lineVecB.GetSafeNormal()); 261 | 262 | //lines are not parallel 263 | if (valid) 264 | { 265 | sideA = PointOnWhichSideOfLineSegment(pointA1, pointA2, closestPointA); 266 | sideB = PointOnWhichSideOfLineSegment(pointB1, pointB2, closestPointB); 267 | 268 | if ((sideA == 0) && (sideB == 0)) 269 | { 270 | return true; 271 | } 272 | else 273 | { 274 | return false; 275 | } 276 | } 277 | 278 | //lines are parallel 279 | else 280 | { 281 | return false; 282 | } 283 | } 284 | 285 | FVector UTKMathFunctionLibrary::GridSnap(FVector A, float Grid) 286 | { 287 | return A.GridSnap(Grid); 288 | } 289 | 290 | void UTKMathFunctionLibrary::ConvertAnchorToAnchor(UObject* WorldContextObject, FAnchors CurrentAnchor, FMargin Offsets, FAnchors TargetAnchor, FMargin& ConvertedOffsets) 291 | { 292 | if (CurrentAnchor.Minimum == TargetAnchor.Minimum && CurrentAnchor.Maximum == TargetAnchor.Maximum) 293 | { 294 | ConvertedOffsets = Offsets; 295 | return; 296 | } 297 | 298 | FVector2D View = FVector2D(1, 1); 299 | UWorld* World = GEngine->GetWorldFromContextObjectChecked(WorldContextObject); 300 | if (World && World->IsGameWorld()) 301 | { 302 | if (UGameViewportClient* ViewportClient = World->GetGameViewport()) 303 | { 304 | ViewportClient->GetViewportSize(View); 305 | } 306 | } 307 | 308 | FMargin ZeroAnchorOffsets = Offsets; 309 | //Convert to 0,0 anchor first. 310 | if (CurrentAnchor.Minimum != FVector2D(0, 0) || CurrentAnchor.Maximum != FVector2D(0, 0)) 311 | { 312 | ZeroAnchorOffsets.Left = View.X * CurrentAnchor.Minimum.X + Offsets.Left; 313 | ZeroAnchorOffsets.Top = View.Y * CurrentAnchor.Minimum.Y + Offsets.Top; 314 | 315 | if (CurrentAnchor.Minimum.X != CurrentAnchor.Maximum.X) 316 | { 317 | ZeroAnchorOffsets.Right = View.X * CurrentAnchor.Maximum.X - (Offsets.Right + Offsets.Left); 318 | } 319 | if (CurrentAnchor.Minimum.Y != CurrentAnchor.Maximum.Y) 320 | { 321 | ZeroAnchorOffsets.Bottom = View.Y * CurrentAnchor.Maximum.Y - (Offsets.Bottom + Offsets.Top); 322 | } 323 | 324 | if (TargetAnchor.Minimum == FVector2D(0, 0) && TargetAnchor.Maximum == FVector2D(0, 0)) 325 | { 326 | ConvertedOffsets = ZeroAnchorOffsets; 327 | return; 328 | } 329 | } 330 | 331 | //Convert 0,0 anchor offsets to target anchor offsets. 332 | ConvertedOffsets.Left = (-View.X) * TargetAnchor.Minimum.X + ZeroAnchorOffsets.Left; 333 | ConvertedOffsets.Top = (-View.Y) * TargetAnchor.Minimum.Y + ZeroAnchorOffsets.Top; 334 | 335 | ConvertedOffsets.Right = TargetAnchor.Minimum.X != TargetAnchor.Maximum.X ? View.X * TargetAnchor.Maximum.X - (ZeroAnchorOffsets.Left + ZeroAnchorOffsets.Right) : ZeroAnchorOffsets.Right; 336 | ConvertedOffsets.Bottom = TargetAnchor.Minimum.Y != TargetAnchor.Maximum.Y ? View.Y * TargetAnchor.Maximum.Y - (ZeroAnchorOffsets.Top + ZeroAnchorOffsets.Bottom) : ZeroAnchorOffsets.Bottom; 337 | } 338 | 339 | 340 | float UTKMathFunctionLibrary::ConvertPhysicsLinearVelocity(FVector Velocity, TEnumAsByte SpeedUnit) 341 | { 342 | if (Velocity.IsZero()) return 0.f; 343 | 344 | float unit = 0; 345 | switch (SpeedUnit) 346 | { 347 | case CentimeterPerSecond: 348 | unit = 1; 349 | break; 350 | case FootPerSecond: 351 | unit = 0.03280839895013; 352 | break; 353 | case MeterPerSecond: 354 | unit = 0.01; 355 | break; 356 | case MeterPerMinute: 357 | unit = 0.6; 358 | break; 359 | case KilometerPerSecond: 360 | unit = 0.00001; 361 | case KilometerPerMinute: 362 | unit = 0.0006; 363 | break; 364 | case KilometerPerHour: 365 | unit = 0.036; 366 | break; 367 | case MilePerHour: 368 | unit = 0.02236936292054; 369 | break; 370 | case Knot: 371 | unit = 0.01943844492441; 372 | break; 373 | case Mach: 374 | unit = 0.00002915451895044; 375 | break; 376 | case SpeedOfLight: 377 | unit = 3.335640951982E-11; 378 | break; 379 | case YardPerSecond: 380 | unit = 0.01093613298338; 381 | break; 382 | default: 383 | break; 384 | }; 385 | 386 | return Velocity.Size() * unit; 387 | } 388 | 389 | FVector UTKMathFunctionLibrary::GetVelocityAtPoint(UPrimitiveComponent* Target, FVector Point, FName BoneName, bool DrawDebugInfo) 390 | { 391 | 392 | //FTransform Transform = Target->GetComponentTransform(); 393 | //FVector LocalLinearVelocity = Transform.InverseTransformVectorNoScale(Target->GetPhysicsLinearVelocity()); 394 | //FVector LocalAngularVelocity = Transform.InverseTransformVectorNoScale(Target->GetPhysicsAngularVelocity()); 395 | //FVector ResultPointVelocity = LocalLinearVelocity + FVector::CrossProduct(FVector::DegreesToRadians(LocalAngularVelocity), Transform.InverseTransformVectorNoScale(Point - Target->GetCenterOfMass())); 396 | 397 | 398 | if (!Target) return FVector::ZeroVector; 399 | 400 | //You can actually get it from the physx body instance instead. 401 | FBodyInstance* BI = Target->GetBodyInstance(BoneName); 402 | if (BI && BI->IsValidBodyInstance()) 403 | { 404 | FVector PointVelocity = BI->GetUnrealWorldVelocityAtPoint(Point); 405 | 406 | UWorld* TheWorld = Target->GetWorld(); 407 | if (DrawDebugInfo && TheWorld) 408 | { 409 | FColor DefaultColor(255,200,0); 410 | DrawDebugPoint(TheWorld, Point, 10, DefaultColor); 411 | DrawDebugString(TheWorld, Point, FString::SanitizeFloat(PointVelocity.Size()), NULL, FColor::White, 0.0f); 412 | } 413 | 414 | return PointVelocity; 415 | } 416 | return FVector::ZeroVector; 417 | } 418 | 419 | void UTKMathFunctionLibrary::SetCenterOfMassOffset(UPrimitiveComponent* Target, FVector Offset, FName BoneName) 420 | { 421 | if (!Target) return; 422 | 423 | FBodyInstance* BI = Target->GetBodyInstance(BoneName); 424 | if (BI && BI->IsValidBodyInstance()) 425 | { 426 | BI->COMNudge = Offset; 427 | BI->UpdateMassProperties(); 428 | } 429 | } 430 | -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Private/VictoryBPFunctionLibrary_WinOS.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | By Rama 3 | */ 4 | 5 | #include "VictoryBPLibraryPrivatePCH.h" 6 | #include "VictoryBPFunctionLibrary.h" 7 | 8 | #if PLATFORM_WINDOWS 9 | #include "Runtime/Core/Public/Windows/AllowWindowsPlatformTypes.h" 10 | //#include "AdditionalWindowsHeaders.h" 11 | #endif 12 | 13 | void UVictoryBPFunctionLibrary::FlashGameOnTaskBar(APlayerController* PC, bool FlashContinuous, int32 MaxFlashCount, int32 FlashFrequencyMilliseconds) 14 | { 15 | #if PLATFORM_WINDOWS 16 | if(!PC) return; 17 | 18 | //Local Player 19 | ULocalPlayer* VictoryPlayer = Cast(PC->Player); 20 | if(!VictoryPlayer) return; 21 | 22 | //Game Viewport Client 23 | UGameViewportClient* GameViewport = Cast(VictoryPlayer->ViewportClient); 24 | if(!GameViewport) return; 25 | 26 | //Slate Game Window 27 | TSharedPtr< SWindow > GWSlate = GameViewport->GetWindow(); 28 | if(!GWSlate.IsValid()) return; 29 | 30 | //Native OS Window 31 | TSharedPtr GW = GWSlate->GetNativeWindow(); 32 | if(!GW.IsValid()) return; 33 | 34 | //Windows 35 | FLASHWINFO fi; 36 | fi.cbSize = sizeof(FLASHWINFO); 37 | fi.hwnd = (HWND)GW->GetOSWindowHandle(); 38 | fi.dwFlags = FLASHW_ALL; 39 | 40 | //Continuous? <3 Rama 41 | if(FlashContinuous) 42 | { 43 | fi.dwFlags |= FLASHW_TIMERNOFG; 44 | fi.uCount = 0; 45 | fi.dwTimeout = 0; 46 | } 47 | else 48 | { 49 | fi.uCount = MaxFlashCount; 50 | fi.dwTimeout = FlashFrequencyMilliseconds; 51 | } 52 | 53 | FlashWindowEx(&fi); 54 | #endif 55 | 56 | //<3 Rama 57 | } 58 | 59 | 60 | 61 | 62 | 63 | #if PLATFORM_WINDOWS 64 | #include "Runtime/Core/Public/Windows/HideWindowsPlatformTypes.h" 65 | #endif 66 | -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Private/VictoryBPHTML.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | By Rama 3 | */ 4 | #include "VictoryBPLibraryPrivatePCH.h" 5 | #include "VictoryBPHTML.h" 6 | 7 | 8 | //! Someone should please integrate the HTML5 plugin with this code 9 | 10 | /* 11 | #if PLATFORM_HTML5 12 | #include "SDL_opengl.h" 13 | 14 | DEFINE_LOG_CATEGORY_STATIC(VictoryPluginHTML, Log, All); 15 | 16 | #include "emscripten.h" 17 | #include "html5.h" 18 | #endif 19 | */ 20 | 21 | /* 22 | bool UVictoryBPHTML::IsHTML() 23 | { 24 | 25 | #if PLATFORM_HTML5 26 | return true; 27 | #else 28 | return false; 29 | #endif 30 | 31 | return false; 32 | } 33 | */ 34 | 35 | /* 36 | void UVictoryBPHTML::VictoryHTML5_SetCursorVisible(bool MakeVisible) 37 | { 38 | if(MakeVisible) 39 | { 40 | #if PLATFORM_HTML5 41 | { 42 | emscripten_exit_pointerlock(); 43 | UE_LOG(VictoryPluginHTML, Warning, TEXT("Exiting Pointer Lock")); 44 | } 45 | #endif 46 | } 47 | else 48 | { 49 | #if PLATFORM_HTML5 50 | { 51 | emscripten_request_pointerlock ( "#canvas" , true); 52 | UE_LOG(VictoryPluginHTML, Warning, TEXT("Entering Pointer Lock")); 53 | } 54 | #endif 55 | } 56 | 57 | } 58 | */ -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Private/VictoryBPLibrary.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | By Rama 3 | */ 4 | #include "VictoryBPLibraryPrivatePCH.h" 5 | 6 | #define LOCTEXT_NAMESPACE "FVictoryBPLibraryModule" 7 | 8 | 9 | void FVictoryBPLibraryModule::StartupModule() 10 | { 11 | // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module 12 | 13 | } 14 | 15 | void FVictoryBPLibraryModule::ShutdownModule() 16 | { 17 | // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, 18 | // we call this function before unloading the module. 19 | 20 | } 21 | 22 | #undef LOCTEXT_NAMESPACE 23 | 24 | IMPLEMENT_MODULE(FVictoryBPLibraryModule, VictoryBPLibrary) -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Private/VictoryBPLibraryPrivatePCH.h: -------------------------------------------------------------------------------- 1 | /* 2 | By Rama 3 | */ 4 | #include "VictoryBPLibrary.h" -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/TKMathFunctionLibrary.h: -------------------------------------------------------------------------------- 1 | /* 2 | By TK-Master 3 | */ 4 | #pragma once 5 | 6 | //For the Anchor Conversion 7 | #include "Runtime/UMG/Public/UMG.h" 8 | 9 | #include "TKMathFunctionLibrary.generated.h" 10 | 11 | /* Speed Units Enum. */ 12 | UENUM() 13 | enum ESpeedUnit 14 | { 15 | /* Centimeter / second (cm/s). This is default unreal velocity unit. */ 16 | CentimeterPerSecond, 17 | 18 | /* Foot / second (ft/s). */ 19 | FootPerSecond, 20 | 21 | /* Meter / second (m/s). */ 22 | MeterPerSecond, 23 | 24 | /* Meter / minute (m/min). */ 25 | MeterPerMinute, 26 | 27 | /* Kilometer / second (km/s). */ 28 | KilometerPerSecond, 29 | 30 | /* Kilometer / minute (km/min). */ 31 | KilometerPerMinute, 32 | 33 | /*Kilometer / hour (km/h). */ 34 | KilometerPerHour, 35 | 36 | /* Mile / hour (mph). */ 37 | MilePerHour, 38 | 39 | /* Knot (kn). Nautical mile per hour. */ 40 | Knot, 41 | 42 | /* Mach (speed of sound) (M) at standard atm. */ 43 | Mach, 44 | 45 | /* Speed of light. */ 46 | SpeedOfLight, 47 | 48 | /* Yard / second. */ 49 | YardPerSecond 50 | }; 51 | 52 | 53 | UCLASS() 54 | class VICTORYBPLIBRARY_API UTKMathFunctionLibrary : public UBlueprintFunctionLibrary 55 | { 56 | GENERATED_BODY() 57 | 58 | public: 59 | 60 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Console") 61 | static float GetConsoleVariableFloat(FString VariableName); 62 | 63 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Console") 64 | static int32 GetConsoleVariableInt(FString VariableName); 65 | 66 | //Reverses the sign (- or +) of a float. 67 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Float") 68 | static float NegateFloat(float A); 69 | 70 | //Reverses the sign (- or +) of an integer. 71 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer") 72 | static int32 NegateInt(int32 A); 73 | 74 | //Reverses the sign (- or +) of a Vector2D. 75 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector2D") 76 | static FVector2D NegateVector2D(FVector2D A); 77 | 78 | //Changes the size (length) of a Vector to the given size (normalized vector * size). 79 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 80 | static FVector SetVectorLength(FVector A, float size); 81 | 82 | //Converts radians to degrees. 83 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 84 | static FVector VectorRadiansToDegrees(FVector RadVector); 85 | 86 | //Converts degrees to radians. 87 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 88 | static FVector VectorDegreesToRadians(FVector DegVector); 89 | 90 | /** 91 | * Rounds an integer to the lower multiple of the given number. 92 | * If Skip Self is set to True it will skip to the previous multiple if the integer rounds to itself. 93 | * @param Multiple - The multiple number to round to. 94 | * @param skipSelf - Skip to the previous multiple if the integer rounds to itself. 95 | */ 96 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer") 97 | static int32 RoundToLowerMultiple(int32 A, int32 Multiple = 32, bool skipSelf = false); 98 | 99 | /** 100 | * Rounds an integer to the upper multiple of the given number. 101 | * If Skip Self is set to True it will skip to the next multiple if the integer rounds to itself. 102 | * @param Multiple - The multiple number to round to. 103 | * @param skipSelf - Skip to the next multiple if the integer rounds to itself. 104 | */ 105 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer") 106 | static int32 RoundToUpperMultiple(int32 A, int32 Multiple = 32, bool skipSelf = false); 107 | 108 | /** Rounds an integer to the nearest multiple of the given number. */ 109 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer") 110 | static int32 RoundToNearestMultiple(int32 A, int32 Multiple = 32); 111 | 112 | /** Returns true if the integer is a power of two number. */ 113 | UFUNCTION(BlueprintPure, meta = (CompactNodeTitle = "PwrOf2"), Category = "Victory BP Library|TK-Master Math|Integer") 114 | static bool IsPowerOfTwo(int32 x); 115 | 116 | /** Returns true if the integer is a multiple of the given number. */ 117 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Integer") 118 | static bool IsMultipleOf(int32 A, int32 Multiple); 119 | 120 | /** Returns true if the number is even (false if it's odd). */ 121 | UFUNCTION(BlueprintPure, meta = (CompactNodeTitle = "isEven"), Category = "Victory BP Library|TK-Master Math|Float") 122 | static bool IsEvenNumber(float A); 123 | 124 | /** 125 | * Find closest point on a Sphere to a Line. 126 | * When line intersects Sphere, then closest point to LineOrigin is returned. 127 | * @param SphereOrigin Origin of Sphere 128 | * @param SphereRadius Radius of Sphere 129 | * @param LineOrigin Origin of line 130 | * @param LineDir Direction of line. 131 | * @return Closest point on sphere to given line. 132 | */ 133 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 134 | static FVector ClosestPointOnSphereToLine(FVector SphereOrigin, float SphereRadius, FVector LineOrigin, FVector LineDir); 135 | 136 | /** Find the point on line segment from LineStart to LineEnd which is closest to Point. */ 137 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 138 | static FVector ClosestPointOnLineSeqment(FVector Point, FVector LineStart, FVector LineEnd); 139 | 140 | /** Returns true if the given Point vector is within a box (defined by BoxOrigin and BoxExtent). */ 141 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection") 142 | static bool IsPointInsideBox(FVector Point, FVector BoxOrigin, FVector BoxExtent); 143 | 144 | /** Determines whether a line intersects a sphere. */ 145 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection") 146 | static bool IsLineInsideSphere(FVector LineStart, FVector LineDir, float LineLength, FVector SphereOrigin, float SphereRadius); 147 | 148 | /** 149 | * Swept-Box vs Box test. 150 | * Sweps a box defined by Extend from Start to End points and returns whether it hit a box or not plus the hit location and hit normal if successful. 151 | */ 152 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection") 153 | static bool LineExtentBoxIntersection(FBox inBox, FVector Start, FVector End, FVector Extent, FVector& HitLocation, FVector& HitNormal, float& HitTime); 154 | 155 | /** 156 | * Get the shortest distance between a point and a plane. 157 | * The output is signed so it holds information as to which side of the plane normal the point is. 158 | */ 159 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 160 | static float SignedDistancePlanePoint(FVector planeNormal, FVector planePoint, FVector point); 161 | 162 | /** 163 | * Returns a vector point which is a projection from a point to a line (defined by the vector couple LineOrigin, LineDirection). 164 | * The line is infinite (in both directions). 165 | */ 166 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 167 | static FVector ProjectPointOnLine(FVector LineOrigin, FVector LineDirection, FVector Point); 168 | 169 | /** 170 | * Performs a sphere vs box intersection test. 171 | * @param SphereOrigin the center of the sphere being tested against the box. 172 | * @param SphereRadius the size of the sphere being tested. 173 | * @param BoxOrigin the box origin being tested against. 174 | * @param BoxExtent the box extend (width, depth, height). 175 | * @return Whether the sphere/box intersect or not. 176 | */ 177 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection") 178 | static bool SphereBoxIntersection(FVector SphereOrigin, float SphereRadius, FVector BoxOrigin, FVector BoxExtent); 179 | 180 | /** 181 | * Find closest points between 2 line segments. 182 | * @param (Line1Start, Line1End) defines the first line segment. 183 | * @param (Line2Start, Line2End) defines the second line segment. 184 | * @param LinePoint1 Closest point on segment 1 to segment 2. 185 | * @param LinePoint2 Closest point on segment 2 to segment 1. 186 | */ 187 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection") 188 | static void ClosestPointsOfLineSegments(FVector Line1Start, FVector Line1End, FVector Line2Start, FVector Line2End, FVector& LinePoint1, FVector& LinePoint2); 189 | 190 | /** 191 | * Calculate the intersection point of two infinitely long lines. Returns true if lines intersect, otherwise false. 192 | * Note that in 3d, two lines do not intersect most of the time. 193 | * So if the two lines are not in the same plane, use Closest Points On Two Lines instead. 194 | * @param IntersectionPoint The intersection point of the lines. Returns zero if the lines do not intersect or the operation fails. 195 | * @param LinePoint1 Line point of the first line. 196 | * @param LineDir1 Line direction (normal) of the first line. Should be a normalized vector. 197 | * @param LinePoint2 Line point of the second line. 198 | * @param LineDir2 Line direction (normal) of the second line. Should be a normalized vector. 199 | * @return true if lines intersect, otherwise false. 200 | */ 201 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection") 202 | static bool LineToLineIntersection(FVector& IntersectionPoint, FVector LinePoint1, FVector LineDir1, FVector LinePoint2, FVector LineDir2); 203 | 204 | /* 205 | * Calculate the closest points between two infinitely long lines. 206 | * If lines are intersecting (not parallel) it will return false! Use Line To Line Intersection instead. 207 | * @param closestPointLine1 The closest point of line1 to line2. Returns zero if the lines intersect. 208 | * @param closestPointLine2 The closest point of line2 to line1. Returns zero if the lines intersect. 209 | * @param linePoint1 Line point of the first line. 210 | * @param lineVec1 Line direction (normal) of the first line. Should be a normalized vector. 211 | * @param linePoint2 Line point of the second line. 212 | * @param lineVec2 Line direction (normal) of the second line. Should be a normalized vector. 213 | * @return true if lines are parallel, false otherwise. 214 | */ 215 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 216 | static bool ClosestPointsOnTwoLines(FVector& closestPointLine1, FVector& closestPointLine2, FVector linePoint1, FVector lineVec1, FVector linePoint2, FVector lineVec2); 217 | 218 | /* 219 | * Returns 0 if point is on the line segment. 220 | * Returns 1 if point is not on the line segment and it is on the side of linePoint1. 221 | * Returns 2 if point is not on the line segment and it is on the side of linePoint2. 222 | */ 223 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 224 | static int32 PointOnWhichSideOfLineSegment(FVector linePoint1, FVector linePoint2, FVector point); 225 | 226 | /* 227 | * Returns true if the two line segments are intersecting and not parallel. 228 | * If you need the intersection point, use Closest Points On Two Lines. 229 | */ 230 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector|Intersection") 231 | static bool AreLineSegmentsCrossing(FVector pointA1, FVector pointA2, FVector pointB1, FVector pointB2); 232 | 233 | /*Snaps vector to nearest grid multiple.*/ 234 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 235 | static FVector GridSnap(FVector A, float Grid); 236 | 237 | /*Converts UMG layout offsets to another anchor.*/ 238 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Anchor", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 239 | static void ConvertAnchorToAnchor(UObject* WorldContextObject, FAnchors CurrentAnchor, FMargin Offsets, FAnchors TargetAnchor, FMargin& ConvertedOffsets); 240 | 241 | /*Converts Physics Linear Velocity to a more useful speed unit.*/ 242 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|TK-Master Math|Vector") 243 | static float ConvertPhysicsLinearVelocity(FVector Velocity, TEnumAsByte SpeedUnit); 244 | 245 | //------------------------------------------------------------ 246 | //Physics functions! (why aren't these exposed by Epic yet?!) 247 | 248 | /** 249 | * Get the current world velocity of a point on a physics-enabled component. 250 | * @param Point - Point in world space. 251 | * @param DrawDebugInfo - Draw debug point & string. 252 | * @param BoneName - If a SkeletalMeshComponent, name of body to get velocity of. 'None' indicates root body. 253 | * @return The velocity of the point in world space. 254 | */ 255 | UFUNCTION(BlueprintCallable, Category = "Physics") 256 | static FVector GetVelocityAtPoint(UPrimitiveComponent* Target, FVector Point, FName BoneName = NAME_None, bool DrawDebugInfo = false); 257 | 258 | /* 259 | * Set the physx center of mass offset. 260 | * Note: this offsets the physx-calculated center of mass (it is not an offset from the pivot point). 261 | */ 262 | UFUNCTION(BlueprintCallable, Category = "Physics") 263 | static void SetCenterOfMassOffset(UPrimitiveComponent* Target, FVector Offset, FName BoneName = NAME_None); 264 | 265 | }; 266 | -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/VictoryBPFunctionLibrary.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | By Rama 4 | 5 | */ 6 | #pragma once 7 | 8 | //to prevent nodes from getting called in constructors: 9 | //meta=(UnsafeDuringActorConstruction = "true") 10 | 11 | #include "VictoryISM.h" 12 | 13 | //extending UObject class 14 | #include "CoreMinimal.h" 15 | #include "UObject/Object.h" 16 | 17 | 18 | //~~~~~~~~~~~~ UMG ~~~~~~~~~~~~~~~ 19 | #include "Runtime/UMG/Public/UMG.h" 20 | #include "Runtime/UMG/Public/UMGStyle.h" 21 | #include "Runtime/UMG/Public/Slate/SObjectWidget.h" 22 | #include "Runtime/UMG/Public/IUMGModule.h" 23 | #include "Runtime/UMG/Public/Blueprint/UserWidget.h" 24 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 | 26 | //AI 27 | #include "AIController.h" //MoveToWithFilter 28 | 29 | //Audio 30 | #include "Components/AudioComponent.h" 31 | #include "AudioDecompress.h" 32 | #include "AudioDevice.h" 33 | #include "ActiveSound.h" 34 | #include "Audio.h" 35 | #include "Developer/TargetPlatform/Public/Interfaces/IAudioFormat.h" 36 | #include "VorbisAudioInfo.h" 37 | 38 | #include "Runtime/Engine/Classes/Engine/LevelStreamingDynamic.h" 39 | 40 | //Texture2D 41 | //#include "Engine/Texture2D.h" 42 | #include "DDSLoader.h" 43 | 44 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 45 | 46 | #include "VictoryBPFunctionLibrary.generated.h" 47 | 48 | // BP Library for You 49 | // 50 | // Written by Rama 51 | 52 | //note about UBlueprintFunctionLibrary 53 | // This class is a base class for any function libraries exposed to blueprints. 54 | // Methods in subclasses are expected to be static, and no methods should be added to the base class. 55 | 56 | 57 | /** 58 | Made With Love By Rama for Use with @VictoryCreateProc 59 | So that you can receive feedback from your processes. 60 | 61 | ♥ 62 | 63 | Rama 64 | */ 65 | UCLASS(Blueprintable,BlueprintType) 66 | class URamaVictoryPluginCreateProcessPipe : public UObject 67 | { 68 | GENERATED_BODY() 69 | public: 70 | 71 | UFUNCTION(BlueprintCallable, Category = "Joy Flow") 72 | bool CreatePipe(); 73 | 74 | UFUNCTION(BlueprintCallable, Category = "Joy Flow") 75 | void ClosePipe(); 76 | 77 | /** 78 | This has exec pins because it is an expensive action and the output is saved/cached on the output pin, whereas a Pure node would repeat the action many times, each time node is accessed. 79 | 80 | @Return false if the pipes were not created yet 81 | 82 | ♥ Rama 83 | */ 84 | UFUNCTION(BlueprintCallable, Category = "Joy Flow") 85 | bool ReadFromPipe(FString& PipeContents); 86 | 87 | UFUNCTION(BlueprintPure, Category = "Joy Flow") 88 | bool PipeIsValid(); 89 | 90 | public: 91 | void* ReadPipe = nullptr; 92 | void* WritePipe = nullptr; 93 | 94 | virtual void BeginDestroy() override; 95 | }; 96 | 97 | //~~~~~~~~~~~~~~~~~~~~~~ 98 | // Key Modifiers 99 | //~~~~~~~~~~~~~~~~~~~~~~ 100 | UENUM(BlueprintType) 101 | enum class EJoyImageFormats : uint8 102 | { 103 | JPG UMETA(DisplayName="JPG "), 104 | PNG UMETA(DisplayName="PNG "), 105 | BMP UMETA(DisplayName="BMP "), 106 | ICO UMETA(DisplayName="ICO "), 107 | EXR UMETA(DisplayName="EXR "), 108 | ICNS UMETA(DisplayName="ICNS ") 109 | }; 110 | 111 | //! REMOVE THIS AFTER A FEW VERSIONS 112 | //! 113 | //! 114 | UENUM(BlueprintType) 115 | enum class EVictoryHMDDevice : uint8 116 | { 117 | None UMETA(DisplayName="None"), 118 | OculusRift UMETA(DisplayName="Oculus Rift"), 119 | Morpheus UMETA(DisplayName="Morpheus"), 120 | ES2GenericStereoMesh UMETA(DisplayName="ES2 Generic Stereo Mesh"), 121 | SteamVR UMETA(DisplayName="Vive (Steam VR)"), 122 | GearVR UMETA(DisplayName="Gear VR") 123 | }; 124 | 125 | USTRUCT(BlueprintType) 126 | struct FVictoryInput 127 | { 128 | GENERATED_USTRUCT_BODY() 129 | 130 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 131 | FString ActionName; 132 | 133 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 134 | FKey Key; 135 | 136 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 137 | FString KeyAsString; 138 | 139 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 140 | uint32 bShift:1; 141 | 142 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 143 | uint32 bCtrl:1; 144 | 145 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 146 | uint32 bAlt:1; 147 | 148 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 149 | uint32 bCmd:1; 150 | 151 | 152 | FVictoryInput(){} 153 | FVictoryInput(const FString InActionName, const FKey InKey, const bool bInShift, const bool bInCtrl, const bool bInAlt, const bool bInCmd) 154 | : Key(InKey) 155 | , KeyAsString(InKey.GetDisplayName().ToString()) 156 | , bShift(bInShift) 157 | , bCtrl(bInCtrl) 158 | , bAlt(bInAlt) 159 | , bCmd(bInCmd) 160 | { 161 | ActionName = InActionName; 162 | } 163 | 164 | FVictoryInput(const FInputActionKeyMapping& Action) 165 | : Key(Action.Key) 166 | , KeyAsString(Action.Key.GetDisplayName().ToString()) 167 | , bShift(Action.bShift) 168 | , bCtrl(Action.bCtrl) 169 | , bAlt(Action.bAlt) 170 | , bCmd(Action.bCmd) 171 | { 172 | ActionName = Action.ActionName.ToString(); 173 | } 174 | }; 175 | 176 | USTRUCT(BlueprintType) 177 | struct FVictoryInputAxis 178 | { 179 | GENERATED_USTRUCT_BODY() 180 | 181 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 182 | FString AxisName = ""; 183 | 184 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 185 | FString KeyAsString = ""; 186 | 187 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 188 | FKey Key; 189 | 190 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Input Song") 191 | float Scale = 1; 192 | 193 | FVictoryInputAxis(){} 194 | FVictoryInputAxis(const FString InAxisName, FKey InKey, float InScale) 195 | : AxisName(InAxisName) 196 | , KeyAsString(InKey.GetDisplayName().ToString()) 197 | , Key(InKey) 198 | , Scale(InScale) 199 | { } 200 | 201 | FVictoryInputAxis(const FInputAxisKeyMapping& Axis) 202 | : KeyAsString(Axis.Key.GetDisplayName().ToString()) 203 | , Key(Axis.Key) 204 | , Scale(Axis.Scale) 205 | { 206 | AxisName = Axis.AxisName.ToString(); 207 | } 208 | }; 209 | 210 | UENUM(BlueprintType) 211 | namespace EJoyGraphicsFullScreen 212 | { 213 | //256 entries max 214 | enum Type 215 | { 216 | FullScreen UMETA(DisplayName="Regular Full Screen"), 217 | WindowedFullScreen UMETA(DisplayName="Windowed Full Screen High Quality"), 218 | WindowedFullScreenPerformance UMETA(DisplayName="Windowed Full Screen (Default)"), 219 | //~~~ 220 | 221 | //256th entry 222 | EJoyGraphicsFullScreen_Max UMETA(Hidden), 223 | }; 224 | } 225 | 226 | USTRUCT(BlueprintType) 227 | struct FLevelStreamInstanceInfo 228 | { 229 | GENERATED_USTRUCT_BODY() 230 | 231 | UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite) 232 | FName PackageName; 233 | 234 | UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite) 235 | FName PackageNameToLoad; 236 | 237 | UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite) 238 | FVector Location; 239 | 240 | UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite) 241 | FRotator Rotation; 242 | 243 | UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite) 244 | uint8 bShouldBeLoaded:1; 245 | 246 | UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite) 247 | uint8 bShouldBeVisible:1; 248 | 249 | UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite) 250 | uint8 bShouldBlockOnLoad:1; 251 | 252 | UPROPERTY(Category = "LevelStreaming", BlueprintReadWrite) 253 | int32 LODIndex; 254 | 255 | FLevelStreamInstanceInfo() {} 256 | 257 | FLevelStreamInstanceInfo(ULevelStreamingDynamic* LevelInstance); 258 | 259 | FString ToString() const 260 | { 261 | return FString::Printf(TEXT("PackageName: %s\nPackageNameToLoad:%s\nLocation:%s\nRotation:%s\nbShouldBeLoaded:%s\nbShouldBeVisible:%s\nbShouldBlockOnLoad:%s\nLODIndex:%i") 262 | , *PackageName.ToString() 263 | , *PackageNameToLoad.ToString() 264 | , *Location.ToString() 265 | , *Rotation.ToString() 266 | , (bShouldBeLoaded) ? TEXT("True") : TEXT("False") 267 | , (bShouldBeVisible) ? TEXT("True") : TEXT("False") 268 | , (bShouldBlockOnLoad) ? TEXT("True") : TEXT("False") 269 | , LODIndex); 270 | } 271 | }; 272 | 273 | 274 | UCLASS() 275 | class VICTORYBPLIBRARY_API UVictoryBPFunctionLibrary : public UBlueprintFunctionLibrary 276 | { 277 | GENERATED_UCLASS_BODY() 278 | 279 | //~~~~~~~~~~~~~~~~~~ 280 | // Level Generation 281 | //~~~~~~~~~~~~~~~~~~ 282 | /** Load a level to a specific location and rotation, can create multiple of the same level! 283 | * 284 | * Ensure that each InstanceNumber is unique to spawn multiple instances of the same level! 285 | * 286 | * <3 Rama 287 | * 288 | * @param MapFolderOffOfContent - Maps or Maps/TileSets/TileSet1 etc 289 | * @param LevelName - Just the level name itself, such as Tile1 290 | * @param InstanceNumber - Ensure this is unique by keeping count to spawn as many instances of same level as you want! 291 | * @param Location - Worldspace location where the level should be spawned 292 | * @param Rotation - Worldspace rotation for rotating the entire level 293 | * @return false if the level name was not found 294 | */ 295 | 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")) 296 | static ULevelStreaming* VictoryLoadLevelInstance(UObject* WorldContextObject, FString MapFolderOffOfContent, FString LevelName, int32 InstanceNumber, FVector Location, FRotator Rotation,bool& Success); 297 | 298 | //~~~~~~~~~~ 299 | // AI 300 | //~~~~~~~~~~ 301 | /** Move to Location with optional Query Filter! 302 | * 303 | * 1. Create Custon Nav Area Classes. 304 | * 305 | * 2. Use Nav Modifier Volumes to apply custom area class data within the level, then 306 | * 307 | * 3. Create Query Filters which alter/exclude those custom nav areas. 308 | * 309 | * 4. Can then choose to use the filters per character or even per Move To using this node. 310 | * 311 | * <3 Rama 312 | * 313 | * @param FilterClass - Allows different types of units to path in different ways all the time, or path differently per Move To using this node! 314 | * @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 315 | * @param bStopOnOverlap - Add pawn's radius to AcceptanceRadius 316 | * @param bCanStrafe - Set focus related flag: bAllowStrafe 317 | * @return Whether the Pawn's AI Controller is valid and goal can be pathed to 318 | */ 319 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|AI") 320 | static EPathFollowingRequestResult::Type Victory_AI_MoveToWithFilter( 321 | APawn* Pawn, 322 | const FVector& Dest, 323 | TSubclassOf FilterClass = NULL, 324 | float AcceptanceRadius = 0, 325 | bool bProjectDestinationToNavigation = false, 326 | bool bStopOnOverlap = false, 327 | bool bCanStrafe = false 328 | ); 329 | 330 | //~~~~~~~~~~~~~~~~ 331 | // GPU <3 Rama 332 | //~~~~~~~~~~~~~~~~ 333 | 334 | UFUNCTION(BlueprintPure,Category="Victory BP Library|GPU") 335 | static FString Victory_GetGPUBrand() 336 | { 337 | return FPlatformMisc::GetPrimaryGPUBrand(); 338 | } 339 | UFUNCTION(BlueprintPure,Category="Victory BP Library|GPU", meta=(Keywords="GPU")) 340 | static FString Victory_GetGRHIAdapterName() 341 | { 342 | return GRHIAdapterName; 343 | } 344 | 345 | UFUNCTION(BlueprintPure,Category="Victory BP Library|GPU") 346 | static void Victory_GetGPUInfo(FString& DeviceDescription, FString& Provider, FString& DriverVersion, FString& DriverDate); 347 | 348 | //~~~~~~~~~~ 349 | // Core 350 | //~~~~~~~~~~ 351 | 352 | /** 353 | Launch a new process, if it is not set to be detached, UE4 will not fully close until the other process completes. 354 | 355 | The new process id is returned! 356 | 357 | @param Detach Ensure completion before UE4 closes or not? Detach = UE4 can close and process will keep going / possibly never stop running as there is no one left to stop the process now ♥ Rama 358 | 359 | @param Priority Priority options: -2 idle, -1 low, 0 normal, 1 high, 2 higher 360 | 361 | @param ReadPipeObject Construct a new object of class URamaVictoryPluginCreateProcessPipe if you want to capture the output (STDOUT or STDERR) of this process! ♥♥♥ Yes ♥♥♥ !!!! (call ReadFromPipe on the object over time, in a timer, after creating the procedure, remember to nullptr Your Object Reference after closing the pipe, so that UE4 will garbage-collect the object! ) 362 | 363 | ♥ Rama 364 | */ 365 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|System") 366 | static void VictoryCreateProc(int32& ProcessId, FString FullPathOfProgramToRun,TArray CommandlineArgs,bool Detach,bool Hidden, int32 Priority=0, FString OptionalWorkingDirectory="", URamaVictoryPluginCreateProcessPipe* ReadPipeObject=nullptr); 367 | 368 | /** You can obtain ProcessID from processes you initiate via VictoryCreateProc */ 369 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|System") 370 | static FString VictoryGetApplicationName(int32 ProcessId) 371 | { 372 | //Please note it should really be uint32 but that is not supported by BP yet 373 | return FPlatformProcess::GetApplicationName(ProcessId); 374 | } 375 | 376 | /** You can obtain ProcessID from processes you initiate via VictoryCreateProc */ 377 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|System") 378 | static bool VictoryIsApplicationRunning( int32 ProcessId ) 379 | { 380 | //Please note it should really be uint32 but that is not supported by BP yet 381 | return FPlatformProcess::IsApplicationRunning(ProcessId); 382 | } 383 | /* 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*/ 384 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|System") 385 | static int64 GetUnixTimeStamp(const FDateTime& UTCTime) 386 | { 387 | //Please note it should really be int64 but that is not supported by BP yet 388 | return UTCTime.ToUnixTimestamp(); 389 | } 390 | /* 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*/ 391 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|System") 392 | static void GetUTCFromUnixTimeStamp(int64 UnixTimeStamp, FDateTime& UTCTime) 393 | { 394 | //Please note it should really be int64 but that is not supported by BP yet 395 | UTCTime = FDateTime::FromUnixTimestamp( UnixTimeStamp ); 396 | } 397 | 398 | UFUNCTION(BlueprintPure, Category = "Rama Save System|File IO") 399 | static void UTCToLocal(const FDateTime& UTCTime, FDateTime& LocalTime) 400 | { 401 | //Turn UTC into local ♥ Rama 402 | FTimespan UTCOffset = FDateTime::Now() - FDateTime::UtcNow(); 403 | LocalTime = UTCTime; 404 | LocalTime += UTCOffset; 405 | //♥ Rama 406 | } 407 | 408 | /** 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*/ 409 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|MD5") 410 | static bool CreateMD5Hash(FString FileToHash, FString FileToStoreHashTo ); 411 | 412 | /** 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 */ 413 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|MD5") 414 | static bool CompareMD5Hash(FString MD5HashFile1, FString MD5HashFile2 ); 415 | 416 | /** Dynamically change how frequently in seconds a component will tick! Can be altered at any point during game-time! ♥ Rama */ 417 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|System") 418 | static void SetComponentTickRate(UActorComponent* Component, float Seconds) 419 | { 420 | if(!Component) return; 421 | Component->PrimaryComponentTick.TickInterval = Seconds; 422 | } 423 | 424 | /** Retrieves command line arguments that were passed into unreal */ 425 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|System") 426 | static const FString GetCommandLine() 427 | { 428 | return FCommandLine::Get(); 429 | } 430 | 431 | /** 432 | * Create a new Texture Render Target 2D, ideal for use with Scene Capture Components created during runtime that need their own unique Render Targets 433 | * @param Width Texture Width 434 | * @param Height Texture Height 435 | * @param ClearColor The color the texture is cleared to 436 | * @param Gamma Will override FTextureRenderTarget2DResource::GetDisplayGamma if > 0. 437 | * @return A new Texture Render Target 2D! 438 | * 439 | */ 440 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc") 441 | static UTextureRenderTarget2D* CreateTextureRenderTarget2D(int32 Width=256, int32 Height=256, FLinearColor ClearColor = FLinearColor::White, float Gamma = 1) 442 | { 443 | UTextureRenderTarget2D* NewRenderTarget2D = NewObject(); 444 | if(!NewRenderTarget2D) 445 | { 446 | return nullptr; 447 | } 448 | NewRenderTarget2D->ClearColor = ClearColor; 449 | NewRenderTarget2D->TargetGamma = Gamma; 450 | NewRenderTarget2D->InitAutoFormat(Width, Height); 451 | return NewRenderTarget2D; 452 | } 453 | 454 | //~~~~~~~~~~ 455 | // Physics 456 | //~~~~~~~~~~ 457 | 458 | /** 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. */ 459 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics") 460 | static bool VictoryPhysics_UpdateAngularDamping(UPrimitiveComponent* CompToUpdate, float NewAngularDamping); 461 | 462 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Physics", meta=(Keywords="Closest Surface")) 463 | static float GetDistanceToCollision(UPrimitiveComponent* CollisionComponent, const FVector& Point, FVector& ClosestPointOnCollision); 464 | 465 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Physics", meta=(Keywords="Closest Surface")) 466 | static float GetDistanceBetweenComponentSurfaces(UPrimitiveComponent* CollisionComponent1, UPrimitiveComponent* CollisionComponent2, FVector& PointOnSurface1, FVector& PointOnSurface2); 467 | 468 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics", meta=(Keywords="APEX Piece fracture damage PhysX Physics")) 469 | static bool VictoryDestructible_DestroyChunk(UDestructibleComponent* DestructibleComp, int32 HitItem); 470 | 471 | 472 | //~~~~~~~~~~ 473 | // Joy ISM 474 | //~~~~~~~~~~ 475 | 476 | /** Retrieve an array of all of the Victory Instanced Static Mesh Actors that have been created during runtime! */ 477 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Instanced Static Mesh",meta=(WorldContext="WorldContextObject")) 478 | static void VictoryISM_GetAllVictoryISMActors(UObject* WorldContextObject, TArray& Out); 479 | 480 | /** 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! */ 481 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Instanced Static Mesh",meta=(WorldContext="WorldContextObject")) 482 | static void VictoryISM_ConvertToVictoryISMActors(UObject* WorldContextObject, TSubclassOf ActorClass, TArray& CreatedISMActors, bool DestroyOriginalActors=true, int32 MinCountToCreateISM=2); 483 | 484 | //~~~~~~~~~~ 485 | // File I/O 486 | //~~~~~~~~~~ 487 | 488 | /** 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. */ 489 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO") 490 | static bool JoyFileIO_GetFiles(TArray& Files, FString RootFolderFullPath, FString Ext); 491 | 492 | /** 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. */ 493 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO") 494 | static bool JoyFileIO_GetFilesInRootAndAllSubFolders(TArray& Files, FString RootFolderFullPath, FString Ext); 495 | 496 | /** Obtain a listing of all SaveGame file names that were saved using the Blueprint Save Game system. */ 497 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO") 498 | static void SaveGameObject_GetAllSaveSlotFileNames(TArray& FileNames); 499 | 500 | /** Obtain the last SaveGame file that was saved using the Blueprint Save Game system. */ 501 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO") 502 | static void SaveGameObject_GetMostRecentSaveSlotFileName(FString& FileName, bool& bFound); 503 | 504 | /** 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 */ 505 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Screenshots", meta=(Keywords="High resolution")) 506 | static bool ScreenShots_Rename_Move_Most_Recent(FString& OriginalFileName, FString NewName, FString NewAbsoluteFolderPath, bool HighResolution=true); 507 | 508 | //~~~~ Key Re Binding ! ~~~~ 509 | 510 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding") 511 | static void VictoryGetAllAxisAndActionMappingsForKey(FKey Key, TArray& ActionBindings, TArray& AxisBindings); 512 | 513 | // Axis Mapping 514 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding") 515 | static FVictoryInputAxis VictoryGetVictoryInputAxis(const FKeyEvent& KeyEvent); 516 | 517 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding") 518 | static void VictoryGetAllAxisKeyBindings(TArray& Bindings); 519 | 520 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Key Rebinding") 521 | static void VictoryRemoveAxisKeyBind(FVictoryInputAxis ToRemove); 522 | 523 | /** You can leave the AsString field blank :) Returns false if the key could not be found as an existing mapping! Enjoy! <3 Rama */ 524 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Key Rebinding") 525 | static bool VictoryReBindAxisKey(FVictoryInputAxis Original, FVictoryInputAxis NewBinding); 526 | 527 | static FORCEINLINE void UpdateAxisMapping(FInputAxisKeyMapping& Destination, const FVictoryInputAxis& VictoryInputBind) 528 | { 529 | Destination.Key = VictoryInputBind.Key; 530 | Destination.Scale = VictoryInputBind.Scale; 531 | } 532 | 533 | 534 | // Action Mapping 535 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding") 536 | static FVictoryInput VictoryGetVictoryInput(const FKeyEvent& KeyEvent); 537 | 538 | static FORCEINLINE void UpdateActionMapping(FInputActionKeyMapping& Destination, const FVictoryInput& VictoryInputBind) 539 | { 540 | Destination.Key = VictoryInputBind.Key; 541 | Destination.bShift = VictoryInputBind.bShift; 542 | Destination.bCtrl = VictoryInputBind.bCtrl; 543 | Destination.bAlt = VictoryInputBind.bAlt; 544 | Destination.bCmd = VictoryInputBind.bCmd; 545 | } 546 | 547 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Key Rebinding") 548 | static void VictoryGetAllActionKeyBindings(TArray& Bindings); 549 | 550 | /** You can leave the AsString field blank :) Returns false if the key could not be found as an existing mapping! Enjoy! <3 Rama */ 551 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Key Rebinding") 552 | static bool VictoryReBindActionKey(FVictoryInput Original, FVictoryInput NewBinding); 553 | 554 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Key Rebinding") 555 | static void VictoryRemoveActionKeyBind(FVictoryInput ToRemove); 556 | 557 | //~~~~~~~~~~~~~~~~~~~~ 558 | 559 | /** 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. */ 560 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Sound") 561 | static bool VictorySoundVolumeChange(USoundClass* SoundClassObject, float NewVolume); 562 | 563 | /** Get Current Sound Volume! Returns -1 if sound class was not found*/ 564 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Sound") 565 | static float VictoryGetSoundVolume(USoundClass* SoundClassObject); 566 | 567 | //~~~~~~~~~~~~~~~~~~~~ 568 | 569 | /** The number of seconds that this actor has been in play, relative to Get Game Time In Seconds. */ 570 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Actor") 571 | static float GetTimeInPlay(AActor* Actor) 572 | { 573 | if(!Actor) return -1; 574 | 575 | UWorld* World = Actor->GetWorld(); 576 | 577 | //Use FApp Current Time as a back up 578 | float CurrentTime = (World) ? World->GetTimeSeconds() : FApp::GetCurrentTime(); 579 | return CurrentTime - Actor->CreationTime; 580 | } 581 | 582 | /** 583 | * Creates a plane centered on a world space point with a facing direction of Normal. 584 | * 585 | * @param Center The world space point the plane should be centered on (easy to observe with DrawDebugPlane) 586 | * @param Normal The facing direction of the plane (can receive a Rotator) 587 | * @return Plane coordinates 588 | */ 589 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Math|Plane", meta=(Keywords="make base plane")) 590 | static FPlane CreatePlane(FVector Center, FVector Normal) 591 | { 592 | return FPlane(Center,Normal); 593 | } 594 | 595 | /** >0: point is in front of the plane, <0: behind, =0: on the plane **/ 596 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Math|Plane") 597 | static void PointDistanceToPlane(const FPlane& Plane, FVector Point,float& Distance) 598 | { 599 | Distance = Plane.PlaneDot(Point); 600 | } 601 | 602 | /** Use a larger tolerance to allow inaccuracy of measurement in certain situations */ 603 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Math|Plane") 604 | static bool IsPointOnPlane(const FPlane& Plane, FVector Point, float Tolerance= 0.01) 605 | { 606 | return FMath::Abs(Plane.PlaneDot(Point)) < Tolerance; 607 | } 608 | 609 | /** Easily add to an integer! <3 Rama*/ 610 | UFUNCTION(BlueprintCallable, meta = (CompactNodeTitle = "+=",Keywords = "increment integer"), Category = "Victory BP Library|Math|Integer") 611 | static void VictoryIntPlusEquals(UPARAM(ref) int32& Int, int32 Add, int32& IntOut); 612 | 613 | /** Easily subtract from an integer! <3 Rama*/ 614 | UFUNCTION(BlueprintCallable, meta = (CompactNodeTitle = "-=",Keywords = "decrement integer"), Category = "Victory BP Library|Math|Integer") 615 | static void VictoryIntMinusEquals(UPARAM(ref) int32& Int, int32 Sub, int32& IntOut); 616 | 617 | /** Easily add to a float! <3 Rama*/ 618 | UFUNCTION(BlueprintCallable, meta = (CompactNodeTitle = "+=",Keywords = "increment float"), Category = "Victory BP Library|Math|Float") 619 | static void VictoryFloatPlusEquals(UPARAM(ref) float& Float, float Add, float& FloatOut); 620 | 621 | /** Easily subtract from a float! <3 Rama*/ 622 | UFUNCTION(BlueprintCallable, meta = (CompactNodeTitle = "-=",Keywords = "decrement float"), Category = "Victory BP Library|Math|Float") 623 | static void VictoryFloatMinusEquals(UPARAM(ref) float& Float, float Sub, float& FloatOut); 624 | 625 | /** Sort an integer array, smallest value will be at index 0 after sorting. Modifies the input array, no new data created. <3 Rama */ 626 | UFUNCTION(BlueprintCallable, meta = (Keywords = "sort integer array"), Category = "Victory BP Library|Array") 627 | static void VictorySortIntArray(UPARAM(ref) TArray& IntArray, TArray& IntArrayRef); 628 | 629 | /** Sort a float array, smallest value will be at index 0 after sorting. Modifies the input array, no new data created. */ 630 | UFUNCTION(BlueprintCallable, meta = (Keywords = "sort float array"), Category = "Victory BP Library|Array") 631 | static void VictorySortFloatArray(UPARAM(ref) TArray& FloatArray, TArray& FloatArrayRef); 632 | 633 | 634 | /* Returns true if vector2D A is equal to vector2D B (A == B) within a specified error tolerance */ 635 | UFUNCTION(BlueprintPure, meta=(DisplayName = "Equal (vector2D)", CompactNodeTitle = "==", Keywords = "== equal"), Category="Victory BP Library|Math|Vector2D") 636 | static bool EqualEqual_Vector2DVector2D(FVector2D A, FVector2D B, float ErrorTolerance = 1.e-4f) 637 | { 638 | return A.Equals(B,ErrorTolerance); 639 | } 640 | 641 | /* Returns true if vector2D A is not equal to vector2D B (A != B) within a specified error tolerance */ 642 | UFUNCTION(BlueprintPure, meta=(DisplayName = "Not Equal (vector2D)", CompactNodeTitle = "!=", Keywords = "!= not equal"), Category="Victory BP Library|Math|Vector2D") 643 | static bool NotEqual_Vector2DVector2D(FVector2D A, FVector2D B, float ErrorTolerance = 1.e-4f) 644 | { 645 | return !A.Equals(B,ErrorTolerance); 646 | } 647 | 648 | //~~~ 649 | 650 | /** 651 | * Tries to reach Target based on distance from Current position, giving a nice smooth feeling when tracking a position. 652 | * 653 | * @param Current Actual position 654 | * @param Target Target position 655 | * @param DeltaTime Time since last tick 656 | * @param InterpSpeed Interpolation speed 657 | * @return New interpolated position 658 | */ 659 | //UFUNCTION(BlueprintPure, Category="Math|Interpolation", meta=(Keywords="position")) 660 | UFUNCTION(BlueprintPure, Category="Victory BP Library|Math", meta=(Keywords="position")) 661 | static FVector2D Vector2DInterpTo(FVector2D Current, FVector2D Target, float DeltaTime, float InterpSpeed); 662 | 663 | /** 664 | * Tries to reach Target at a constant rate. 665 | * 666 | * @param Current Actual position 667 | * @param Target Target position 668 | * @param DeltaTime Time since last tick 669 | * @param InterpSpeed Interpolation speed 670 | * @return New interpolated position 671 | */ 672 | //UFUNCTION(BlueprintPure, Category="Math|Interpolation", meta=(Keywords="position")) 673 | UFUNCTION(BlueprintPure, Category="Victory BP Library|Math", meta=(Keywords="position")) 674 | static FVector2D Vector2DInterpTo_Constant(FVector2D Current, FVector2D Target, float DeltaTime, float InterpSpeed); 675 | 676 | //~~~ Text To Number ~~~ 677 | 678 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion") 679 | static bool Text_IsNumeric(const FText& Text) 680 | { 681 | return Text.IsNumeric(); 682 | } 683 | 684 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion", meta=(AdvancedDisplay = "1")) 685 | static float Text_ToFloat(const FText& Text, bool UseDotForThousands=false) 686 | { 687 | //because commas lead to string number being truncated, FText 10,000 becomes 10 for FString 688 | FString StrFloat = Text.ToString(); 689 | TextNumFormat(StrFloat,UseDotForThousands); 690 | return FCString::Atof(*StrFloat); 691 | } 692 | 693 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion", meta=(AdvancedDisplay = "1")) 694 | static int32 Text_ToInt(const FText& Text, bool UseDotForThousands=false) 695 | { 696 | //because commas lead to string number being truncated, FText 10,000 becomes 10 for FString 697 | FString StrInt = Text.ToString(); 698 | TextNumFormat(StrInt,UseDotForThousands); 699 | return FCString::Atoi(*StrInt); 700 | } 701 | 702 | static void TextNumFormat(FString& StrNum, bool UseDotForThousands) 703 | { 704 | //10.000.000,997 705 | if(UseDotForThousands) 706 | { 707 | StrNum.ReplaceInline(TEXT("."),TEXT("")); //no dots as they truncate 708 | StrNum.ReplaceInline(TEXT(","),TEXT(".")); //commas become decimal 709 | } 710 | 711 | //10,000,000.997 712 | else 713 | { 714 | StrNum.ReplaceInline(TEXT(","),TEXT("")); //decimal can stay, commas would truncate so remove 715 | } 716 | } 717 | 718 | //~~~ End of Text To Number ~~~ 719 | 720 | /** 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) */ 721 | UFUNCTION(BlueprintPure, Category="Victory BP Library|Math", meta=(Keywords = "get mapped value clamped")) 722 | static float MapRangeClamped(float Value, float InRangeA, float InRangeB, float OutRangeA, float OutRangeB); 723 | 724 | /** Server Travel! This is an async load level process which allows you to put up a UMG widget while the level loading occurs! */ 725 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|System",meta=(WorldContext="WorldContextObject")) 726 | static void ServerTravel(UObject* WorldContextObject,FString MapName, bool bSkipNotifyPlayers=false); 727 | 728 | /** Get a Player Start by Name! */ 729 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|System",meta=(WorldContext="WorldContextObject")) 730 | static APlayerStart* GetPlayerStart(UObject* WorldContextObject,FString PlayerStartName); 731 | 732 | /** Convert String Back To Vector. IsValid indicates whether or not the string could be successfully converted. */ 733 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion",meta=(DisplayName = "String to Vector", CompactNodeTitle = "->")) 734 | static void Conversions__StringToVector(const FString& String, FVector& ConvertedVector, bool& IsValid); 735 | 736 | /** Convert String Back To Rotator. IsValid indicates whether or not the string could be successfully converted. */ 737 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion",meta=(DisplayName = "String to Rotator", CompactNodeTitle = "->")) 738 | static void Conversions__StringToRotator(const FString& String, FRotator& ConvertedRotator, bool& IsValid); 739 | 740 | /** Convert String Back To Color. IsValid indicates whether or not the string could be successfully converted. */ 741 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion",meta=(DisplayName = "String to Color", CompactNodeTitle = "->")) 742 | static void Conversions__StringToColor(const FString& String, FLinearColor& ConvertedColor, bool& IsValid); 743 | 744 | /** Convert Color to String! */ 745 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion",meta=(DisplayName = "Color to String ", CompactNodeTitle = "~>")) 746 | static void Conversions__ColorToString(const FLinearColor& Color, FString& ColorAsString); 747 | 748 | /** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 749 | //UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars!") 750 | //static uint8 Victory_ConvertStringToByte(UEnum* Enum,FString String); 751 | //! not working yet, always getting 255 752 | 753 | /** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 754 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars") 755 | static bool VictoryGetCustomConfigVar_Bool(FString SectionName, FString VariableName, bool& IsValid); 756 | 757 | /** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 758 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars") 759 | static int32 VictoryGetCustomConfigVar_Int(FString SectionName, FString VariableName, bool& IsValid); 760 | 761 | /** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 762 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars") 763 | static float VictoryGetCustomConfigVar_Float(FString SectionName, FString VariableName, bool& IsValid); 764 | 765 | /** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 766 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars") 767 | static FVector VictoryGetCustomConfigVar_Vector(FString SectionName, FString VariableName, bool& IsValid); 768 | 769 | /** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 770 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars") 771 | static FRotator VictoryGetCustomConfigVar_Rotator(FString SectionName, FString VariableName, bool& IsValid); 772 | 773 | /** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 774 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars") 775 | static FLinearColor VictoryGetCustomConfigVar_Color(FString SectionName, FString VariableName, bool& IsValid); 776 | 777 | /** Get Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 778 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars") 779 | static FString VictoryGetCustomConfigVar_String(FString SectionName, FString VariableName, bool& IsValid); 780 | 781 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Custom Config Vars") 782 | static FVector2D VictoryGetCustomConfigVar_Vector2D(FString SectionName, FString VariableName, bool& IsValid); 783 | 784 | //~~~~~~~~~~~~~~~~~~~~ 785 | 786 | /** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 787 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars") 788 | static void VictorySetCustomConfigVar_Vector2D(FString SectionName, FString VariableName, FVector2D Value); 789 | 790 | /** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 791 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars") 792 | static void VictorySetCustomConfigVar_Bool(FString SectionName, FString VariableName, bool Value); 793 | 794 | /** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 795 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars") 796 | static void VictorySetCustomConfigVar_Int(FString SectionName, FString VariableName, int32 Value); 797 | 798 | /** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 799 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars") 800 | static void VictorySetCustomConfigVar_Float(FString SectionName, FString VariableName, float Value); 801 | 802 | /** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 803 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars") 804 | static void VictorySetCustomConfigVar_Vector(FString SectionName, FString VariableName, FVector Value); 805 | 806 | /** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 807 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars") 808 | static void VictorySetCustomConfigVar_Rotator(FString SectionName, FString VariableName, FRotator Value); 809 | 810 | /** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 811 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars") 812 | static void VictorySetCustomConfigVar_Color(FString SectionName, FString VariableName, FLinearColor Value); 813 | 814 | 815 | /** Set Custom Config Var! These are stored in Saved/Config/Windows/Game.ini */ 816 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Custom Config Vars") 817 | static void VictorySetCustomConfigVar_String(FString SectionName, FString VariableName, FString Value); 818 | 819 | 820 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Transform") 821 | FRotator TransformVectorToActorSpaceAngle(AActor* Actor, const FVector& InVector); 822 | 823 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Transform") 824 | FVector TransformVectorToActorSpace(AActor* Actor, const FVector& InVector); 825 | 826 | 827 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|UMG", meta=(keywords="HMD vive oculus rift gearvr morpheus")) 828 | static FName GetHeadMountedDisplayDeviceType(); 829 | 830 | 831 | /** 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 */ 832 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc") 833 | static UObject* LoadObjectFromAssetPath(TSubclassOf ObjectClass, FName Path, bool& IsValid); 834 | 835 | /** Uses the same format as I use for LoadObjectFromAssetPath! Use this node to get the asset path of objects in the world! -Rama */ 836 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Misc") 837 | static FName GetObjectPath(UObject* Obj); 838 | 839 | 840 | /** Find all widgets of a certain class! Top level only means only widgets that are directly added to the viewport will be found */ 841 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|UMG", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject", DeterminesOutputType = "WidgetClass", DynamicOutputParam = "FoundWidgets")) 842 | static void GetAllWidgetsOfClass(UObject* WorldContextObject, TSubclassOf WidgetClass, TArray& FoundWidgets, bool TopLevelOnly = true); 843 | 844 | /** Remove all widgets of a certain class from viewport! */ 845 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|UMG", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 846 | static void RemoveAllWidgetsOfClass(UObject* WorldContextObject, TSubclassOf WidgetClass); 847 | 848 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|UMG", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 849 | static bool IsWidgetOfClassInViewport(UObject* WorldContextObject, TSubclassOf WidgetClass); 850 | 851 | /** Handy helper to check if a Key Event was for specified Key ♥ Rama*/ 852 | UFUNCTION(BlueprintPure,Category="Victory BP Library|UMG", meta = (Keywords = "== match same equal")) 853 | static void JoyIsKey(const FKeyEvent& KeyEvent, FKey Key, bool& Ctrl, bool& Shift, bool& Alt, bool& Cmd, bool& Match) 854 | { 855 | Ctrl = KeyEvent.IsControlDown(); 856 | Alt = KeyEvent.IsAltDown(); 857 | Shift = KeyEvent.IsShiftDown(); 858 | Cmd = KeyEvent.IsCommandDown(); 859 | Match = KeyEvent.GetKey() == Key; 860 | } 861 | 862 | /** 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! */ 863 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Networking") 864 | static int32 GetPlayerUniqueNetID(); 865 | 866 | /** 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. */ 867 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc") 868 | static void Loops_ResetBPRunawayCounter(); 869 | 870 | /** Set the Max Frame Rate. Min value is 10. */ 871 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Graphics Settings") 872 | static void GraphicsSettings__SetFrameRateCap(float NewValue); 873 | 874 | /** Only hardware dependent, no smoothing */ 875 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Graphics Settings") 876 | static void GraphicsSettings__SetFrameRateToBeUnbound(); 877 | 878 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc") 879 | static FVector2D ProjectWorldToScreenPosition(const FVector& WorldLocation); 880 | 881 | /** Make sure to save off the return value as a global variable in one of your BPs or else it will get garbage collected! */ 882 | 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")) 883 | static UObject* CreateObject(UObject* WorldContextObject, UClass* TheObjectClass); 884 | 885 | /** Make sure to save off the return value as a global variable in one of your BPs or else it will get garbage collected! */ 886 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 887 | static UPrimitiveComponent* CreatePrimitiveComponent(UObject* WorldContextObject, TSubclassOf CompClass, FName Name, FVector Location, FRotator Rotation); 888 | 889 | 890 | 891 | /** Spawn an Actor and choose which level you want them to spawn into! */ 892 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Actor", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 893 | static AActor* SpawnActorIntoLevel(UObject* WorldContextObject, TSubclassOf ActorClass, FName Level = NAME_None, FVector Location = FVector::ZeroVector, FRotator Rotation = FRotator::ZeroRotator, bool SpawnEvenIfColliding = true); 894 | 895 | /** Get the names of all currently loaded and visible levels! */ 896 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|System", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 897 | static void GetNamesOfLoadedLevels(UObject* WorldContextObject, TArray& NamesOfLoadedLevels); 898 | 899 | 900 | 901 | 902 | /** 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 */ 903 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Actor") 904 | static bool GetStaticMeshVertexLocations(UStaticMeshComponent* Comp, TArray& VertexPositions); 905 | 906 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Actor") 907 | static void AddToActorRotation(AActor* TheActor, FRotator AddRot); 908 | 909 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 910 | static void DrawCircle( 911 | UObject* WorldContextObject, 912 | FVector Center, 913 | float Radius, 914 | int32 NumPoints = 32, 915 | float Thickness = 7, 916 | FLinearColor LineColor = FLinearColor::Red, 917 | FVector YAxis = FVector(0, 1, 0), 918 | FVector ZAxis = FVector(0, 0, 1), 919 | float Duration = 0, 920 | bool PersistentLines = false 921 | ); 922 | 923 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|AI",meta=(WorldContext="WorldContextObject")) 924 | static AActor* GetClosestActorOfClassInRadiusOfLocation(UObject* WorldContextObject, TSubclassOf ActorClass, FVector Center, float Radius, bool& IsValid); 925 | 926 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|AI",meta=(WorldContext="WorldContextObject")) 927 | static AActor* GetClosestActorOfClassInRadiusOfActor(UObject* WorldContextObject, TSubclassOf ActorClass, AActor* ActorCenter, float Radius, bool& IsValid); 928 | 929 | /** 930 | * Generates a box that is guaranteed to contain all of the supplied points. 931 | * 932 | * @param Points The world space points that the box will encompass. 933 | */ 934 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Misc") 935 | static void GetBoxContainingWorldPoints(const TArray& Points, FVector& Center, FVector& Extent) 936 | { 937 | FBox Box(ForceInit); 938 | 939 | for(const FVector& Each : Points) 940 | { 941 | Box += Each; 942 | } 943 | Center = Box.GetCenter(); 944 | Extent = Box.GetExtent(); 945 | } 946 | 947 | /** 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*/ 948 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 949 | static void Selection_SelectionBox(UObject* WorldContextObject, TArray& SelectedActors, FVector2D AnchorPoint, FVector2D DraggedPoint, TSubclassOf ClassFilter); 950 | 951 | 952 | /** Get the Controller ID for a supplied Player Controller <3 Rama. Returns false if operation could not occur. */ 953 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Controller") 954 | static bool PlayerController_GetControllerID(APlayerController* ThePC, int32& ControllerID); 955 | 956 | /** 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*/ 957 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Networking") 958 | static bool PlayerState_GetPlayerID(APlayerController* ThePC, int32& PlayerID); 959 | 960 | /** Returns whether this game instance is single player. <3 Rama*/ 961 | UFUNCTION(BlueprintPure, Category="Victory BP Library|Networking", meta=(Keywords="SinglePlayer multiplayer", WorldContext="WorldContextObject")) 962 | static bool IsStandAlone(UObject* WorldContextObject) 963 | { 964 | UWorld* World = GEngine->GetWorldFromContextObjectChecked( WorldContextObject ); 965 | return World ? (World->GetNetMode() == NM_Standalone) : false; 966 | } 967 | 968 | 969 | /** Launches the specified URL in the OS default web browser :) <3 Rama */ 970 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|System") 971 | static void Open_URL_In_Web_Browser(FString TheURL); 972 | 973 | 974 | 975 | /** Returns which platform the game code is running in.*/ 976 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System") 977 | static void OperatingSystem__GetCurrentPlatform( 978 | bool& Windows_, 979 | bool& Mac, 980 | bool& Linux, 981 | bool& iOS, 982 | bool& Android, 983 | bool& Android_ARM, 984 | bool& Android_Vulkan, 985 | bool& PS4, 986 | bool& XBoxOne, 987 | bool& HTML5, 988 | bool& Apple 989 | ); 990 | 991 | //~~~ 992 | 993 | /** 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! */ 994 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System") 995 | static FString RealWorldTime__GetCurrentOSTime( 996 | int32& MilliSeconds, 997 | int32& Seconds, 998 | int32& Minutes, 999 | int32& Hours12, 1000 | int32& Hours24, 1001 | int32& Day, 1002 | int32& Month, 1003 | int32& Year 1004 | ); 1005 | 1006 | /** 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! */ 1007 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System") 1008 | static void RealWorldTime__GetTimePassedSincePreviousTime( 1009 | const FString& PreviousTime, 1010 | float& Milliseconds, 1011 | float& Seconds, 1012 | float& Minutes, 1013 | float& Hours 1014 | ); 1015 | 1016 | /** Get the difference between two recorded times! You can use this to record milliseconds/seconds/minutes/hours between events in game logic! */ 1017 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System") 1018 | static void RealWorldTime__GetDifferenceBetweenTimes( 1019 | const FString& PreviousTime1, 1020 | const FString& PreviousTime2, 1021 | float& Milliseconds, 1022 | float& Seconds, 1023 | float& Minutes, 1024 | float& Hours 1025 | ); 1026 | 1027 | //~~~ 1028 | 1029 | /** 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. */ 1030 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO") 1031 | static bool LoadStringArrayFromFile(TArray& StringArray, int32& ArraySize, FString FullFilePath = "Enter Full File Path", bool ExcludeEmptyLines = false); 1032 | 1033 | /** 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! */ 1034 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|File IO") 1035 | static bool LoadStringFromFile(FString& Result, FString FullFilePath = "Enter Full File Path") 1036 | { 1037 | return FFileHelper::LoadFileToString( Result, *FullFilePath); 1038 | } 1039 | 1040 | //~~~ 1041 | 1042 | /** 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. */ 1043 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Array") 1044 | static void MaxOfFloatArray(const TArray& FloatArray, int32& IndexOfMaxValue, float& MaxValue); 1045 | 1046 | /** 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. */ 1047 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Array") 1048 | static void MaxOfIntArray(const TArray& IntArray, int32& IndexOfMaxValue, int32& MaxValue); 1049 | 1050 | /** 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. */ 1051 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Array") 1052 | static void MinOfFloatArray(const TArray& FloatArray, int32& IndexOfMinValue, float& MinValue); 1053 | 1054 | /** 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. */ 1055 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Array") 1056 | static void MinOfIntArray(const TArray& IntArray, int32& IndexOfMinValue, int32& MinValue); 1057 | 1058 | //~~~ 1059 | 1060 | /** Set Max Move Speed. Supply the Character whose Character Movement to change! Returns false if operation could not occur due to invalid Character or MovementComponent could not be obtained.*/ 1061 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Character", meta = (DefaultToSelf = "TheCharacter")) 1062 | static bool CharacterMovement__SetMaxMoveSpeed(ACharacter* TheCharacter, float NewMaxMoveSpeed); 1063 | 1064 | //~~~ 1065 | 1066 | /** Converts a float to a rounded Integer, examples: 1.4 becomes 1, 1.6 becomes 2 */ 1067 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|Math") 1068 | static int32 Conversion__FloatToRoundedInteger(float IN_Float); 1069 | 1070 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|String") 1071 | static int32 CountOccurrancesOfSubString(FString Source, FString SubString, ESearchCase::Type SearchCase = ESearchCase::IgnoreCase) 1072 | { 1073 | return Source.ReplaceInline(*SubString,TEXT(""),SearchCase); 1074 | } 1075 | 1076 | 1077 | 1078 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|String", meta=( Keywords = "concatenate append")) 1079 | static void VictoryAppendInline(UPARAM(ref) FString& String, const FString& ToAppend, FString& Result, bool AppendNewline=false) 1080 | { 1081 | String += ToAppend; 1082 | if(AppendNewline) String += LINE_TERMINATOR; 1083 | Result = String; 1084 | } 1085 | 1086 | /** Handy option to trim any extra 00: 's while keeping a base set of 00:ss as per user expectation. 00:05:30 will become 05:30. ♥ Rama */ 1087 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|System") 1088 | static FString Victory_SecondsToHoursMinutesSeconds(float Seconds, bool TrimZeroes=true); 1089 | 1090 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|String") 1091 | static bool IsAlphaNumeric(const FString& String); 1092 | 1093 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|String") 1094 | static void Victory_GetStringFromOSClipboard(FString& FromClipboard); 1095 | 1096 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|String") 1097 | static void Victory_SaveStringToOSClipboard(const FString& ToClipboard); 1098 | 1099 | /** 1100 | * Returns whether or not the SearchIn string contains the supplied Substring. 1101 | * Ex: "cat" is a contained within "concatenation" as a substring. 1102 | * @param SearchIn The string to search within 1103 | * @param Substring The string to look for in the SearchIn string 1104 | * @param bUseCase Whether or not to be case-sensitive 1105 | * @param bSearchFromEnd Whether or not to start the search from the end of the string instead of the beginning 1106 | */ 1107 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|String") 1108 | static bool HasSubstring(const FString& SearchIn, const FString& Substring, ESearchCase::Type SearchCase = ESearchCase::IgnoreCase, ESearchDir::Type SearchDir = ESearchDir::FromStart); 1109 | 1110 | /** Combines two strings together! The Separator and the Labels are optional*/ 1111 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|String") 1112 | static FString String__CombineStrings(FString StringFirst, FString StringSecond, FString Separator = "", FString StringFirstLabel = "", FString StringSecondLabel = ""); 1113 | 1114 | /** Separator is always a space */ 1115 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|String", meta=( Keywords = "concatenate append", CommutativeAssociativeBinaryOperator = "true")) 1116 | static FString String__CombineStrings_Multi(FString A, FString B); 1117 | 1118 | /** Returns three arrays containing all of the resolutions and refresh rates for the current computer's current display adapter. You can loop over just 1 of the arrays and use the current index for the other two arrays, as all 3 arrays will always have the same length. Returns false if operation could not occur. */ 1119 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|System", meta = (Keywords = "screen resolutions display adapter")) 1120 | static bool OptionsMenu__GetDisplayAdapterScreenResolutions(TArray& Widths, TArray& Heights, TArray& RefreshRates, bool IncludeRefreshRates = false); 1121 | 1122 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|GPU", meta=(Keyword="amd nvidia graphics card brand make model")) 1123 | static void GetUserDisplayAdapterBrand(bool& IsAMD, bool& IsNvidia, bool& IsIntel, bool& IsUnknown, int32& UnknownId); 1124 | 1125 | /** Clones an actor by obtaining its class and creating a copy. Returns the created Actor. The cloned actor is set to have the rotation and location of the initial actor. You can optionally specify location / rotation offsets for the new clone from original actor. Use IsValid to know if the actor was able to be cloned. */ 1126 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Actor", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 1127 | static AStaticMeshActor* Clone__StaticMeshActor(UObject* WorldContextObject, bool&IsValid, AStaticMeshActor* ToClone, FVector LocationOffset = FVector(0, 0, 0), FRotator RotationOffset = FRotator(0, 0, 0)); 1128 | 1129 | 1130 | /** Teleport Actor To Actor. Moves an actor instantly to the position and rotation of another actor. Useful for player starts, notes, triggers, and any other destination actors who dont have collision. Returns false if the operation could not occur. */ 1131 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|Actor") 1132 | static bool Actor__TeleportToActor(AActor* ActorToTeleport, AActor* DestinationActor); 1133 | 1134 | /** Is this game logic running in the Editor world? */ 1135 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 1136 | static bool WorldType__InEditorWorld(UObject* WorldContextObject); 1137 | 1138 | /** Is this game logic running in the PIE world? */ 1139 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 1140 | static bool WorldType__InPIEWorld(UObject* WorldContextObject); 1141 | 1142 | /** Is this game logic running in an actual independent game instance? */ 1143 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Victory BP Library|System", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 1144 | static bool WorldType__InGameInstanceWorld(UObject* WorldContextObject); 1145 | 1146 | /** Cause a supplied Character (casted from Actor internally) to enter Ragdoll physics. A check will be done to see if the character has a physics asset. */ 1147 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics") 1148 | static bool Physics__EnterRagDoll(AActor* TheCharacter); 1149 | 1150 | /** Cause a supplied Character (casted from Actor internally) to exit Ragdoll physics. HeightAboveRBMesh is how far above the RB Mesh the Actor Capsule should be moved to upon exiting. Pass in the InitLocation and InitRotation from InitializeVictoryRagdoll */ 1151 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics") 1152 | static bool Physics__LeaveRagDoll(AActor* TheCharacter, bool SetToFallingMovementMode=true, float HeightAboveRBMesh = 64, const FVector& InitLocation = FVector(0, 0, 0), const FRotator& InitRotation = FRotator(0, 0, 0)); 1153 | 1154 | /** Returns whether or not a supplied Character is in Ragdoll Physics. Cast from Actor done internally for your convenience. */ 1155 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics") 1156 | static bool Physics__IsRagDoll(AActor* TheCharacter); 1157 | 1158 | /** Get the Ragdoll Position of the supplied actor, casted to Character internally. Returns false if operation could not occur. */ 1159 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics") 1160 | static bool Physics__GetLocationofRagDoll(AActor* TheCharacter, FVector& RagdollLocation); 1161 | 1162 | /** Initialize Victory Ragdoll Mode, by Obtaining the Default Relative Rotation and Location for this Character's Mesh. The Output Location and Rotation must be saved for use with LeaveRagdoll. Returns false if operation could not occur */ 1163 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics") 1164 | static bool Physics__InitializeVictoryRagDoll(AActor* TheCharacter, FVector&InitLocation, FRotator&InitRotation); 1165 | 1166 | /** Update the TheCharacter's Capsule Location and Camera to the Current Location of the Ragdoll. InterpSpeed is how fast the camera keeps up with the moving ragdoll! HeightOffset is the height above the ragdoll that the camera should stay. Returns false if operation could not occur or if Mesh was not in ragdoll */ 1167 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Physics") 1168 | static bool Physics__UpdateCharacterCameraToRagdollLocation(AActor* TheCharacter, float HeightOffset = 128, float InterpSpeed = 3); 1169 | 1170 | 1171 | /** This node checks all Scalar, Vector, and Texture parameters of a material to see if the supplied parameter name is an actual parameter in the material! ♥ Rama*/ 1172 | UFUNCTION(BlueprintPure,Category="Victory BP Library|Material") 1173 | static bool DoesMaterialHaveParameter(UMaterialInterface* Mat, FName Parameter); 1174 | 1175 | 1176 | /** Get Name as String*/ 1177 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|String") 1178 | static FString Accessor__GetNameAsString(const UObject* TheObject); 1179 | 1180 | /** Get Socket Local Transform. Returns false if operation could not occur.*/ 1181 | //UFUNCTION(BlueprintCallable, Category = "Victory BP Library") 1182 | //static bool Accessor__GetSocketLocalTransform(const USkeletalMeshComponent* Mesh, FTransform& LocalTransform, FName SocketName=FName("SocketName")); 1183 | 1184 | /** Get Player Character's Player Controller. Requires: The Passed in Actor must be a character and it must be a player controlled character. IsValid will tell you if the return value is valid, make sure to do a Branch to confirm this! */ 1185 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Character") 1186 | static APlayerController* Accessor__GetPlayerController(AActor* TheCharacter, bool&IsValid); 1187 | 1188 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Input") 1189 | static void VictorySimulateMouseWheel(const float& Delta); 1190 | 1191 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Input") 1192 | static void VictorySimulateKeyPress(APlayerController* ThePC, FKey Key, EInputEvent EventType); 1193 | 1194 | /** This handy node lets you turn the rendering of the entire world on or off! Does not affect UMG or HUD, which allows you to use loading screens effectively! <3 Rama. Returns false if player controller could not be used to get the viewport. */ 1195 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|System", meta=(keywords="disable show hide loading screen")) 1196 | static bool Viewport__EnableWorldRendering(const APlayerController* ThePC, bool RenderTheWorld); 1197 | 1198 | /** SET the Mouse Position! Returns false if the operation could not occur */ 1199 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Input") 1200 | static bool Viewport__SetMousePosition(const APlayerController* ThePC, const float& PosX, const float& PosY); 1201 | 1202 | /** Get the Cursor Position within the Player's Viewport. This will return a result consistent with SET Mouse Position Returns false if the operation could not occur */ 1203 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Game Window") 1204 | static bool Viewport__GetMousePosition(const APlayerController* ThePC, float& PosX, float& PosY); 1205 | 1206 | 1207 | /** Get the coordinates of the center of the player's screen / viewport. Returns false if the operation could not occur */ 1208 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Game Window") 1209 | static bool Viewport__GetCenterOfViewport(const APlayerController* ThePC, float& PosX, float& PosY); 1210 | 1211 | 1212 | /** Convert Vector to Rotator*/ 1213 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion") 1214 | static FRotator Conversions__VectorToRotator(const FVector& TheVector); 1215 | 1216 | /** Convert Rotator to Vector */ 1217 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion") 1218 | static FVector Conversions__RotatorToVector(const FRotator& TheRotator); 1219 | 1220 | /** Input Actor is expected to be a ACharacter, conversion done internally for your convenience */ 1221 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion") 1222 | static FRotator Character__GetControllerRotation(AActor * TheCharacter); 1223 | 1224 | 1225 | 1226 | /** Draw 3D Line of Chosen Thickness From Socket on Character's Mesh to Destination, conversion of AActor to ACharacter done internally for your convenience. Duration is in Seconds */ 1227 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|3d Lines") 1228 | static void Draw__Thick3DLineFromCharacterSocket(AActor* TheCharacter, const FVector& EndPoint, FName Socket = FName("SocketName"), FLinearColor LineColor = FLinearColor(1, 0, 0, 1), float Thickness = 7, float Duration = -1.f); 1229 | /** Draw 3D Line of Chosen Thickness From Mesh Socket to Destination. Duration is in Seconds */ 1230 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|3d Lines") 1231 | static void Draw__Thick3DLineFromSocket(USkeletalMeshComponent* Mesh, const FVector& EndPoint, FName Socket = FName("SocketName"), FLinearColor LineColor = FLinearColor(0, 1, 0, 1), float Thickness = 7, float Duration = -1.f); 1232 | /** Draw 3D Line of Chosen Thickness Between Two Actors. Duration is in Seconds */ 1233 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|3d Lines") 1234 | static void Draw__Thick3DLineBetweenActors(AActor* StartActor, AActor* EndActor, FLinearColor LineColor = FLinearColor(0, 0, 1, 1), float Thickness = 7, float Duration = -1.f); 1235 | 1236 | /** AnimBPOwner - Must be a Character, Conversion Internally For Convenience.\n\nRetrieves the Aim Offsets Pitch & Yaw Based On the Rotation of the Controller of The Character Owning The Anim Instance.\n\nThe Pitch and Yaw are meant to be used with a Blend Space going from -90,-90 to 90,90.\n Returns true if function filled the pitch and yaw vars successfully */ 1237 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Aim Offset") 1238 | static bool Animation__GetAimOffsets(AActor* AnimBPOwner, float& Pitch, float& Yaw); 1239 | 1240 | /** AnimBPOwner - Must be a Character, Conversion Internally For Convenience.\n\nRetrieves the Aim Offsets Pitch & Yaw for the AnimBPOwner Based On the supplied Rotation.\n\nThe Pitch and Yaw are meant to be used with a Blend Space going from -90,-90 to 90,90.\n Returns true if function filled the pitch and yaw vars successfully */ 1241 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Aim Offset") 1242 | static bool Animation__GetAimOffsetsFromRotation(AActor * AnimBPOwner, const FRotator & TheRotation, float & Pitch, float & Yaw); 1243 | 1244 | /** Saves text to filename of your choosing, make sure include whichever file extension you want in the filename, ex: SelfNotes.txt . Make sure to include the entire file path in the save directory, ex: C:\MyGameDir\BPSavedTextFiles */ 1245 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|File IO") 1246 | static bool FileIO__SaveStringTextToFile(FString SaveDirectory, FString JoyfulFileName, FString SaveText, bool AllowOverWriting = false, bool AllowAppend = false); 1247 | 1248 | /** Saves multiple Strings to filename of your choosing, with each string on its own line! Make sure include whichever file extension you want in the filename, ex: SelfNotes.txt . Make sure to include the entire file path in the save directory, ex: C:\MyGameDir\BPSavedTextFiles */ 1249 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|File IO") 1250 | static bool FileIO__SaveStringArrayToFile(FString SaveDirectory, FString JoyfulFileName, TArray SaveText, bool AllowOverWriting = false, bool AllowAppend = false); 1251 | 1252 | 1253 | /** Obtain an Array of Actors Rendered Recently. You can specifiy what qualifies as "Recent" in seconds. */ 1254 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Actor", meta=(WorldContext="WorldContextObject")) 1255 | static void Visibility__GetRenderedActors(UObject* WorldContextObject, TArray& CurrentlyRenderedActors, float MinRecentTime = 0.01); 1256 | 1257 | /** Obtain an Array of Actors NOT Rendered Recently! You can specifiy what qualifies as "Recent" in seconds. */ 1258 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Actor", meta=(WorldContext="WorldContextObject")) 1259 | static void Visibility__GetNotRenderedActors(UObject* WorldContextObject, TArray& CurrentlyNotRenderedActors, float MinRecentTime = 0.01); 1260 | 1261 | /** Is the Current Game Window the Foreground window in the OS, or in the Editor? This will be accurate in standalone running of the game as well as in the editor PIE */ 1262 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Game Window") 1263 | static bool ClientWindow__GameWindowIsForeGroundInOS(); 1264 | 1265 | /** Flashes the game on the windows OS task bar! Please note this won't look the best in PIE, flashing is smoother in Standalone or packaged game. You can use GameWindowIsForeGroundInOS to see if there is a need to get the user's attention! <3 Rama */ 1266 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Game Window") 1267 | static void FlashGameOnTaskBar(APlayerController* PC, bool FlashContinuous=false, int32 MaxFlashCount = 3, int32 FlashFrequencyMilliseconds=500); 1268 | 1269 | /** Freeze Game Render, Does Not Stop Game Logic, Just Rendering. This is not like Pausing. Mainly useful for freezing render when window is not in the foreground */ 1270 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Game Window") 1271 | static void Rendering__FreezeGameRendering(); 1272 | 1273 | /** Unfreeze Game Render. This is not an unpause function, it's just for actual screen rendering */ 1274 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Game Window") 1275 | static void Rendering__UnFreezeGameRendering(); 1276 | 1277 | /** Compare Source Vector against Array of Vectors. Returns: Returns the Closest Vector to Source and what that closest Distance is, or -1 if there was an error such as array being empty. Ignores: Ignores Source if source is in the array */ 1278 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc") 1279 | static float Calcs__ClosestPointToSourcePoint(const FVector & Source, const TArray& OtherPoints, FVector& ClosestPoint); 1280 | 1281 | /** Takes in an actor (for convenience) and tries to cast it to Character and return an array of Vectors of all of the current bone locations of the character's Mesh. Locations are in World Space. Returns: false if the operation could not occur. Requires: Character Mesh Component must be valid */ 1282 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Actor") 1283 | static bool Data__GetCharacterBoneLocations(AActor * TheCharacter, TArray& BoneLocations); 1284 | 1285 | /** Retrieves the "Mesh" component of a Character. IsValid lets you know if the data is valid, make sure to check if it is! Requires: the passed in Actor must be a Character */ 1286 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Character") 1287 | static USkeletalMeshComponent* Accessor__GetCharacterSkeletalMesh(AActor* TheCharacter, bool& IsValid); 1288 | 1289 | 1290 | /** 1291 | * Get All Bone Names Below Bone, requires a physics asset, by Rama 1292 | * 1293 | * @param StartingBoneName The name of the bone to find all bones below. 1294 | * 1295 | * @param BoneNames , all of the bone names below the starting bone. 1296 | * 1297 | * @return total number of bones found 1298 | */ 1299 | UFUNCTION(BlueprintCallable, Category="Victory BP Library|Components|SkinnedMesh") 1300 | static int32 GetAllBoneNamesBelowBone(USkeletalMeshComponent* SkeletalMeshComp, FName StartingBoneName, TArray& BoneNames ); 1301 | 1302 | /** Does Not Do A Trace, But Obtains the Start and End for doing a Trace:\n\nTakes in an actor (for convenience) and tries to cast it to Character. Takes in a socket name to find on the Character's Mesh component, the socket location will be the start of the trace.\n\nAlso takes in the Angle / Rotator and the length of the trace you want to do. Option to draw the trace with variable thickness as it occurs.\n\nReturns what the Trace Start and End should be so you can plug these into any existing trace node you want.\n\nRequires: Character Mesh Component must be valid. Returns False if trace could not be done */ 1303 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Traces") 1304 | static bool TraceData__GetTraceDataFromCharacterSocket(FVector& TraceStart, FVector& TraceEnd, AActor * TheCharacter, const FRotator& TraceRotation, float TraceLength = 10240, FName Socket = "SocketName", bool DrawTraceData = true, FLinearColor TraceDataColor = FLinearColor(1, 0, 0, 1), float TraceDataThickness = 7); 1305 | 1306 | /** Does Not Do A Trace, But Obtains the Start and End for doing a Trace:\n\nTakes in a Skeletal Mesh Component and a socket name to trace from. Also takes in the Angle / Rotator and the length of the trace you want to do.\n\nOption to draw the trace as a variable thickness line\n\nReturns what the Trace Start and End should be so you can plug these into any existing trace node you want.\n\n Requires: Mesh must be valid. Returns False if trace could not be done */ 1307 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Traces") 1308 | static bool TraceData__GetTraceDataFromSkeletalMeshSocket(FVector& TraceStart, FVector& TraceEnd, USkeletalMeshComponent* Mesh, const FRotator& TraceRotation, float TraceLength = 10240, FName Socket = "SocketName", bool DrawTraceData = true, FLinearColor TraceDataColor = FLinearColor(1, 0, 0, 1), float TraceDataThickness = 7); 1309 | 1310 | /** Does a simple line trace given Trace Start and End, and if a Character is hit by the trace, then a component trace is performed on that character's mesh. Trace Owner is ignored when doing the trace.\n\nReturns the Character that was hit, as an Actor, as well as the name of the bone that was closest to the impact point of the trace. Also returns the impact point itself as well as the impact normal.\n\nUsing component trace ensures accuracy for testing against bones and sockets.\n\nIsValid: Will be true only if the component trace also hit someting. But the Returned Actor will contain an actor if any actor at all was hit by the simple trace. */ 1311 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Traces") 1312 | static AActor* Traces__CharacterMeshTrace___ClosestBone(AActor* TraceOwner, const FVector& TraceStart, const FVector& TraceEnd, FVector& OutImpactPoint, FVector& OutImpactNormal, FName& ClosestBoneName, FVector & ClosestBoneLocation, bool&IsValid); 1313 | 1314 | /** Does a simple line trace given Trace Start and End, and if a Character is hit by the trace, then a component trace is performed on that character's mesh. Returns the name of the socket that was closest to the impact point of the trace. Also returns the impact point itself as well as the impact normal. Also returns the Socket Location. Using component trace ensures accuracy for testing against bones and sockets.*/ 1315 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Traces",meta=(WorldContext="WorldContextObject")) 1316 | static AActor* Traces__CharacterMeshTrace___ClosestSocket(UObject* WorldContextObject, const AActor * TraceOwner, const FVector& TraceStart, const FVector& TraceEnd, FVector& OutImpactPoint, FVector& OutImpactNormal, FName& ClosestSocketName, FVector & SocketLocation, bool&IsValid); 1317 | 1318 | /** Returns the float as a String with Precision, Precision 0 = no decimal value. Precison 1 = 1 decimal place. The re-precisioned result is rounded appropriately. */ 1319 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Conversion") 1320 | static void StringConversion__GetFloatAsStringWithPrecision(float TheFloat, FString & TheString, int32 Precision = 2, bool IncludeLeadingZero=true); 1321 | 1322 | /** Rotator out value is the degrees of difference between the player camera and the direction of player to light source. Returns false if the operation could not occur. */ 1323 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc") 1324 | static bool LensFlare__GetLensFlareOffsets(APlayerController* PlayerController, AActor* LightSource, float& PitchOffset, float& YawOffset, float& RollOffset); 1325 | 1326 | /** Retrieve Distance of given point to any Surface point on a Static Mesh Actor. Returns the distance as well as the exact closest point on the mesh surface to the given point. Returns -1 if an error occurred*/ 1327 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc") 1328 | static float DistanceToSurface__DistaceOfPointToMeshSurface(AStaticMeshActor* TheSMA, const FVector& TestPoint, FVector& ClosestSurfacePoint); 1329 | 1330 | /** Change the Mobility of a Static Mesh Component, can be used in Constructor Script or in Event Graph! Returns false if operation could not occur.*/ 1331 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Misc") 1332 | static bool Mobility__SetSceneCompMobility(USceneComponent* SceneComp, EComponentMobility::Type NewMobility); 1333 | 1334 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1335 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1336 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1337 | // Paths 1338 | 1339 | /** InstallDir/GameName/Binaries/Win64 */ 1340 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Paths") 1341 | static FString VictoryPaths__Win64Dir_BinaryLocation(); 1342 | 1343 | /** InstallDir/WindowsNoEditor/ */ 1344 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Paths") 1345 | static FString VictoryPaths__WindowsNoEditorDir(); 1346 | 1347 | /** InstallDir/GameName */ 1348 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Paths") 1349 | static FString VictoryPaths__GameRootDirectory(); 1350 | 1351 | /** InstallDir/GameName/Saved */ 1352 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Paths") 1353 | static FString VictoryPaths__SavedDir(); 1354 | 1355 | /** InstallDir/GameName/Saved/Config/ */ 1356 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Paths") 1357 | static FString VictoryPaths__ConfigDir(); 1358 | 1359 | /** InstallDir/GameName/Saved/Screenshots/Windows */ 1360 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Paths") 1361 | static FString VictoryPaths__ScreenShotsDir(); 1362 | 1363 | /** InstallDir/GameName/Saved/Logs */ 1364 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Paths") 1365 | static FString VictoryPaths__LogsDir(); 1366 | 1367 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1368 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1369 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1370 | // Graphics Settings Sample 1371 | 1372 | //~~~~~~~~~~~~~~~~~~ 1373 | // FullScreen 1374 | //~~~~~~~~~~~~~~~~~~ 1375 | 1376 | /** Get Full Screen Type */ 1377 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Graphics Settings") 1378 | static TEnumAsByte JoyGraphicsSettings__FullScreen_Get(); 1379 | 1380 | /** Set Full Screen Type */ 1381 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Graphics Settings") 1382 | static void JoyGraphicsSettings__FullScreen_Set(TEnumAsByte NewSetting); 1383 | 1384 | 1385 | 1386 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1387 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1388 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1389 | // CPP FUNCTION LIBRARY 1390 | 1391 | static FORCEINLINE void JoyCC(const FString& Str, const int32 Value) 1392 | { 1393 | TObjectIterator PC; 1394 | if (!PC) return; 1395 | //~~~~~~ 1396 | 1397 | PC->ConsoleCommand(Str + " " + FString::FromInt(Value)); 1398 | } 1399 | static FORCEINLINE void JoyGraphics_FullScreen_SetFullScreenType(int32 Value) 1400 | { 1401 | JoyCC("r.FullScreenMode", Value); 1402 | } 1403 | static FORCEINLINE int32 JoyGraphics_FullScreen_GetFullScreenType() 1404 | { 1405 | static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.FullScreenMode")); 1406 | return CVar->GetValueOnGameThread(); 1407 | } 1408 | static FORCEINLINE void JoyGraphics_SetFullScreen_NonWindowed() 1409 | { 1410 | /*"r.FullScreenMode"), 1411 | 2, 1412 | TEXT("Defines how we do full screen when requested (e.g. command line option -fullscreen or in ini [SystemSettings] fullscreen=true)\n") 1413 | */ 1414 | JoyCC("r.FullScreenMode", 0); 1415 | } 1416 | static FORCEINLINE void JoyGraphics_SetFullScreen_Windowed() 1417 | { 1418 | //TEXT(" 2: windowed full screen, specified resolution (like 1 but no unintuitive performance cliff, can be blurry, default)\n") 1419 | JoyCC("r.FullScreenMode", 2); 1420 | } 1421 | static FORCEINLINE void JoyGraphics_SetFullScreen_WindowedHighestQuality() 1422 | { 1423 | //TEXT(" 1: windowed full screen, desktop resolution (quick switch between applications and window mode, full quality)\n") 1424 | JoyCC("r.FullScreenMode", 1); 1425 | } 1426 | 1427 | 1428 | 1429 | //Min and Max of Array 1430 | static FORCEINLINE float Min(const TArray& Values, int32* MinIndex = NULL) 1431 | { 1432 | if (MinIndex) 1433 | { 1434 | *MinIndex = 0; 1435 | } 1436 | 1437 | if (Values.Num() <= 0) 1438 | { 1439 | return -1; 1440 | } 1441 | 1442 | float CurMin = Values[0]; 1443 | for (const float EachValue : Values) 1444 | { 1445 | CurMin = FMath::Min(CurMin, EachValue); 1446 | } 1447 | 1448 | if (MinIndex) 1449 | { 1450 | *MinIndex = Values.Find(CurMin); 1451 | } 1452 | return CurMin; 1453 | } 1454 | static FORCEINLINE float Max(const TArray& Values, int32* MaxIndex = NULL) 1455 | { 1456 | if (MaxIndex) 1457 | { 1458 | *MaxIndex = 0; 1459 | } 1460 | 1461 | if (Values.Num() <= 0) 1462 | { 1463 | return -1; 1464 | } 1465 | 1466 | float CurMax = Values[0]; 1467 | for (const float EachValue : Values) 1468 | { 1469 | CurMax = FMath::Max(CurMax, EachValue); 1470 | } 1471 | 1472 | if (MaxIndex) 1473 | { 1474 | *MaxIndex = Values.Find(CurMax); 1475 | } 1476 | return CurMax; 1477 | } 1478 | 1479 | static FORCEINLINE int32 Min(const TArray& Values, int32* MinIndex = NULL) 1480 | { 1481 | if (MinIndex) 1482 | { 1483 | *MinIndex = 0; 1484 | } 1485 | 1486 | if (Values.Num() <= 0) 1487 | { 1488 | return -1; 1489 | } 1490 | 1491 | int32 CurMin = Values[0]; 1492 | for (const int32 EachValue : Values) 1493 | { 1494 | CurMin = FMath::Min(CurMin, EachValue); 1495 | } 1496 | 1497 | if (MinIndex) 1498 | { 1499 | *MinIndex = Values.Find(CurMin); 1500 | } 1501 | return CurMin; 1502 | } 1503 | static FORCEINLINE int32 Max(const TArray& Values, int32* MaxIndex = NULL) 1504 | { 1505 | if (MaxIndex) 1506 | { 1507 | *MaxIndex = 0; 1508 | } 1509 | 1510 | if (Values.Num() <= 0) 1511 | { 1512 | return -1; 1513 | } 1514 | 1515 | int32 CurMax = Values[0]; 1516 | for (const int32 EachValue : Values) 1517 | { 1518 | CurMax = FMath::Max(CurMax, EachValue); 1519 | } 1520 | 1521 | if (MaxIndex) 1522 | { 1523 | *MaxIndex = Values.Find(CurMax); 1524 | } 1525 | return CurMax; 1526 | } 1527 | 1528 | 1529 | 1530 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1531 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1532 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1533 | // Contributed by Others 1534 | 1535 | /** 1536 | * 1537 | * Contributed by: Mindfane 1538 | * 1539 | * Split a string into an array of substrings based on the given delimitter. 1540 | * Unlike ParseIntoArray() function which expects single character delimitters, this function can accept a delimitter that is also a string. 1541 | * 1542 | * @param InputString - The string that is to be exploded. 1543 | * @param Separator - The delimitter that is used for splitting (multi character strings are allowed) 1544 | * @param limit - If greater than zero, returns only the first x strings. Otherwsie returns all the substrings 1545 | * @param bTrimElelements - If True, then each subsctring is processed and any leading or trailing whitespcaes are trimmed. 1546 | */ 1547 | UFUNCTION(BlueprintPure, meta = (DisplayName = "Victory BP Library|String", Keywords = "split explode string"), Category = String) 1548 | static void String__ExplodeString(TArray& OutputStrings, FString InputString, FString Separator = ",", int32 limit = 0, bool bTrimElements = false); 1549 | 1550 | 1551 | //NOT QUITE WORKING, REQUIRES INVESTIGATION 1552 | /** Load a Texture 2D from a DDS file! Contributed by UE4 forum member n00854180t! */ 1553 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="image DDS")) 1554 | static UTexture2D* LoadTexture2D_FromDDSFile(const FString& FullFilePath); 1555 | 1556 | /** Load a Texture2D from a JPG,PNG,BMP,ICO,EXR,ICNS file! IsValid tells you if file path was valid or not. Enjoy! -Rama */ 1557 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="image png jpg jpeg bmp bitmap ico icon exr icns")) 1558 | static UTexture2D* Victory_LoadTexture2D_FromFile(const FString& FullFilePath,EJoyImageFormats ImageFormat,bool& IsValid, int32& Width, int32& Height); 1559 | 1560 | /** Load a Texture2D from a JPG,PNG,BMP,ICO,EXR,ICNS file! IsValid tells you if file path was valid or not. Enjoy! -Rama */ 1561 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="image png jpg jpeg bmp bitmap ico icon exr icns")) 1562 | static UTexture2D* Victory_LoadTexture2D_FromFile_Pixels(const FString& FullFilePath,EJoyImageFormats ImageFormat,bool& IsValid, int32& Width, int32& Height, TArray& OutPixels); 1563 | 1564 | /** Retrieve a pixel color value given the pixel array, the image height, and the coordinates. Returns false if the coordinates were not valid. Pixel coordinates start from upper left corner as 0,0. X= horizontal, Y = vertical */ 1565 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="image coordinate index map value")) 1566 | static bool Victory_Get_Pixel(const TArray& Pixels, int32 ImageHeight, int32 x, int32 y, FLinearColor& FoundColor); 1567 | 1568 | /** Save an array of pixels to disk as a PNG! It is very important that you supply the curret width and height of the image! Returns false if Width * Height != Array length or file could not be saved to the location specified. I return an ErrorString to clarify what the exact issue was. -Rama */ 1569 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="create image png jpg jpeg bmp bitmap ico icon exr icns")) 1570 | static bool Victory_SavePixels(const FString& FullFilePath,int32 Width, int32 Height, const TArray& ImagePixels, bool SaveAsBMP, bool sRGB, FString& ErrorString); 1571 | 1572 | /** This will modify the original T2D to remove sRGB and change compression to VectorDisplacementMap to ensure accurate pixel reading. -Rama*/ 1573 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="create image png jpg jpeg bmp bitmap ico icon exr icns"))//, DeprecatedFunction, DeprecationMessage="This function will not work until I figure out how to update it to 4.25, if you need it urgently, please post in my ue4 forum thread for this plugin")) 1574 | static bool Victory_GetPixelFromT2D(UTexture2D* T2D, int32 X, int32 Y, FLinearColor& PixelColor); 1575 | 1576 | /** This will modify the original T2D to remove sRGB and change compression to VectorDisplacementMap to ensure accurate pixel reading. -Rama*/ 1577 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="create image png jpg jpeg bmp bitmap ico icon exr icns"))//, DeprecatedFunction, DeprecationMessage="This function will not work until I figure out how to update it to 4.25, if you need it urgently, please post in my ue4 forum thread for this plugin")) 1578 | static bool Victory_GetPixelsArrayFromT2D(UTexture2D* T2D, int32& TextureWidth, int32& TextureHeight,TArray& PixelArray); 1579 | 1580 | /** This will modify the original T2D to remove sRGB and change compression to VectorDisplacementMap to ensure accurate pixel reading. -Rama*/ 1581 | //UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="create image png jpg jpeg bmp bitmap ico icon exr icns")) 1582 | static bool Victory_GetPixelsArrayFromT2DDynamic(UTexture2DDynamic* T2D, int32& TextureWidth, int32& TextureHeight,TArray& PixelArray); 1583 | 1584 | /** Contributed by UE4 forum member n00854180t! Plays a .ogg sound from file, attached to and following the specified component. This is a fire and forget sound. Replication is also not handled at this point. 1585 | * @param FilePath - Path to sound file to play 1586 | * @param AttachComponent - Component to attach to. 1587 | * @param AttachPointName - Optional named point within the AttachComponent to play the sound at 1588 | * @param Location - Depending on the value of Location Type this is either a relative offset from the attach component/point or an absolute world position that will be translated to a relative offset 1589 | * @param LocationType - Specifies whether Location is a relative offset or an absolute world position 1590 | * @param bStopWhenAttachedToDestroyed - Specifies whether the sound should stop playing when the owner of the attach to component is destroyed. 1591 | * @param VolumeMultiplier - Volume multiplier 1592 | * @param PitchMultiplier - PitchMultiplier 1593 | * @param AttenuationSettings - Override attenuation settings package to play sound with 1594 | */ 1595 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Sound", meta = (VolumeMultiplier = "1.0", PitchMultiplier = "1.0", AdvancedDisplay = "2", UnsafeDuringActorConstruction = "true")) 1596 | static class UAudioComponent* PlaySoundAttachedFromFile(const FString& FilePath, class USceneComponent* AttachToComponent, FName AttachPointName = NAME_None, FVector Location = FVector(ForceInit), EAttachLocation::Type LocationType = EAttachLocation::SnapToTarget, bool bStopWhenAttachedToDestroyed = false, float VolumeMultiplier = 1.f, float PitchMultiplier = 1.f, float StartTime = 0.f, class USoundAttenuation* AttenuationSettings = NULL); 1597 | 1598 | /** Contributed by UE4 forum member n00854180t! Plays a .ogg sound at the given location. This is a fire and forget sound and does not travel with any actor. Replication is also not handled at this point. 1599 | * 1600 | * NOT SUPPORTED ON PS4. 1601 | * 1602 | * @param FilePath - Path to sound file to play 1603 | * @param Location - World position to play sound at 1604 | * @param World - The World in which the sound is to be played 1605 | * @param VolumeMultiplier - Volume multiplier 1606 | * @param PitchMultiplier - PitchMultiplier 1607 | * @param AttenuationSettings - Override attenuation settings package to play sound with 1608 | */ 1609 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Sound", meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject", VolumeMultiplier = "1.0", PitchMultiplier = "1.0", AdvancedDisplay = "3", UnsafeDuringActorConstruction = "true")) 1610 | static void PlaySoundAtLocationFromFile(UObject* WorldContextObject, const FString& FilePath, FVector Location, float VolumeMultiplier = 1.f, float PitchMultiplier = 1.f, float StartTime = 0.f, class USoundAttenuation* AttenuationSettings = NULL); 1611 | 1612 | /** Contributed by UE4 forum member n00854180t! Creates a USoundWave* from file path. 1613 | * Read .ogg header file and refresh USoundWave metadata. 1614 | * 1615 | * NOT SUPPORTED ON PS4. 1616 | * 1617 | * @param FilePath path to file to create sound wave from 1618 | */ 1619 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Sound") 1620 | static class USoundWave* GetSoundWaveFromFile(const FString& FilePath); 1621 | 1622 | #if !PLATFORM_PS4 1623 | private: 1624 | // Thanks to @keru for the base code for loading an Ogg into a USoundWave: 1625 | // https://forums.unrealengine.com/showthread.php?7936-Custom-Music-Player&p=97659&viewfull=1#post97659 1626 | 1627 | /** 1628 | * Read .ogg header file and refresh USoundWave metadata. NOT SUPPORTED BY PS4 1629 | * @param sw wave to put metadata 1630 | * @param rawFile pointer to src file in memory 1631 | * @return 0 if everything is ok 1632 | * 1 if couldn't read metadata. 1633 | */ 1634 | static int32 fillSoundWaveInfo(USoundWave* sw, TArray* rawFile); 1635 | 1636 | 1637 | 1638 | /** 1639 | * Tries to find out FSoundSource object associated to the USoundWave. NOT SUPPORTED BY PS4 1640 | * @param sw wave, search key 1641 | * @return 0 if wave found and correctly set 1642 | * -1 if error: sound device not set 1643 | * -2 if error: sound wave not found 1644 | */ 1645 | static int32 findSource(class USoundWave* sw, class FSoundSource* out_audioSource); 1646 | #endif //PLATFORM_PS4 1647 | 1648 | 1649 | 1650 | /** 1651 | * Contributed by: SaxonRah 1652 | * Better random numbers. Seeded with a random device. if the random device's entropy is 0; defaults to current time for seed. 1653 | * can override with seed functions; 1654 | */ 1655 | //----------------------------------------------------------------------------------------------BeginRANDOM 1656 | public: 1657 | /** Construct a random device, returns either a random device or the default random engine; system dependant; 1658 | */ 1659 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Random") 1660 | static void constructRand(); 1661 | 1662 | /** Seed Rand with value passed 1663 | * @param seed - value to pass to the prng as the seed 1664 | */ 1665 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Random") 1666 | static void seedRand(int32 seed); 1667 | 1668 | /** Seed Rand with current time 1669 | */ 1670 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Random") 1671 | static void seedRandWithTime(); 1672 | 1673 | /** Seed Rand with entropy 1674 | * @param seed - value to pass to the prng as the seed 1675 | */ 1676 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Random") 1677 | static void seedRandWithEntropy(); 1678 | 1679 | /** Random Bool - Bernoulli distribution 1680 | * @param fBias - Bias of Bernoulli distribution 1681 | * @return uniformly distributed bool based on bias parameter 1682 | */ 1683 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1684 | static bool RandBool_Bernoulli(float fBias); 1685 | 1686 | /** Random Integer - Zero to One Uniform distribution 1687 | * @return int32 - uniform distribution from 0 to 1 1688 | */ 1689 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1690 | static int32 RandInt_uniDis(); 1691 | 1692 | /** Random Integer - MIN to MAX Uniform distribution 1693 | * @param iMin - Minimum value of uniform distribution 1694 | * @param iMax - Maximum value of uniform distribution 1695 | * @return int32 - uniform distribution from iMin to iMax parameters 1696 | */ 1697 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1698 | static int32 RandInt_MINMAX_uniDis(int32 iMin, int32 iMax); 1699 | 1700 | /** Random Double - Zero to One Uniform distribution 1701 | * @return double - uniform distribution from 0 to 1 1702 | */ 1703 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1704 | static float RandFloat_uniDis(); 1705 | 1706 | /** Random Double - Uniform distribution based on MIN to MAX parameters 1707 | * @param iMin - Minimum value of uniform distribution 1708 | * @param iMax - Maximum value of uniform distribution 1709 | * @return double - uniform distribution from iMin to iMax parameters 1710 | */ 1711 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1712 | static float RandFloat_MINMAX_uniDis(float iMin, float iMax); 1713 | 1714 | /** Random Bool - Bernoulli distribution - Mersenne Twister 1715 | * @param fBias - Bias of Bernoulli distribution 1716 | * @return uniformly distributed bool based on bias parameter 1717 | */ 1718 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1719 | static bool RandBool_Bernoulli_MT(float fBias); 1720 | 1721 | /** Random Integer - Zero to One Uniform distribution - Mersenne Twister 1722 | * @return int32 - uniform distribution from 0 to 1 1723 | */ 1724 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1725 | static int32 RandInt_uniDis_MT(); 1726 | 1727 | /** Random Integer - MIN to MAX Uniform distribution - Mersenne Twister 1728 | * @param iMin - Minimum value of uniform distribution 1729 | * @param iMax - Maximum value of uniform distribution 1730 | * @return int32 - uniform distribution from iMin to iMax parameters 1731 | */ 1732 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1733 | static int32 RandInt_MINMAX_uniDis_MT(int32 iMin, int32 iMax); 1734 | 1735 | /** Random Float - Zero to One Uniform distribution - Mersenne Twister 1736 | * @return float - uniform distribution from 0 to 1 1737 | */ 1738 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1739 | static float RandFloat_uniDis_MT(); 1740 | 1741 | /** Random Float - Uniform distribution based on MIN to MAX parameters - Mersenne Twister 1742 | * @param iMin - Minimum value of uniform distribution 1743 | * @param iMax - Maximum value of uniform distribution 1744 | * @return float - uniform distribution from iMin to iMax parameters 1745 | */ 1746 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Random") 1747 | static float RandFloat_MINMAX_uniDis_MT(float iMin, float iMax); 1748 | //----------------------------------------------------------------------------------------------ENDRANDOM 1749 | 1750 | /** Inspired by Sahkan! */ 1751 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|Actor|Get Immediate Attached Actors") 1752 | static void Actor__GetAttachedActors(AActor* ParentActor,TArray& ActorsArray); 1753 | 1754 | /** Modify the bloom intensity of a post process volume, by Community Member Sahkan */ 1755 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Post Process") 1756 | static void SetBloomIntensity(APostProcessVolume* PostProcessVolume,float Intensity); 1757 | 1758 | 1759 | 1760 | 1761 | //~~~ Kris ~~~ 1762 | 1763 | /* 1764 | *See if index is a valid index for this array 1765 | * 1766 | *@param TargetArray The array to perform the operation on 1767 | *@param Index The index to check. 1768 | *@return Bool if integer is valid index for this array 1769 | */ 1770 | UFUNCTION(Category="Victory BP Library|Utilities|Array", BlueprintPure, CustomThunk, meta=(DisplayName = "Valid Index", CompactNodeTitle = "VALID INDEX", ArrayParm = "TargetArray")) 1771 | static bool Array_IsValidIndex(const TArray& TargetArray, int32 Index); 1772 | 1773 | static bool GenericArray_IsValidIndex(void* TargetArray, const FArrayProperty* ArrayProp, int32 Index); 1774 | 1775 | DECLARE_FUNCTION(execArray_IsValidIndex) 1776 | { 1777 | Stack.MostRecentProperty = nullptr; 1778 | Stack.StepCompiledIn(NULL); 1779 | void* ArrayAddr = Stack.MostRecentPropertyAddress; 1780 | FArrayProperty* ArrayProperty = Cast(Stack.MostRecentProperty); 1781 | if (!ArrayProperty) 1782 | { 1783 | Stack.bArrayContextFailed = true; 1784 | return; 1785 | } 1786 | P_GET_PROPERTY(FIntProperty, Index); 1787 | P_FINISH; 1788 | 1789 | bool WasValid = GenericArray_IsValidIndex(ArrayAddr, ArrayProperty, Index); 1790 | *(bool*)RESULT_PARAM = WasValid; 1791 | } 1792 | 1793 | /** Get the time target actor was created. */ 1794 | UFUNCTION(Category = "Victory BP Library|Actor", BlueprintPure, Meta = (DefaultToSelf = "Target")) 1795 | static float GetCreationTime(const AActor* Target); 1796 | 1797 | /** Get the time target actor has been alive. */ 1798 | UFUNCTION(Category = "Victory BP Library|Actor", BlueprintPure, Meta = (DefaultToSelf = "Target")) 1799 | static float GetTimeAlive(const AActor* Target); 1800 | 1801 | /** Contributed by Community Member Kris! */ 1802 | UFUNCTION(Category = "Victory BP Library|SceneCapture", BlueprintPure) 1803 | static bool CaptureComponent2D_Project(class USceneCaptureComponent2D* Target, FVector Location, FVector2D& OutPixelLocation); 1804 | 1805 | /** Contributed by Community Member Kris! */ 1806 | UFUNCTION(Category = "Victory BP Library|SceneCapture", BlueprintPure, Meta = (DefaultToSelf = "Target")) 1807 | static bool Capture2D_Project(class ASceneCapture2D* Target, FVector Location, FVector2D& OutPixelLocation); 1808 | 1809 | /** Currently the only supported format for this function is B8G8R8A8. Make sure to include the appropriate image extension in your file path! Recommended: .bmp, .jpg, .png. Contributed by Community Member Kris! */ 1810 | UFUNCTION(Category = "Victory BP Library|SceneCapture", BlueprintCallable) 1811 | static bool CaptureComponent2D_SaveImage(class USceneCaptureComponent2D* Target, const FString ImagePath, const FLinearColor ClearColour); 1812 | 1813 | /** Currently the only supported format for this function is B8G8R8A8. Make sure to include the appropriate image extension in your file path! Recommended: .bmp, .jpg, .png. Contributed by Community Member Kris! */ 1814 | UFUNCTION(Category = "Victory BP Library|SceneCapture", BlueprintCallable, Meta = (DefaultToSelf = "Target")) 1815 | static bool Capture2D_SaveImage(class ASceneCapture2D* Target, const FString ImagePath, const FLinearColor ClearColour); 1816 | 1817 | /** Make sure your image path has a valid extension! Supported types can be seen in the BP node Victory_LoadTexture2D_FromFile. Contributed by Community Member Kris! */ 1818 | UFUNCTION(Category = "Victory BP Library|Load Texture From File", BlueprintCallable) 1819 | static UTexture2D* LoadTexture2D_FromFileByExtension(const FString& ImagePath, bool& IsValid, int32& OutWidth, int32& OutHeight); 1820 | 1821 | /** 1822 | * Find first widget of a certain class and return it. 1823 | * @param WidgetClass The widget class to filter by. 1824 | * @param TopLevelOnly Only a widget that is a direct child of the viewport will be returned. 1825 | */ 1826 | UFUNCTION(Category = "Victory BP Library|UMG", BlueprintCallable, BlueprintCosmetic, Meta = (WorldContext = "WorldContextObject", DeterminesOutputType = "WidgetClass")) 1827 | static UUserWidget* GetFirstWidgetOfClass(UObject* WorldContextObject, TSubclassOf WidgetClass, bool TopLevelOnly); 1828 | 1829 | /** 1830 | * Recurses up the list of parents and returns true if this widget is a descendant of the PossibleParent 1831 | * @return true if this widget is a child of the PossibleParent 1832 | */ 1833 | UFUNCTION(Category = "Victory BP Library|UMG", BlueprintCallable, BlueprintCosmetic, Meta = (DefaultToSelf = "ChildWidget")) 1834 | static bool WidgetIsChildOf(UWidget* ChildWidget, UWidget* PossibleParent); 1835 | 1836 | /** 1837 | * Recurses up the list of parents until it finds a widget of WidgetClass. 1838 | * @return widget that is Parent of ChildWidget that matches WidgetClass. 1839 | */ 1840 | UFUNCTION(Category = "Victory BP Library|UMG", BlueprintCallable, BlueprintCosmetic, Meta = (DefaultToSelf = "ChildWidget", DeterminesOutputType = "WidgetClass")) 1841 | static UUserWidget* WidgetGetParentOfClass(UWidget* ChildWidget, TSubclassOf WidgetClass); 1842 | 1843 | UFUNCTION(Category = "Victory BP Library|UMG", BlueprintCallable, BlueprintCosmetic, Meta = (DefaultToSelf = "ParentWidget", DeterminesOutputType = "WidgetClass", DynamicOutputParam = "ChildWidgets")) 1844 | static void WidgetGetChildrenOfClass(UWidget* ParentWidget, TArray& ChildWidgets, TSubclassOf WidgetClass, bool bImmediateOnly); 1845 | 1846 | UFUNCTION(Category = "Victory BP Library|UMG", BlueprintCallable, BlueprintCosmetic, Meta = (DefaultToSelf = "ParentUserWidget")) 1847 | static UWidget* GetWidgetFromName(UUserWidget* ParentUserWidget, const FName& Name); 1848 | 1849 | UFUNCTION(Category = "Victory BP Library|Team", BlueprintPure) 1850 | static uint8 GetGenericTeamId(AActor* Target); 1851 | 1852 | UFUNCTION(Category = "Victory BP Library|Team", BlueprintCallable) 1853 | static void SetGenericTeamId(AActor* Target, uint8 NewTeamId); 1854 | 1855 | UFUNCTION(Category = "Victory BP Library|LevelStreaming", BlueprintCallable) 1856 | static FLevelStreamInstanceInfo GetLevelInstanceInfo(ULevelStreamingDynamic* LevelInstance); 1857 | 1858 | UFUNCTION(Category = "Victory BP Library|LevelStreaming", BlueprintCallable, Meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 1859 | static void AddToStreamingLevels(UObject* WorldContextObject, const FLevelStreamInstanceInfo& LevelInstanceInfo); 1860 | 1861 | UFUNCTION(Category = "Victory BP Library|LevelStreaming", BlueprintCallable, Meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject")) 1862 | static void RemoveFromStreamingLevels(UObject* WorldContextObject, const FLevelStreamInstanceInfo& LevelInstanceInfo); 1863 | 1864 | UFUNCTION(Category = "Victory BP Library|LevelStreaming", BlueprintCallable, Meta = (keywords="remove")) 1865 | static void HideStreamingLevel(ULevelStreamingDynamic* LevelInstance) 1866 | { 1867 | if(LevelInstance) LevelInstance->SetShouldBeVisible(false); 1868 | } 1869 | 1870 | UFUNCTION(Category = "Victory BP Library|LevelStreaming", BlueprintCallable, Meta = (keywords="remove")) 1871 | static void UnloadStreamingLevel(ULevelStreamingDynamic* LevelInstance) 1872 | { 1873 | if(LevelInstance) LevelInstance->SetShouldBeLoaded(false); 1874 | } 1875 | 1876 | static bool GenericArray_SortCompare(const FProperty* LeftProperty, void* LeftValuePtr, const FProperty* RightProperty, void* RightValuePtr); 1877 | 1878 | /** 1879 | * Sort the elements of an array by FString, FName, FText, float, int or boolean. 1880 | * Supports struct and object based arrays. 1881 | * 1882 | * @param TargetArray The array to sort. 1883 | * @param bAscendingOrder If true, sort by ascending order. 1884 | * @param VariableName If a struct or object based array, the name of the variable to sort by. 1885 | */ 1886 | UFUNCTION(Category = "Victory BP Library|Utilities|Array", BlueprintCallable, CustomThunk, Meta = (DisplayName = "Sort", ArrayParm = "TargetArray", AdvancedDisplay = "bAscendingOrder,VariableName")) 1887 | static void Array_Sort(const TArray& TargetArray, bool bAscendingOrder = true, FName VariableName = NAME_None); 1888 | 1889 | static void GenericArray_Sort(void* TargetArray, const FArrayProperty* ArrayProp, bool bAscendingOrder = true, FName VariableName = NAME_None); 1890 | 1891 | DECLARE_FUNCTION(execArray_Sort) 1892 | { 1893 | Stack.MostRecentProperty = nullptr; 1894 | Stack.StepCompiledIn(NULL); 1895 | void* ArrayAddr = Stack.MostRecentPropertyAddress; 1896 | FArrayProperty* ArrayProperty = Cast(Stack.MostRecentProperty); 1897 | if (!ArrayProperty) 1898 | { 1899 | Stack.bArrayContextFailed = true; 1900 | return; 1901 | } 1902 | 1903 | P_GET_UBOOL(bAscendingOrder); 1904 | 1905 | P_GET_PROPERTY(FNameProperty, VariableName); 1906 | 1907 | P_FINISH; 1908 | P_NATIVE_BEGIN; 1909 | GenericArray_Sort(ArrayAddr, ArrayProperty, bAscendingOrder, VariableName); 1910 | P_NATIVE_END; 1911 | } 1912 | 1913 | /** 1914 | * Calls PrestreamTextures() for all the actor's meshcomponents. 1915 | * PrestreamTextures() tells the streaming system to start loading all textures with all mip-levels. 1916 | * @param Seconds - Number of seconds to force all mip-levels to be resident 1917 | * @param bEnableStreaming - Whether to start (true) or stop (false) streaming 1918 | * @param CinematicTextureGroups - Bitfield indicating which texture groups that use extra high-resolution mips 1919 | */ 1920 | UFUNCTION(Category = "Victory BP Library|Actor", BlueprintCallable, Meta = (DisplayName = "PrestreamTextures (Actor)")) 1921 | static void Actor_PrestreamTextures(AActor* Target, float Seconds = 1.0f, bool bEnableStreaming = true, int32 CinematicTextureGroups = 0); 1922 | 1923 | /** 1924 | * Tells the streaming system to start loading all textures with all mip-levels. 1925 | * @param Seconds - Number of seconds to force all mip-levels to be resident 1926 | * @param bEnableStreaming - Whether to start (true) or stop (false) streaming 1927 | * @param CinematicTextureGroups - Bitfield indicating which texture groups that use extra high-resolution mips 1928 | */ 1929 | UFUNCTION(Category = "Victory BP Library|Components", BlueprintCallable, Meta = (DisplayName = "PrestreamTextures (Component)")) 1930 | static void Component_PrestreamTextures(UMeshComponent* Target, float Seconds = 1.0f, bool bEnableStreaming = true, int32 CinematicTextureGroups = 0); 1931 | 1932 | /** 1933 | * Converts the screen position (primary screen's top left corner) supplied by pointer events or similar 1934 | * to the local space of viewport related to WorldContextObject. 1935 | * 1936 | * @param WorldContextObject World context. 1937 | * @param ScreenPosition Coordinates from FPointerEvent GetScreenSpacePosition() or similar. 1938 | * @param OutViewportPosition Coordinates based on the local viewport (fullscreen or otherwise). 1939 | * 1940 | * @return True if OutViewportPosition is not 0,0. 1941 | */ 1942 | UFUNCTION(Category = "Victory BP Library|Game|Viewport", BlueprintCallable, meta=(WorldContext="WorldContextObject")) 1943 | static bool GetViewportPosition(UObject* WorldContextObject, const FVector2D& ScreenPosition, FVector2D& OutViewportPosition); 1944 | 1945 | /** 1946 | * Does a line collision trace based the viewport position and returns the first blocking hit encountered. 1947 | * This trace finds the objects that RESPOND to the given TraceChannel 1948 | * 1949 | * @param WorldContextObject World context. 1950 | * @param ViewportPosition Local space of viewport from GetViewportPosition() or similar. 1951 | * @param TraceChannel 1952 | * @param bTraceComplex True to test against complex collision, false to test against simplified collision. 1953 | * @param OutHitResult Properties of the trace hit. 1954 | * 1955 | * @return True if there was a hit, false otherwise. 1956 | */ 1957 | UFUNCTION(Category = "Victory BP Library|Game|Viewport", BlueprintCallable, Meta = (WorldContext="WorldContextObject", bTraceComplex = true, TraceChannel = ECC_Visibility)) 1958 | static bool GetViewportPositionHitResultByChannel(UObject* WorldContextObject, const FVector2D& ViewportPosition, ECollisionChannel TraceChannel, bool bTraceComplex, FHitResult& OutHitResult); 1959 | 1960 | /** 1961 | * Transforms the viewport position into a world space origin and direction. 1962 | * 1963 | * @param WorldContextObject World context. 1964 | * @param ViewportPosition Local space of viewport from GetViewportPosition() or similar. 1965 | * @param OutWorldOrigin Corresponding 3D location in world space. 1966 | * @param OutWorldDirection World space direction vector away from the camera at the given 2d point. 1967 | * 1968 | * @return false if something went wrong during the deproject process. 1969 | */ 1970 | UFUNCTION(Category = "Victory BP Library|Game|Viewport", BlueprintCallable, Meta = (WorldContext="WorldContextObject")) 1971 | static bool ViewportPositionDeproject(UObject* WorldContextObject, const FVector2D& ViewportPosition, FVector& OutWorldOrigin, FVector& OutWorldDirection); 1972 | 1973 | /** 1974 | * Inserts child widget into panel widget at given location. 1975 | * NOTE: The child widgets "Construct" event will be fired again! 1976 | * 1977 | * @param Parent - The panel to insert the child into. 1978 | * @param Index - Where to insert the new widget. 1979 | * @param Content - The child widget to insert. 1980 | * @return slot assigned to content. 1981 | */ 1982 | UFUNCTION(Category = "Victory BP Library|Widget|Panel", BlueprintCallable) 1983 | static class UPanelSlot* InsertChildAt(class UWidget* Parent, int32 Index, UWidget* Content); 1984 | 1985 | /** Flushes the current key state for target player controller. */ 1986 | UFUNCTION(Category = "Victory BP Library|Input", BlueprintCallable) 1987 | static void FlushPressedKeys(class APlayerController* PlayerController); 1988 | 1989 | UFUNCTION(Category = "Victory BP Library|Vector", BlueprintPure) 1990 | static FVector GetVectorRelativeLocation(FVector ParentLocation, FRotator ParentRotation, FVector ChildLocation); 1991 | 1992 | UFUNCTION(Category = "Victory BP Library|Components", BlueprintPure, Meta = (DefaultToSelf = "ChildComponent")) 1993 | static FVector GetComponentRelativeLocation(class USceneComponent* ParentComponent, class USceneComponent* ChildComponent); 1994 | 1995 | UFUNCTION(Category = "Victory BP Library|Actor", BlueprintPure, Meta = (DefaultToSelf = "ChildActor")) 1996 | static FVector GetActorRelativeLocation(class AActor* ParentActor, class AActor* ChildActor); 1997 | 1998 | UFUNCTION(Category = "Victory BP Library|Rotator", BlueprintPure) 1999 | static FRotator GetRotatorRelativeRotation(FRotator ParentRotation, FRotator ChildRotation); 2000 | 2001 | UFUNCTION(Category = "Victory BP Library|Components", BlueprintPure, Meta = (DefaultToSelf = "ChildComponent")) 2002 | static FRotator GetComponentRelativeRotation(class USceneComponent* ParentComponent, class USceneComponent* ChildComponent); 2003 | 2004 | UFUNCTION(Category = "Victory BP Library|Actor", BlueprintPure, Meta = (DefaultToSelf = "ChildActor")) 2005 | static FRotator GetActorRelativeRotation(class AActor* ParentActor, class AActor* ChildActor); 2006 | 2007 | /** 2008 | * Helper function to calculate vertical FOV from horizontal FOV and aspect ratio. 2009 | * Useful to for determining distance from camera fit in-game objects to the width of the screen. 2010 | */ 2011 | UFUNCTION(Category = "Victory BP Library|Game|Viewport", BlueprintPure) 2012 | static float HorizontalFOV(float VerticalFOV, float AspectRatio); 2013 | 2014 | /** 2015 | * Helper function to calculate vertical FOV from horizontal FOV and aspect ratio. 2016 | * Useful to for determining distance from camera fit in-game objects to the height of the screen. 2017 | */ 2018 | UFUNCTION(Category = "Victory BP Library|Game|Viewport", BlueprintPure) 2019 | static float VerticalFOV(float HorizontalFOV, float AspectRatio); 2020 | 2021 | UFUNCTION(Category = "Victory BP Library|Utilities|String", BlueprintPure, Meta = (DisplayName = "IsEmpty")) 2022 | static bool StringIsEmpty(const FString& Target); 2023 | 2024 | //~~~~~~~~~ 2025 | 2026 | //~~~ KeyToTruth ~~~ 2027 | 2028 | //.h 2029 | /* Addition of strings (A + B) with pins. Contributed by KeyToTruth */ 2030 | UFUNCTION(BlueprintPure, meta = (DisplayName = "Append Multiple", Keywords = "concatenate combine append strings", CommutativeAssociativeBinaryOperator = "true"), Category = "Victory BP Library|String") 2031 | static FString AppendMultiple(FString A, FString B); 2032 | 2033 | //~~~ Mhousse ~~~ 2034 | 2035 | }; 2036 | 2037 | -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/VictoryBPHTML.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | By Rama 4 | 5 | */ 6 | #pragma once 7 | 8 | #include "Runtime/Engine/Classes/Kismet/BlueprintFunctionLibrary.h" 9 | #include "VictoryBPHTML.generated.h" 10 | 11 | 12 | //!! Can someone submit HTML5 update to Victory Git? 13 | 14 | UCLASS() 15 | class VICTORYBPLIBRARY_API UVictoryBPHTML : public UBlueprintFunctionLibrary 16 | { 17 | GENERATED_BODY() 18 | public: 19 | 20 | /** Is the current OS HTML5? This code will only run in games packaged for HTML5, it will not run in Editor builds :) Use this to customize particle FX for HTML5 vs PC builds! Or for any custom HTML5-specific game logic! <3 Rama*/ 21 | /* 22 | UFUNCTION(BlueprintPure, Category = "Victory BP Library|HTML5") 23 | static bool IsHTML(); 24 | */ 25 | 26 | /* 27 | UFUNCTION(BlueprintCallable, Category = "Victory BP Library|HTML5") 28 | static void VictoryHTML5_SetCursorVisible(bool MakeVisible); 29 | */ 30 | }; 31 | 32 | -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/VictoryBPLibrary.h: -------------------------------------------------------------------------------- 1 | /* 2 | By Rama 3 | */ 4 | #pragma once 5 | 6 | #include "CoreMinimal.h" 7 | #include "Modules/ModuleInterface.h" 8 | #include "Modules/ModuleManager.h" 9 | 10 | class FVictoryBPLibraryModule : public IModuleInterface 11 | { 12 | public: 13 | 14 | /** IModuleInterface implementation */ 15 | virtual void StartupModule() override; 16 | virtual void ShutdownModule() override; 17 | }; -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/VictoryISM.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | By Rama 4 | 5 | */ 6 | #include "VictoryBPLibraryPrivatePCH.h" 7 | #include "VictoryISM.h" 8 | 9 | ////////////////////////////////////////////////////////////////////////// 10 | // VictoryISM 11 | 12 | AVictoryISM::AVictoryISM(const FObjectInitializer& ObjectInitializer) 13 | : Super(ObjectInitializer) 14 | { 15 | RootComponent = Mesh = ObjectInitializer.CreateDefaultSubobject(this, "VictoryInstancedMesh"); 16 | } 17 | 18 | void AVictoryISM::BeginPlay() 19 | { 20 | Super::BeginPlay(); 21 | //~~~~~~~~~ 22 | 23 | 24 | } -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/VictoryISM.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | By Rama 4 | 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h" 10 | #include "VictoryISM.generated.h" 11 | 12 | UCLASS() 13 | class AVictoryISM : public AActor 14 | { 15 | GENERATED_BODY() 16 | public: 17 | 18 | AVictoryISM(const FObjectInitializer& ObjectInitializer); 19 | 20 | UPROPERTY(Category = "Joy ISM", VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) 21 | UInstancedStaticMeshComponent* Mesh; 22 | 23 | //~~~~~~~~~~~~~ 24 | // ISM 25 | //~~~~~~~~~~~~~ 26 | public: 27 | virtual void BeginPlay() override; 28 | 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/VictoryPC.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | By Rama 4 | 5 | */ 6 | 7 | #include "VictoryBPLibraryPrivatePCH.h" 8 | #include "VictoryPC.h" 9 | 10 | #include "Runtime/Engine/Classes/Kismet/GameplayStatics.h" 11 | 12 | DEFINE_LOG_CATEGORY(VictoryPCLog) 13 | 14 | ////////////////////////////////////////////////////////////////////////// 15 | // AVictoryPC 16 | 17 | AVictoryPC::AVictoryPC(const FObjectInitializer& ObjectInitializer) 18 | : Super(ObjectInitializer) 19 | { 20 | 21 | } 22 | 23 | 24 | UAudioComponent* AVictoryPC::VictoryPlaySpeechSound( 25 | USoundBase* Sound 26 | ,float VolumeMultiplier 27 | ,float PitchMultiplier 28 | , float StartTime) 29 | { 30 | 31 | UAudioComponent* Audio = UGameplayStatics::SpawnSound2D(this,Sound,VolumeMultiplier,PitchMultiplier,StartTime); 32 | if(Audio) 33 | { 34 | //Subtitle Delegate for You! 35 | // <3 Rama 36 | Audio->OnQueueSubtitles.BindDynamic(this, &AVictoryPC::Subtitles_CPPDelegate); 37 | } 38 | 39 | /* 40 | Note that the OnAudioFinished is BP assignable off of return of this node! 41 | 42 | //called when we finish playing audio, either because it played to completion or because a Stop() call turned it off early 43 | UPROPERTY(BlueprintAssignable) 44 | FOnAudioFinished OnAudioFinished; 45 | */ 46 | 47 | return Audio; 48 | } 49 | 50 | void AVictoryPC::Subtitles_CPPDelegate(const TArray& Subtitles, float CueDuration) 51 | { 52 | TArray VictorySubtitles; 53 | for(const FSubtitleCue& Each : Subtitles) 54 | { 55 | VictorySubtitles.Add(FVictorySubtitleCue(Each.Text,Each.Time)); 56 | } 57 | 58 | OnVictorySubtitlesQueued(VictorySubtitles,CueDuration); 59 | } 60 | 61 | //~~~ 62 | 63 | bool AVictoryPC::VictoryPC_GetMyIP_SendRequest() 64 | { 65 | FHttpModule* Http = &FHttpModule::Get(); 66 | 67 | if(!Http) 68 | { 69 | return false; 70 | } 71 | 72 | if(!Http->IsHttpEnabled()) 73 | { 74 | return false; 75 | } 76 | //~~~~~~~~~~~~~~~~~~~ 77 | 78 | FString TargetHost = "http://api.ipify.org"; 79 | auto Request = Http->CreateRequest(); 80 | Request->SetVerb("GET"); 81 | Request->SetURL(TargetHost); 82 | Request->SetHeader("User-Agent", "VictoryBPLibrary/1.0"); 83 | Request->SetHeader("Content-Type" ,"text/html"); 84 | 85 | Request->OnProcessRequestComplete().BindUObject(this, &AVictoryPC::HTTPOnResponseReceived); 86 | if (!Request->ProcessRequest()) 87 | { 88 | return false; 89 | } 90 | 91 | return true; 92 | } 93 | 94 | void AVictoryPC::HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) 95 | { 96 | FString ResponseStr = "AVictoryPC::HTTPOnResponseReceived>>> Connection Error"; 97 | if(bWasSuccessful) 98 | { 99 | ResponseStr = Response->GetContentAsString(); 100 | } 101 | 102 | this->VictoryPC_GetMyIP_DataReceived(ResponseStr); 103 | } 104 | 105 | -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/VictoryPC.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | By Rama 4 | 5 | */ 6 | #pragma once 7 | 8 | //HTTP 9 | #include "Http.h" 10 | 11 | #include "Runtime/Engine/Classes/GameFramework/PlayerController.h" 12 | #include "VictoryPC.generated.h" 13 | 14 | DECLARE_LOG_CATEGORY_EXTERN(VictoryPCLog, Log, All); 15 | 16 | 17 | //Exposing the UE4 Subtitle system for Solus 18 | // <3 Rama 19 | USTRUCT(BlueprintType) 20 | struct FVictorySubtitleCue 21 | { 22 | GENERATED_USTRUCT_BODY() 23 | 24 | /** The text to appear in the subtitle. */ 25 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=SubtitleCue) 26 | FText SubtitleText; 27 | 28 | /** The time at which the subtitle is to be displayed, in seconds relative to the beginning of the line. */ 29 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=SubtitleCue) 30 | float Time; 31 | 32 | FVictorySubtitleCue() 33 | : Time(0) 34 | { } 35 | FVictorySubtitleCue(const FText& InText, float InTime) 36 | : SubtitleText(InText) 37 | , Time(InTime) 38 | {} 39 | }; 40 | 41 | UCLASS() 42 | class VICTORYBPLIBRARY_API AVictoryPC : public APlayerController 43 | { 44 | GENERATED_BODY() 45 | 46 | public: 47 | AVictoryPC(const FObjectInitializer& ObjectInitializer); 48 | 49 | /** 50 | * When the sound is played OnVictorySubtitlesQueued will be called with the subtitles! 51 | * You can bind an event off of the audio component for OnAudioFinished to know hwen the sound is done! 52 | */ 53 | UFUNCTION(Category="Victory Subtitles", BlueprintCallable, BlueprintCosmetic, meta=( UnsafeDuringActorConstruction = "true", Keywords = "play" )) 54 | UAudioComponent* VictoryPlaySpeechSound(class USoundBase* Sound, float VolumeMultiplier = 1.f, float PitchMultiplier = 1.f, float StartTime = 0.f); 55 | 56 | UFUNCTION(Category="Victory Subtitles", BlueprintImplementableEvent) 57 | void OnVictorySubtitlesQueued(const TArray& VictorySubtitles, float CueDuration); 58 | 59 | UFUNCTION() 60 | void Subtitles_CPPDelegate(const TArray& VictorySubtitles, float CueDuration); 61 | 62 | public: 63 | /** This node relies on http://api.ipify.org, so if this node ever stops working, check out http://api.ipify.org. Returns false if the operation could not occur because HTTP module was not loaded or unable to process request. */ 64 | UFUNCTION(BlueprintCallable, Category="Victory PC") 65 | bool VictoryPC_GetMyIP_SendRequest(); 66 | 67 | /** Implement this event to receive your IP once the request is processed! This requires that your computer has a live internet connection */ 68 | UFUNCTION(BlueprintImplementableEvent, Category = "Victory PC", meta = (DisplayName = "Victory PC ~ GetMyIP ~ Data Received!")) 69 | void VictoryPC_GetMyIP_DataReceived(const FString& YourIP); 70 | 71 | void HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); 72 | }; 73 | -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/VictoryTMapComp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | By Rama 4 | 5 | */ 6 | 7 | #include "VictoryBPLibraryPrivatePCH.h" 8 | #include "VictoryTMapComp.h" 9 | 10 | DEFINE_LOG_CATEGORY(VictoryTMapLog) 11 | 12 | ////////////////////////////////////////////////////////////////////////// 13 | // UVictoryTMapComp 14 | 15 | UVictoryTMapComp::UVictoryTMapComp(const FObjectInitializer& ObjectInitializer) 16 | : Super(ObjectInitializer) 17 | { 18 | 19 | } 20 | 21 | //~~~ Add ~~~ 22 | void UVictoryTMapComp::String_Actor__AddPair(FString Key, AActor* Value) 23 | { 24 | StringActor.Add(Key,Value); 25 | } 26 | 27 | void UVictoryTMapComp::String_String__AddPair(FString Key, FString Value) 28 | { 29 | StringString.Add(Key,Value); 30 | } 31 | 32 | void UVictoryTMapComp::String_Int__AddPair(FString Key, int32 Value) 33 | { 34 | StringInt.Add(Key,Value); 35 | } 36 | 37 | void UVictoryTMapComp::String_Vector__AddPair(FString Key, FVector Value) 38 | { 39 | StringVector.Add(Key,Value); 40 | } 41 | void UVictoryTMapComp::String_Rotator__AddPair(FString Key, FRotator Value) 42 | { 43 | StringRotator.Add(Key,Value); 44 | } 45 | 46 | void UVictoryTMapComp::Int_Vector__AddPair(int32 Key, FVector Value) 47 | { 48 | IntVector.Add(Key,Value); 49 | } 50 | 51 | void UVictoryTMapComp::Int_Float__AddPair(int32 Key, float Value) 52 | { 53 | IntFloat.Add(Key,Value); 54 | } 55 | 56 | //~~~ Get ~~~ 57 | AActor* UVictoryTMapComp::String_Actor__Get(FString Key, bool& IsValid) 58 | { 59 | IsValid = false; 60 | if(!StringActor.Contains(Key)) 61 | { 62 | return nullptr; 63 | } 64 | IsValid = true; 65 | return StringActor[Key]; 66 | } 67 | 68 | FString UVictoryTMapComp::String_String__Get(FString Key, bool& IsValid) 69 | { 70 | IsValid = false; 71 | if(!StringString.Contains(Key)) 72 | { 73 | return ""; 74 | } 75 | IsValid = true; 76 | return StringString[Key]; 77 | } 78 | 79 | int32 UVictoryTMapComp::String_Int__Get(FString Key, bool& IsValid) 80 | { 81 | IsValid = false; 82 | if(!StringInt.Contains(Key)) 83 | { 84 | return 0; 85 | } 86 | IsValid = true; 87 | return StringInt[Key]; 88 | } 89 | 90 | FVector UVictoryTMapComp::String_Vector__Get(FString Key, bool& IsValid) 91 | { 92 | IsValid = false; 93 | if(!StringVector.Contains(Key)) 94 | { 95 | return FVector::ZeroVector; 96 | } 97 | IsValid = true; 98 | return StringVector[Key]; 99 | } 100 | FRotator UVictoryTMapComp::String_Rotator__Get(FString Key, bool& IsValid) 101 | { 102 | IsValid = false; 103 | if(!StringRotator.Contains(Key)) 104 | { 105 | return FRotator::ZeroRotator; 106 | } 107 | IsValid = true; 108 | return StringRotator[Key]; 109 | } 110 | 111 | FVector UVictoryTMapComp::Int_Vector__Get(int32 Key, bool& IsValid) 112 | { 113 | IsValid = false; 114 | if(!IntVector.Contains(Key)) 115 | { 116 | return FVector::ZeroVector; 117 | } 118 | IsValid = true; 119 | return IntVector[Key]; 120 | } 121 | 122 | float UVictoryTMapComp::Int_Float__Get(int32 Key, bool& IsValid) 123 | { 124 | IsValid = false; 125 | if(!IntFloat.Contains(Key)) 126 | { 127 | return -1; 128 | } 129 | IsValid = true; 130 | return IntFloat[Key]; 131 | } 132 | 133 | //~~~ Remove ~~~ 134 | void UVictoryTMapComp::String_Actor__Remove(FString Key) 135 | { 136 | StringActor.Remove(Key); 137 | } 138 | 139 | void UVictoryTMapComp::String_String__Remove(FString Key) 140 | { 141 | StringString.Remove(Key); 142 | } 143 | 144 | void UVictoryTMapComp::String_Int__Remove(FString Key) 145 | { 146 | StringInt.Remove(Key); 147 | } 148 | 149 | void UVictoryTMapComp::String_Vector__Remove(FString Key) 150 | { 151 | StringVector.Remove(Key); 152 | } 153 | void UVictoryTMapComp::String_Rotator__Remove(FString Key) 154 | { 155 | StringRotator.Remove(Key); 156 | } 157 | 158 | void UVictoryTMapComp::Int_Vector__Remove(int32 Key) 159 | { 160 | IntVector.Remove(Key); 161 | } 162 | 163 | void UVictoryTMapComp::Int_Float__Remove(int32 Key, float Value) 164 | { 165 | IntFloat.Remove(Key); 166 | } 167 | 168 | //~~~ Clear ~~~ 169 | void UVictoryTMapComp::String_Actor__Clear() 170 | { 171 | StringActor.Empty(); 172 | } 173 | 174 | void UVictoryTMapComp::String_String__Clear() 175 | { 176 | StringString.Empty(); 177 | } 178 | 179 | void UVictoryTMapComp::String_Int__Clear() 180 | { 181 | StringInt.Empty(); 182 | } 183 | 184 | void UVictoryTMapComp::String_Vector__Clear() 185 | { 186 | StringVector.Empty(); 187 | } 188 | void UVictoryTMapComp::String_Rotator__Clear() 189 | { 190 | StringRotator.Empty(); 191 | } 192 | 193 | void UVictoryTMapComp::Int_Vector__Clear() 194 | { 195 | IntVector.Empty(); 196 | } 197 | 198 | void UVictoryTMapComp::Int_Float__Clear() 199 | { 200 | IntFloat.Empty(); 201 | } 202 | -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/Public/VictoryTMapComp.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | By Rama 4 | 5 | */ 6 | #pragma once 7 | 8 | #include "VictoryTMapComp.generated.h" 9 | 10 | DECLARE_LOG_CATEGORY_EXTERN(VictoryTMapLog, Log, All); 11 | 12 | UCLASS(ClassGroup=VictoryBPLibrary, meta=(BlueprintSpawnableComponent)) 13 | class UVictoryTMapComp : public UActorComponent 14 | { 15 | GENERATED_BODY() 16 | public: 17 | UVictoryTMapComp(const FObjectInitializer& ObjectInitializer); 18 | 19 | //Add 20 | public: 21 | /** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */ 22 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add") 23 | void String_Actor__AddPair(FString Key, AActor* Value); 24 | 25 | /** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */ 26 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add") 27 | void String_String__AddPair(FString Key, FString Value); 28 | 29 | /** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */ 30 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add") 31 | void String_Int__AddPair(FString Key, int32 Value); 32 | 33 | /** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */ 34 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add") 35 | void String_Vector__AddPair(FString Key, FVector Value); 36 | 37 | /** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */ 38 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add") 39 | void String_Rotator__AddPair(FString Key, FRotator Value); 40 | 41 | /** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */ 42 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add") 43 | void Int_Vector__AddPair(int32 Key, FVector Value); 44 | 45 | /** If a key already exists in the TMap, its current value is replaced with your new value! <3 Rama */ 46 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Add") 47 | void Int_Float__AddPair(int32 Key, float Value); 48 | 49 | //Get 50 | public: 51 | /** Get the value associated with they key at fastest possible speed! <3 Rama */ 52 | UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get") 53 | AActor* String_Actor__Get(FString Key, bool& IsValid); 54 | 55 | /** Get the value associated with they key at fastest possible speed! <3 Rama */ 56 | UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get") 57 | FString String_String__Get(FString Key, bool& IsValid); 58 | 59 | /** Get the value associated with they key at fastest possible speed! <3 Rama */ 60 | UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get") 61 | int32 String_Int__Get(FString Key, bool& IsValid); 62 | 63 | /** Get the value associated with they key at fastest possible speed! <3 Rama */ 64 | UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get") 65 | FVector String_Vector__Get(FString Key, bool& IsValid); 66 | 67 | /** Get the value associated with they key at fastest possible speed! <3 Rama */ 68 | UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get") 69 | FRotator String_Rotator__Get(FString Key, bool& IsValid); 70 | 71 | /** Get the value associated with they key at fastest possible speed! <3 Rama */ 72 | UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get") 73 | FVector Int_Vector__Get(int32 Key, bool& IsValid); 74 | 75 | /** Get the value associated with they key at fastest possible speed! <3 Rama */ 76 | UFUNCTION(BlueprintPure,Category="Victory BP Library|TMap Component|Get") 77 | float Int_Float__Get(int32 Key, bool& IsValid); 78 | 79 | //Remove 80 | public: 81 | /** Removes the key and any associated value from the TMap! <3 Rama */ 82 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove") 83 | void String_Actor__Remove(FString Key); 84 | 85 | /** Removes the key and any associated value from the TMap! <3 Rama */ 86 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove") 87 | void String_String__Remove(FString Key); 88 | 89 | /** Removes the key and any associated value from the TMap! <3 Rama */ 90 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove") 91 | void String_Int__Remove(FString Key); 92 | 93 | /** Removes the key and any associated value from the TMap! <3 Rama */ 94 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove") 95 | void String_Vector__Remove(FString Key); 96 | 97 | /** Removes the key and any associated value from the TMap! <3 Rama */ 98 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove") 99 | void String_Rotator__Remove(FString Key); 100 | 101 | /** Removes the key and any associated value from the TMap! <3 Rama */ 102 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove") 103 | void Int_Vector__Remove(int32 Key); 104 | 105 | /** Removes the key and any associated value from the TMap! <3 Rama */ 106 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Remove") 107 | void Int_Float__Remove(int32 Key, float Value); 108 | 109 | //Clear 110 | public: 111 | /** Removes every entry from the TMap! <3 Rama */ 112 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset")) 113 | void String_Actor__Clear(); 114 | 115 | /** Removes every entry from the TMap! <3 Rama */ 116 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset")) 117 | void String_String__Clear(); 118 | 119 | /** Removes every entry from the TMap! <3 Rama */ 120 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset")) 121 | void String_Int__Clear(); 122 | 123 | /** Removes every entry from the TMap! <3 Rama */ 124 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset")) 125 | void String_Vector__Clear(); 126 | 127 | /** Removes every entry from the TMap! <3 Rama */ 128 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset")) 129 | void String_Rotator__Clear(); 130 | 131 | /** Removes every entry from the TMap! <3 Rama */ 132 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset")) 133 | void Int_Vector__Clear(); 134 | 135 | /** Removes every entry from the TMap! <3 Rama */ 136 | UFUNCTION(BlueprintCallable,Category="Victory BP Library|TMap Component|Clear", meta = (Keywords = "Clear Empty Reset")) 137 | void Int_Float__Clear(); 138 | 139 | public: 140 | TMap StringActor; 141 | TMap StringString; 142 | TMap StringInt; 143 | TMap StringVector; 144 | TMap StringRotator; 145 | TMap IntVector; 146 | TMap IntFloat; 147 | 148 | }; -------------------------------------------------------------------------------- /Source/VictoryBPLibrary/VictoryBPLibrary.Build.cs: -------------------------------------------------------------------------------- 1 | // Some copyright should be here... 2 | 3 | using UnrealBuildTool; 4 | 5 | public class VictoryBPLibrary : ModuleRules 6 | { 7 | public VictoryBPLibrary(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | //Get rid of debug commandline length compile error 10 | //https://developercommunity.visualstudio.com/content/problem/668411/command-line-error-d8049-still-happening.html 11 | bLegacyPublicIncludePaths = false; 12 | 13 | PrivatePCHHeaderFile = "Private/VictoryBPLibraryPrivatePCH.h"; 14 | 15 | //4.15 Include What You Use 16 | bEnforceIWYU = false; 17 | 18 | PublicIncludePaths.AddRange( 19 | new string[] { 20 | "VictoryBPLibrary/Public" 21 | 22 | // ... add public include paths required here ... 23 | } 24 | ); 25 | 26 | 27 | PrivateIncludePaths.AddRange( 28 | new string[] { 29 | "VictoryBPLibrary/Private", 30 | 31 | // ... add other private include paths required here ... 32 | } 33 | ); 34 | 35 | 36 | PublicDependencyModuleNames.AddRange( 37 | new string[] 38 | { 39 | "Core" 40 | 41 | // ... add other public dependencies that you statically link with here ... 42 | } 43 | ); 44 | 45 | 46 | PrivateDependencyModuleNames.AddRange( 47 | new string[] 48 | { 49 | "CoreUObject", 50 | "Engine", 51 | "InputCore", 52 | 53 | "RHI", 54 | "RenderCore", 55 | 56 | "HTTP", 57 | "UMG", "Slate", "SlateCore", 58 | 59 | "ImageWrapper", 60 | 61 | "PhysicsCore", 62 | "PhysX", 63 | 64 | "HeadMountedDisplay", 65 | 66 | "AIModule", 67 | 68 | "NavigationSystem", 69 | 70 | "Vorbis", 71 | 72 | //FPlatformApplicationMisc 73 | "ApplicationCore", 74 | 75 | //For UDeveloperSettings, FYI <3 Rama 76 | "DeveloperSettings" 77 | } 78 | ); 79 | 80 | //APEX EXCLUSIONS 81 | if (Target.Platform != UnrealTargetPlatform.Android && Target.Platform != UnrealTargetPlatform.IOS) 82 | { 83 | PrivateDependencyModuleNames.AddRange( 84 | new string[] 85 | { 86 | "APEX" 87 | } 88 | ); 89 | 90 | PublicDependencyModuleNames.AddRange( 91 | new string[] 92 | { 93 | "ApexDestruction" 94 | } 95 | ); 96 | 97 | } 98 | 99 | 100 | DynamicallyLoadedModuleNames.AddRange( 101 | new string[] 102 | { 103 | // ... add any modules that your module loads dynamically here ... 104 | } 105 | ); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /VictoryBPLibrary.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion" : 3, 3 | "Version" : 1, 4 | "VersionName" : "1.0", 5 | "FriendlyName" : "Victory Plugin", 6 | "Description" : "120+ Custom Blueprint Nodes For You! <3 Rama", 7 | "Category" : "Rama", 8 | "CreatedBy" : "Rama", 9 | "CreatedByURL" : "http://www.ue4code.com", 10 | "DocsURL" : "http://www.ue4code.com", 11 | "MarketplaceURL" : "http://www.ue4code.com", 12 | "SupportURL" : "http://www.ue4code.com", 13 | "EnabledByDefault" : true, 14 | "CanContainContent" : false, 15 | "IsBetaVersion" : false, 16 | "Installed" : true, 17 | "RequiresBuildPlatform" : false, 18 | "Modules" : 19 | [ 20 | { 21 | "Name" : "VictoryBPLibrary", 22 | "Type" : "Runtime", 23 | "LoadingPhase" : "PreDefault", 24 | "WhitelistPlatforms" : 25 | [ 26 | "Win64", 27 | "Win32", 28 | ] 29 | } 30 | ], 31 | "Plugins" : 32 | [ 33 | { 34 | "Name": "ApexDestruction", 35 | "Enabled": true 36 | } 37 | ] 38 | } 39 | --------------------------------------------------------------------------------