Skip to content

Instantly share code, notes, and snippets.

View mossyblog's full-sized avatar

sba mossyblog

  • Riagenic
  • Australia
View GitHub Profile
/*
The FPosition struct is defined with a NetSerialize function. This function handles the custom serialization logic for the struct.
The UMyHealthComponent class contains a Position property of type FPosition. This property is marked with the Replicated
specifier, indicating that it should be considered for replication.
The GetLifetimeReplicatedProps function is implemented to tell the Unreal Engine replication system which properties of the
UMyHealthComponent should be replicated. In this case, the Position property is added to the list.
When the Position property changes on the server, Unreal's replication system will recognize it as "dirty" and will use the
@mossyblog
mossyblog / gist:07fc8b634ef88f278e39e6ba8be3c495
Created December 21, 2022 08:53
Unreal C++ / Wingsuit Component
#include "WingSuitComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "Components/CapsuleComponent.h"
UWingSuitComponent::UWingSuitComponent()
{
PrimaryComponentTick.bCanEverTick = true;
DescentRate = 1000.0f;
bIsWingSuiting = false;
@mossyblog
mossyblog / gist:d0194e697c127052105ee9a21fb7f98b
Created December 21, 2022 08:52
Unreal C++ Rope Swing Component
#include "SwingComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "Components/CapsuleComponent.h"
#include "Components/SceneComponent.h"
USwingComponent::USwingComponent()
{
PrimaryComponentTick.bCanEverTick = true;
@mossyblog
mossyblog / DLZMainMenu.c
Last active March 18, 2022 15:05
scripts/5_Mission/gui/DLZMainMenu.c
modded class MainMenu extends UIScriptedMenu
{
override Widget Init()
{
return super.Init();
}
}
// Note in my config.cpp i have this:
@mossyblog
mossyblog / app.py
Last active July 22, 2021 11:01
Sons First Code
from flask import Flask, request, redirect, url_for, render_template, session, flash
import sqlite3
import hashlib
import dbMain
app = Flask(__name__)
app.config["SECRET_KEY"] = "my_secret_key"
db_locale = 'igdbaccounts.db'
#----------------------------------------------
public abstract class Bindable : MonoBehaviour, INotifyPropertyChanged
{
private readonly Dictionary<string, object> _properties = new Dictionary<string, object>();
private static readonly StackTrace stackTrace = new StackTrace();
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Resolves a Property's name from a Lambda Expression passed in.
/// </summary>
package com.riagenic.BlockFarmer.core.asm.utils;
import com.google.common.collect.Maps;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.Charset;
@mossyblog
mossyblog / gist:bf5313c1e6596142edff
Created February 4, 2016 12:18
Render 3D Icon in Minecraft of a Item/Block - 1.8.9
public static void RenderFloatingItemIcon(float x, float y, float z, Item item, float partialTickTime, boolean animate) {
BlockPos pos = new BlockPos(x,y,z);
// Create Empty EntityItem to help with Rendering Positionining.
EntityItem entity = new EntityItem(mc.theWorld,pos.getX(),pos.getY(), pos.getZ());
if (entity.ticksExisted == 0)
{
entity.lastTickPosX = entity.posX;
entity.lastTickPosY = entity.posY;
entity.lastTickPosZ = entity.posZ;