Skip to content

Instantly share code, notes, and snippets.

View Jummit's full-sized avatar
🌒
seconds to midnight

Jummit Jummit

🌒
seconds to midnight
View GitHub Profile
@Jummit
Jummit / godot_save_options.md
Last active January 29, 2024 08:52
A list of ways to create save games in the Godot Engine
@Jummit
Jummit / addon_guideline.md
Last active April 27, 2023 12:01
Jummit's Godot Addon Guideline

Jummit's Godot Addon Guideline

This document outlines a vision for my addons. It's meant to make addons that are easy to use, maintain and extend.

Readme

Addons should have a readme file containing:

  • a short description
  • a screenshot
@Jummit
Jummit / project_structure.md
Last active March 28, 2023 20:25
Godot Project Structure Guideline
@Jummit
Jummit / new_fabric_mod.py
Last active May 13, 2022 21:13
Sets up a new Fabric project by cloning and modifing the example mod
#!/bin/env python3
import os
import subprocess
def replace_in_file(path, replacements):
with open(path, "r") as original:
content = original.read()
for to_replace in replacements:
content = content.replace(to_replace, replacements[to_replace])
with open(path, "w") as modified:
@Jummit
Jummit / new-minecraft-mod.py
Last active April 24, 2022 06:53
Generate new Fabric/Forge/Quilt/Architectury mod
#!/usr/bin/env python
"""
Script to help create new modding projects.
Execute this inside the template folder and
fill in the form.
"""
import os
@Jummit
Jummit / local_networking.gd
Last active February 13, 2021 16:59
server and client on the same machine using custom_multiplayer
extends Node
# this script is attached to the main scene
var server_api := MultiplayerAPI.new()
var client_api := MultiplayerAPI.new()
# The actual main scene of the game. It is instanced in the script.
export var game_scene : PackedScene
@Jummit
Jummit / mesh_join_duplicates.gd
Created November 3, 2020 07:48
Join duplicate vertices of a mesh in Godot
static func _join_duplicates(mesh : Mesh) -> Dictionary:
var data_tool := MeshDataTool.new()
if not data_tool.create_from_surface(_deindex(mesh), 0) == OK:
return {}
var old_vertex_ids := {}
var ordered_vertices := []
for vertex_id in data_tool.get_vertex_count():
var vertex := data_tool.get_vertex(vertex_id)
old_vertex_ids[vertex] = vertex_id
@Jummit
Jummit / server_list.gd
Created September 12, 2020 14:29
Using custom multiplayer to connect to a dedicated server and register a hosted server
extends Node
# registered as an autload on both
# the dedicated server and on the player
var MY_IP
var MY_PORT
var is_player
const DEDICATED_SERVER_PORT = 1234