Elektrine lite

← Feed

@bryce@mastodon.brycedixon.dev

Post #3603503

2026-05-04 16:01 UTC

Main trick that I'm using to speed up integration of a story (which I plan on making pretty complex) is embedding #GDScript function bodies into my Resources and then generating new script types from them at runtime. This greatly reduces boilerplate of copy-pasted script files which are 99% identical, though I do need to make a cleaner method of building the larger script source that goes *around* that body. #godot #godotengine #godot4 #programming #gamedev

Replies (1)

  • I realized I was being kinda silly and there's a very simple way to simplify the dynamically generated scripts: inheritance 😅 If I move all the shared behavior into a base class, it makes everything simpler, gives me syntax highlighting and auto complete, and lets me use the base class as a static type in any code referencing it. Lots of gains for a very simple change :) I also changed it to `extends RefCounted` because I was memory leaking (oops)

    Open ##3603507