Skip to content

Instantly share code, notes, and snippets.

@error454
error454 / MinimapUserWidget.cpp
Created January 22, 2024 03:19
Barebones example of texture math for minimap, just enough boilerplate to describe GetImageCoordsFromWorldLoc
#include "MinimapUserWidget.h"
#include "Kismet/GameplayStatics.h"
FVector2D UMinimapUserWidget::GetImageCoordsFromWorldLoc(FVector WorldLoc) const
{
// Image coordinate system in UMG is:
// 0,0 ------> +x
// |
// |
// |
@error454
error454 / fix_dropbox.sh
Created December 17, 2019 20:50
Dropbox FS Fix
#!/bin/bash
##############################################################################
# Workaround for Dropbox daemon
# -----------------------------
# Verified on Dropbox v77.4.131
# Just make it executable (if need, using
# $ chmod a+x fix_dropbox
# ) and run it.
# Author: Здравко
# www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790
@error454
error454 / example.cpp
Last active May 25, 2021 00:42
Vivox UE4 Quest Microphone
#include "AndroidPermissionFunctionLibrary.h"
#include "AndroidPermissionCallbackProxy.h"
void SomeFuncWhereYouNeedPermissions()
{
#if PLATFORM_ANDROID
// If we don't have the permission
if (!UAndroidPermissionFunctionLibrary::CheckPermission(TEXT("android.permission.RECORD_AUDIO")))
{
// Build an array of permissions to request
@error454
error454 / babyshower.py
Last active October 15, 2018 23:05
Write numbers to images for baby shower guessing game
#Plow through all images in the folder
#Write a tracking number in the top left corner
#Save a text file that shows the original filename and the
#tracking number.
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import glob, os
import random
@error454
error454 / BuildConfiguration.xml
Created June 14, 2018 18:08
Force UE4 to use 2017 toolchain without passing any -2017 flags
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<VCProjectFileGenerator>
<Version>VisualStudio2017</Version>
</VCProjectFileGenerator>
<WindowsPlatform>
<Compiler>VisualStudio2017</Compiler>
</WindowsPlatform>
</Configuration>
@error454
error454 / spatial-workspace.sk
Last active April 5, 2017 20:18
Spatial SK Workspace
!r : MathLib.compose_rotators(GameLib.player_controller.control_rotation, RotationAngles!yaw_pitch_roll(0 0 10))
GameLib.player_controller.control_rotation_set(r)
//
// Queen
//
// Print all the data we need to recreate the queen at her current translation/rotation/scale
BP_Queen.instances_first.transform
// Move the queen 100 world units to the right
@error454
error454 / 52week.py
Created December 30, 2016 19:42
52 Week Photo Challenge Text Generator
# Used to generate text to post in the description of a Flickr
# group for a 52 week photo challenge.
#
# It will generate text like this:
# Week 01: 01-01 - 01-07
# Week 02: 01-08 - 01-14
# Week 03: 01-15 - 01-21
# For an entire year.
from datetime import date, timedelta
@error454
error454 / UE4Tools.gs
Last active October 1, 2021 00:22
Google Drive Sheet to CSV export for UE4
/**
* @OnlyCurrentDoc
*/
kvString = "=KV(";
kvaString = "=KVA(";
/**
* A special function that runs when the spreadsheet is open, used to add a
* custom menu to the spreadsheet.
@error454
error454 / ScreenEdge.cpp
Last active October 15, 2016 19:21
Screen Edge Detection UE4
// This code is meant to be placed in a Player Camera Manager
// ScreenX - screen space coordinate from [-1, 1] left to right that you want to find the world location of
// ScreenY - screen space coordinate from [-1, 1] top to bottom that you want to find the world location of
// OutWorldLocation - The vector to put the resulting world location in
// OutWorldDirection - The vector to put the resulting world direction in
// Controller - Controller to use for deprojection
// ViewportSize - The size of the viewport
bool APlayerCameraManager::DeprojectScreenSpaceToWorld(float ScreenX, float ScreenY, FVector& OutWorldLocation, FVector& OutWorldDirection, APlayerController* Controller, const FVector2D ViewportSize) const
{
@error454
error454 / PythonHueAmbilight.py
Created May 22, 2016 22:12
Ambilight emulation using python
from PIL import ImageGrab
from PIL import ImageStat
from phue import Bridge
from time import sleep
import time
import math
import zachhue
import colorsys
width = 1920