You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: create_methods.lua
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -61,4 +61,11 @@ function api_create_timer(method, seconds, arg1, arg2, arg3) end
61
61
---@paramxnumber the x position to create the lightweight at
62
62
---@paramynumber the y position to create the lightweight at
63
63
---@returnnumber returns instance id of lightweight
64
-
functionapi_create_lightweight(type, sprite_ref, frame, x, y) end
64
+
functionapi_create_lightweight(type, sprite_ref, frame, x, y) end
65
+
66
+
---
67
+
---@since 2.1.0
68
+
---@paramspeciesstring the species of butterfly to spawn
69
+
---@paramweatherstring he type of weather for this butterfly - once the game weather no-longer matches what you pass in, the butterfly will despawn. Values allowed are snow, rain or an empty string
70
+
---@paraminst_idnumber the instance to spawn the butterfly on, can be a flower, tree, generic obj, menu obj, or a wall
71
+
functionapi_create_butterfly(species, weather, inst_id) end
---@fieldidstring id to use to create an oid for this object. Your new object oid will be a your mod_id + the object id give
3
+
---@fieldnamestring the name of this object shown in tooltips
4
+
---@fieldcategorystring the category for this object, shown in expanded tooltips
5
+
---@fieldtooltipstring the tooltip message for this object, shown in expanded tooltips
6
+
---@fieldshop_keyboolean whether this is a "key" object and so cannot be sold
7
+
---@fieldshop_buynumber the amount this object can be bought for if sold by an NPC
8
+
---@fieldshop_sellnumber the amount this object can be sold for at an NPC
9
+
---@fieldlayoutlayout[] a list of layouts to set the slots for this objects menu
10
+
---@fieldinfoinfo[] a list of information to show when the menu help button is pressed
11
+
---@fieldbuttonsstring[] a list of buttons for this objects menu to have | "'Help'" | "'Target'" | "'Sort'" | "'Move'" | "'Close'"
12
+
---@fieldmachinesstring[] @[Optional] a list of object oids that this object this can be used in
13
+
---@fieldtoolsstring[] @[Optional] a list of tools that can be used on this object
14
+
---@fieldnatureboolean @[Optional] this specifies if the object can only be placed on grass
15
+
---@fieldaquaticboolean @[Optional] this specifies if the object can only be placed on shallow water
16
+
---@fielddeepboolean @[Optional] this specifies if the object can only be placed on deep water
17
+
---@fieldsingularboolean @[Optional] this specifies if the object can stack or can only be singular, like frames or bees
18
+
---@fieldinvisibleboolean @[Optional] if true, this object will not be drawn - it's bounding box will still be interactive though!
19
+
---@fieldcenterboolean @[Optional] if true, when this object's menu opens it will automatically be put in the center of the screen
20
+
---@fielditem_spritestring @[Optional] if you have an object that's overworld sprite is bigger than 16x16, you can use this to specify an alternate sprite to use as the item + slot sprite
functionapi_define_item(item_def, sprite_image) end
85
85
86
86
---
87
+
---@deprecated use api_define_menu_object2 instead
87
88
---@parammenu_defmenu_definition the menu definition table to use
88
89
---@paramsprite_imagestring relative path of the sprite you want to use for the menu object, should be a 64x16 image with 4 frames (normal, normal highlighted, undiscovered, undiscovered highlight)
89
90
---@parammenu_imagestring relative path of the sprite you want to use for the menu itself, can be any size but needs to have 4 frames (normal, highlighted, dragging, help overlay)
@@ -99,6 +100,7 @@ function api_define_menu_object(menu_def, sprite_image, menu_image, scripts, dra
99
100
functionapi_define_notification(notification_type, notification_script) end
100
101
101
102
---
103
+
---@deprecated use api_define_npc2 instead
102
104
---@paramnpc_defnpc_definition the definition obj for your NPC
103
105
---@paramstanding_spritestring relative path to the sprite you want to use for the NPC standing animation, should be a 36x18 image with 2 frames (standing, standing_bob)
104
106
---@paramstanding_h_spritestring relative path to the sprite you want to use for the NPC when standing and highlighted, should be a 36x18 image with 2 frames (standing, standing_bob)
@@ -214,4 +216,61 @@ function api_define_window(window, window_sprite) end
214
216
---@paramcolorstring a color name to use for the liquid, this can be a default one or your own that you defined with api_define_color()
215
217
---@paramtexture_spritestring the path to a single 37x34px image used as the liquid "texture". This will be drawn at 50% alpha on top of any tanks with your liquid in it, to help identify your liquid without color
216
218
---@parampreview_spritestring the path to a single 12x12px image used as the liquid preview when hovering over machines with a tank containing your liquid - this should be a solid filled in image (i.e. your color + your texture combined)
217
-
functionapi_define_liquid(name, color, texture_sprite, preview_sprite) end
219
+
functionapi_define_liquid(name, color, texture_sprite, preview_sprite) end
220
+
221
+
---
222
+
---@since 2.1.0
223
+
---@paramsbee_defsbee_definition the solitary bee definition to be used to create the new species
224
+
---@parambee_sprite_imagestring relative path of the sprite you want to use for the bee item, should be a 72x18 image with 4 frames (normal, normal highlighted, undiscovered, undiscovered highlight)
225
+
---@parambee_shiny_imagestring relative path of the sprite you want to use for the shiny variant, should be a 380x18 image with 20 frames for a shine animation
226
+
---@parambee_hd_imagestring relative path of the sprite you want to use for the "HD" bee image in the book, should be a 96x48 image with 2 frames (normal, undiscovered)
227
+
---@parambee_colorcolor a color to use for the bee, used in the book, predictor, and the discovery popup
228
+
---@parambee_letter_imagestring relative path of the sprite you want to use for the bee's letter item, should be a 32x16 image with 2 frames (normal, highlighted)
229
+
---@parambee_letter_textstring text to show in the letter for this species
230
+
---@returnstring|nil If this method worked it will return Success, otherwise if it fails it will return nil and will log an error in the Modding Console.
231
+
functionapi_define_solitary(sbee_def, bee_sprite_image, bee_shiny_image, bee_hd_image, bee_color, bee_letter_image, bee_letter_text) end
232
+
233
+
---
234
+
---@since 2.1.0
235
+
---@parambutt_defbutt_definition the solitary bee definition to be used to create the new species
236
+
---@parambutt_sprite_imagestring relative path of the sprite you want to use for the bee item, should be a 72x18 image with 4 frames (normal, normal highlighted, undiscovered, undiscovered highlight)
237
+
---@parambutt_golden_imagestring relative path of the sprite you want to use for the golden variant, should be a 72x18 image with 4 frames (normal, normal highlighted, undiscovered, undiscovered highlight)
238
+
---@parambutt_cat_imagestring relative path of the sprite you want to use for the caterpiller, should be a 18x18 image with 1 frame (normal)
239
+
---@parambutt_hd_imagestring relative path of the sprite you want to use for the "HD" butterfly image in the book, should be a 96x48 image with 2 frames (normal, undiscovered)
240
+
---@parambutt_colorcolor a color to use for the butterfly, used in the book
241
+
---@returnstring|nil If this method worked it will return Success, otherwise if it fails it will return nil and will log an error in the Modding Console.
242
+
functionapi_define_butterfly(butt_def, butt_sprite_image, butt_golden_image, butt_cat_image, butt_hd_image, butt_color) end
243
+
244
+
---
245
+
---@since 2.1.0
246
+
---@paramitem_defitem_definition an item definition for your incense using standard definition keys (this is also where "effect" is used in the item_definition)
247
+
---@paramsprite_imagestring relative path to the sprite you want to use for this item, should be a 64x16 image with 4 frames (normal, normal highlighted, undiscovered, undiscovered highlight)
248
+
---@paramalchemy_checkstring a method name defined in your mod code that will be used to check if the combination the player has in their alchemy bench will create your incense. This method will be passed the current incense oid that will be combined currently, along an alchemy_count table
249
+
---@returnstring|nil If this method worked it will return Success, otherwise if it fails it will return nil and will log an error in the Modding Console.
250
+
functionapi_define_incense(item_def, sprite_image, alchemy_check) end
251
+
252
+
---
253
+
---@since 2.1.0
254
+
---@paramnpc_defnpc_definition2 the definition obj for your NPC
255
+
---@paramstanding_spritestring relative path to the sprite you want to use for the NPC standing animation, should be a 36x18 image with 2 frames (standing, standing_bob)
256
+
---@paramstanding_h_spritestring relative path to the sprite you want to use for the NPC when standing and highlighted, should be a 36x18 image with 2 frames (standing, standing_bob)
257
+
---@paramwalking_spritestring relative path to the sprite you want to use for the NPC walk animation, should be a 72x18 image with 4 frames (stand, step_1, stand, step_2)
258
+
---@paramwalking_h_spritestring relative path to the sprite you want to use for the NPC when walking and highlighted, should be a 72x18 image with 4 frames (stand, step_1, stand, step_2)
259
+
---@paramhead_spritestring relative path to the sprite you want to use for this NPCs map icon, should be a 18x14 image with 1 frame
260
+
---@parambust_scriptstring relative path to the sprite you want to use for this item, should be a 64x36 image with 2 frames (normal, bought "happy" face)
261
+
---@paramitem_spritestring relative path to the sprite you want to use for this NPCs item (that you get when you hammer an NPC), should be a 32x16 image with 2 frames (normal, normal highlighted)
262
+
---@paramdialogue_bg_spritestring relative path to the sprite you want to use for this NPCs dialogue menu, should be a 48x38 image with 1 frame
263
+
---@paramshop_bg_imagestring relative path of the sprite you want to use for the NPCs shop menu bust background, should be a 39x39 image with 1 frame
264
+
---@paramdialogue_checkstring the name of a script in your mod code that will be called to decide which dialogue options to show
265
+
---@returnstring|nil If this method worked it will return Success, otherwise if it fails it will return nil and will log an error in the Modding Console.
---@parammenu_defmenu_definition2 the menu definition table to use
271
+
---@paramsprite_imagestring relative path of the sprite you want to use for the menu object, should be a 64x16 image with 4 frames (normal, normal highlighted, undiscovered, undiscovered highlight)
272
+
---@parammenu_imagestring relative path of the sprite you want to use for the menu itself, can be any size but needs to have 2 frames (normal, help overlay)
273
+
---@paramscriptsscripts a scripts definition for all the scripts you want your menu object to run
274
+
---@paramdraw_scriptstring? @[Optional] if specified this allows you to override the default object draw (overworld object) with your own draw script - this must be a method in your mod, and won't be called if you set the obj_definition "invisible" property to true
275
+
---@returnstring|nil If this method worked it will return Success, otherwise if it fails it will return nil and will log an error in the Modding Console.
276
+
functionapi_define_menu_object2(menu_def, sprite_image, menu_image, scripts, draw_script) end
0 commit comments