Skip to Content
API referenceStatus: built, partial, planned

API status

Everything a mod can change today, area by area, and what’s still on the way. API version 3.

built works in the port nowpartial player-only, or only through a general routeplanned designed, not built yet

Ways to mod

JFG-Studio writes the data files and the Lua for you; you only touch them by hand for what Studio doesn’t cover yet.

Weapons

Details: Weapons.

CapabilityHowStatus
Damagejfg.weapon(n, {damage=}), 0–255, any of the 15 stock weapons by slotbuilt
Fire ratedelay: frames between shots (0–255)built
Projectile and throw speedspeed (0.1–2000)built
Projectile lifetime (range)lifetime (1–255)built
Spread (accuracy)spread_x, spread_y (0–8192; 65536 is a full turn)built
Throw timingthrow_delay: frames from press to release (1–127)built
Read a weapon’s valuesjfg.weapon_stats(n)built
Weapon values without codeStudio’s Weapons window (weapons.json)built
Laser bolt size, plasma charge speed, mine limit, pistol rapid-fire heatOnly in the player’s F9 Weapons tabpartial
Gun and projectile models and texturesReplace their model or texture entries; changes them everywhere, not per weaponpartial
New weapons in extra slotsjfg_weapon_register: virtual slots 16 and up that borrow a stock weapon’s firing, reticle and HUDplanned
Gun model per hero, HUD iconNeeds the gun-model choice and the HUD strip draw named in the decompplanned
Give, take and ammojfg_weapon_give / has / get_ammo / set_ammo / currentplanned
Weapon eventsjfg_on_weapon_fire, jfg_on_weapon_select, jfg_on_projectile_hitplanned

Levels and game data

CapabilityHowStatus
Replace game dataA whole asset, or one entry of a set: level header, track, model, texture, object listbuilt
Add levels, tracks, models, textures, object definitions"append": numbered at start-up, kept in bin/mod_ids.json so saves stay validbuilt
Link entries by name"fixups" write the real numbers once known, even another mod’sbuilt
Edit a stock level without replacing it"patches": byte edits, and object-list set, delete and append; several mods can patch one levelbuilt
Build from the player’s own data"copyOf" plus byte edits, so a pack carries no game databuilt
Level look: fog, sky, clear colour, music, ambient loopsThe level header (Studio’s Level window); jfg.fog() at run timebuilt
Doors and game flagsjfg.unlock_door, jfg.door_locked, jfg.flag, jfg.set_flagbuilt
Warp to a leveljfg.warp(level, start_point)built
Water, lava, pits, invisible wallsSurfaces from Blender material names; Studio’s Water toolbuilt
Moving platforms, jetpack pads, Galaxian flight pathsWait on the decomp naming their dataplanned

Enemies and objects

CapabilityHowStatus
Place any stock objectObject lists (appended or patched)built
New enemy types (reskins)Studio kinds: a stock enemy with new textures and size, its own object idbuilt
Borrow animations for a new model"animRows"built
Squad sizeThe squadron’s Size field, shared by its membersbuilt
Spawn at run timejfg.spawn(id, x, y, z, {params}), 64 per levelbuilt
Hide or change how an object drawsC event jfg_on_object_drawbuilt
New models (meshes)Appended model entries work; Studio has no model importer yetpartial
Objects with their own behaviourLua object kinds and handles; bosses and talkers as kindsplanned

Planets and galaxies

CapabilityHowStatus
New planets on the mapjfg_world.json: on the game’s galaxy or the pack’s own (L and R switch)built
RoutesFrom a stock map point or another planet; clashes between mods move to a free directionbuilt
Unlock rulesstart, stock, script, entered, completed, discovered; kept per save filebuilt
Open and complete from codeLua jfg.unlock_planet and friends; C jfg_world_*, jfg_galaxy_*built
Map eventsjfg_on_map_open, jfg_on_galaxy_change, jfg_on_planet_selectbuilt
Planet regionsjfg_assets.json "regions": the stats screen on leaving a planet, its area title, continuesbuilt
Fly your ship between planetsA design scenario; not scheduledplanned

Scripts, input and screen

CapabilityHowStatus
Run code each level and tickjfg.on("level", fn), jfg.on("tick", fn)built
Triggers without codeStudio’s Triggers windowbuilt
Player position, buttonsjfg.player(), jfg.pressed(name), jfg.held(name)built
On-screen messages and talkersjfg.message; Studio’s talk trigger and lines actionbuilt
Loggingjfg.log, print; C recomp_printfbuilt
Hot reload of scriptsReload Lua without restartingplanned
Pause screenHooks for the pause menu; waiting on the decompplanned

Music, sound and effects

CapabilityHowStatus
Custom level musicjfg_music.json: OGG per level with loop pointsbuilt
Switch music from a scriptjfg.music(name), jfg.music_stop()built
Replace or mute a sound effectjfg_on_sound_playbuilt
New sound effectsOnly the game’s own sounds can be playedplanned
Blood and gorejfg_on_blood_spurt, jfg_on_blood_hit, jfg_on_severed_limb_tickbuilt
Screen hit flashjfg_on_screen_flashbuilt

Game loop and players (C)

CapabilityHowStatus
Every tick, frame-rate safejfg_on_game_tick(frames), jfg_get_tick_scale()built
Level changesjfg_on_level_change, jfg_get_levelbuilt
Boss fights and Floydjfg_on_boss_fight_control, jfg_on_sidekick_tickbuilt
Change any game functionRECOMP_HOOK, RECOMP_PATCH (a few overlay functions can’t be hooked)built
Share code between modsLibrary mods: exports, events, dependenciesbuilt
Draw from a modDisplay lists, vertices and textures in the mod’s own memorybuilt
Co-op in the storyA design scenario; not scheduledplanned

Textures and language

CapabilityHowStatus
HD texture packsRT64 packs as mods or folders; Options or F6built
Texture dumping for upscalersGame textures in texture_dump/, each mod’s own in texture_dump/<mod id>/built
New textures in a packAppended or replaced texture entriesbuilt
Studio reusing stock texturesAn image identical to a game texture could use the game’s own; the importer can, Studio leaves it offpartial
TranslationsLocale files: menus, subtitles, hints; jfg_get_language, jfg_on_language_changebuilt
Last updated on