Gonnasmoke: The Smoking Mod


Gonnasmoke is a cosmetic mod for Nuclear Throne that makes your player character smoke. Rebel's Allies and enemy Bandits can also smoke, and it's possible to add support for more enemies by editing the script file.

Contents:

Download


Watch the trailer


Customizing the mod


Editing the script file is relatively straightforward if all you want is some minor changes. If you'd like to alter stuff like animation or drawing code, good luck, you'll need it.

Under #define init you'll find two global variables that control some special behavior:

Under #define cigarette_create you'll find all the parameters used to create a cigarette. You can alter a few to your taste:

Creating sprite offsets


By sprite offsets, I mean where the cigarette will be put, on each frame of a character's sprite. This can apply to the player, to enemies, or even allies and props. Ideally you should put the cigarette on the character's mouth, but if you wanna do something stupid like making them smoke out of the ass, you can do it by editing the offsets and some of the mod's code I guess.

The following code, which is included with the mod, shows how to define offsets for a Bandit's sprites:

// "sprBanditIdle" is the name of the sprite to match. ds_map_add(global.offsets, "sprBanditIdle", [ { x: 3, y: 3 }, // x and y cigarette offsets for frame 0, from the origin of the sprite { x: 3, y: 3 }, // Ditto, for frame 1 { x: 3, y: 4 }, // Frame 2 { x: 3, y: 4 } // Frame 3 ]); ds_map_add(global.offsets, "sprBanditWalk", [ { x: 4, y: 3 }, { x: 5, y: 1 }, { x: 4, y: 4 }, { x: 5, y: 3 }, { x: 5, y: 1 }, { x: 4, y: 4 } ]); ds_map_add(global.offsets, "sprBanditHurt", [ { x: 3, y: 2 }, { x: 3, y: 2 }, { x: 3, y: 2 } ]);

To add Gonnasmoke support to a custom skin, you have to define a gonnasmoke_offsets function somewhere in the skin's script file. The following is an example for my Rocket Cop skin for Fish:

#define gonnasmoke_offsets var offsets = ds_map_create(); // Define a DS Map that'll contain the offsets. ds_map_add(offsets, "idle", [ // "idle" is the name of the skin's idle sprite. No fancy text here, just "idle". { x: 3, y: 3 }, Frame 0 of idle sprite { x: 3, y: 3 }, Frame 1 { x: 3, y: 4 }, Frame 2 { x: 3, y: 4 } Frame 3 ]); ds_map_add(offsets, "walk", [ // Walking sprite { x: 4, y: 3 }, { x: 4, y: 2 }, { x: 4, y: 4 }, { x: 5, y: 3 }, { x: 5, y: 2 }, { x: 5, y: 4 } ]); ds_map_add(offsets, "hurt", [ // Hurt sprite { x: 3, y: 3 }, { x: 3, y: 3 }, { x: 3, y: 3 } ]); ds_map_add(offsets, "gosit", [ // Thronesitting animation { x: 1, y: 3 }, { x: 1, y: 3 }, { x: 1, y: 3 } ]); ds_map_add(offsets, "sit", [ // Thronesitting loop { x: 1, y: 3 } ]); return offsets; // Once all offsets are added, return the DS Map so Gonnasmoke can read it and add it to its own sprite map.

In case you forget to add an offset for all frames, the mod will default to using the offsets for frame 0 of the sprite. If you don't define the sprite at all, no cigarette will be shown.

Known issues


To report a bug, you can either ping legitleemon on the official NT Discord, or post a comment on the Itch.io page for the mod.