Skip to content

Instantly share code, notes, and snippets.

@belzecue
belzecue / gist:4e4f64a579037e5b9c1088a9b7e82a1a
Created February 9, 2023 04:06 — forked from WolfgangSenff/gist:0a9c1d800db42a9a9441b2d0288ed0fd
GDScript 1.0 to 2.0 Beginner Friendly Conversion Guide
View gist:4e4f64a579037e5b9c1088a9b7e82a1a
Beginner-friendly GDScript 1 to GDScript 2 Conversion Guide
First and foremost, this should not be considered a replacement for the official migration guide,
found at https://docs.godotengine.org/en/latest/tutorials/migrating/upgrading_to_godot_4.html!
Instead, this document is intended to be a friendly guide to helping you upgrade your projects from
GDScript 1 to 2. To do this, I'm going to list the most common conversions I've run into while upgrading
a few of my games and tools. This document is written as of the first release candidate version of Godot 4.0.
The first thing to do when converting a project (no need if you're starting from new) is to either have your
project in source control, or make a duplicate of your entire project's folder and rename it. This will
@belzecue
belzecue / ad.md
Created January 7, 2023 18:55 — forked from rosswd/ad.md
Install Quake and the Arcane Dimensions Mod on a modern Windows system
View ad.md

How to Install Quake and the Arcane Dimensions Mod

Assumptions

This guide assumes you're using Windows 10 and the Steam version of Quake. Although it might work for other systems I don't have access to said systems. We will use Quakespasm as the Quake Engine.

Install Quake

  • Download and Install Quake from Steam
  • You can also install Mission Pack 1: Scourge of Armagon and Mission Pack 2: Dissolution of Eternity, if you like. Scourge of Armagon is seen as the better of the two.

Install the Soundtrack

@belzecue
belzecue / build.gd
Created January 7, 2023 14:57 — forked from imjp94/build.gd
Build script to help exporting Godot project.
View build.gd
tool
extends SceneTree
const PLATFORM_ANDROID = "Android"
const PLATFORM_HTML5 = "HTML5"
const PLATFORM_IOS = "iOS"
const PLATFORM_LINUX = "Linux/X11"
const PLATFORM_MAC = "Mac OSX"
const PLATFORM_UWP = "UWP"
const PLATFORM_WINDOWS = "Windows Desktop"
@belzecue
belzecue / gamepad_debugger.gd
Last active December 19, 2022 00:15 — forked from anthonyec/gamepad_debugger.gd
Godot gamepad input visualisation for debugging (GDScript 2)
View gamepad_debugger.gd
# Godot 3.x version of a Godot 4 script written by anthonyec at:
# https://gist.github.com/anthonyec/5342fce79b2b7b22ada748df0ad7f7c0
# This Godot 3.x version available at:
# https://gist.github.com/belzecue/025d8829f69dead512e58f44e990ce30/edit
# Attach script to a Control node.
tool
extends Control
export var device: int = 0
@belzecue
belzecue / MatchRectSize.gd
Created November 2, 2022 14:07 — forked from jasonwinterpixel/MatchRectSize.gd
Godot Match Rect Size
View MatchRectSize.gd
tool
extends Node
class_name MatchRectSize
onready var parent := get_parent() as Control
export(NodePath) var target_control
onready var target := get_node(target_control) as Control
export var match_x := true
export var match_y := true
View FlyCamera.gd
extends Camera
"""
Space/Enter - capture cursor
Escape - free cursor
WASDQE - move
Shift - fast movement
Ctrl - slow movement
"""
@belzecue
belzecue / Camera.gd
Created October 24, 2022 12:15 — forked from Garmelon/Camera.gd
Godot perspecive projection shaders
View Camera.gd
extends TextureRect
export var sensitivity: Vector3 = Vector3(0.005, 0.005, TAU/4)
var euler: Vector3 = Vector3.ZERO
func _init() -> void:
sensitivity.x *= -1
func _input(event: InputEvent) -> void:
if event.is_action_pressed("ui_cancel"):
@belzecue
belzecue / Uneune.shader
Created August 25, 2019 18:32 — forked from sugi-cho/Uneune.shader
頂点をいじるシェーダーで、法線もいじる
View Uneune.shader
Shader "Custom/Uneune" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_BumpMap ("bump",2D) = "bump" {}
_VNF ("vert normal factor", Float) = 1.0
_MNF ("map normal factor", Float) = 1.0
}
@belzecue
belzecue / ColorRotator.cs
Last active October 12, 2022 22:13
Unity3D Tip #1: Color.HSVToRGB(h, s, v) produces smoother, more natural random colors than new Color(r, g, b)
View ColorRotator.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ColorRotator : MonoBehaviour {
public GameObject objHSV, objPlainColor;
private Material objHSVMaterial, objPlainColorMaterial;
private float timeDelta;
@belzecue
belzecue / screenshot.gd
Created October 7, 2022 13:09 — forked from GK-GreyGhost/screenshot.gd
Create a folder in the format year-month-day and save the screenshot
View screenshot.gd
func screenshot():
var img = get_viewport().get_texture().get_data()
img.flip_y()
var dir:Directory = Directory.new()
var now = OS.get_date()
var folder:String = 'user://screenshots/%s-%s-%s' % [now.year,now.month,now.day]
dir.make_dir_recursive(folder)
img.save_png(folder+'/%d.png' % OS.get_unix_time())