noobyt4 Posted May 15, 2019 Share Posted May 15, 2019 I wanna make a boomerang like item im using the wand.zip to make it if anyone can help me thanks! wand.zip Link to comment Share on other sites More sharing options...
Ultroman Posted May 15, 2019 Share Posted May 15, 2019 Why don't you study the Boomerang prefab? If you want the exact same behavior, that would be the way to go. Otherwise, you'd have to describe what you want in order for us to help you. Link to comment Share on other sites More sharing options...
noobyt4 Posted May 15, 2019 Author Share Posted May 15, 2019 I did put the boomerang code in the scripts .wand but all that did was make my inventor invisible i should note i deleted all the code in the wand.lua replaced it with the boomerang code and renamed everything to wand and WAND etc Link to comment Share on other sites More sharing options...
Eusong Posted May 16, 2019 Share Posted May 16, 2019 I'm not sure what you mean by "make my inventor invisible" If it's invisible in your inventory, then there's an issue with the inventory image part. If it's invisible when you throw it, then there's an issue with the animations. If it makes your entire inventory disappear, then you've certainly done something very wrong. Link to comment Share on other sites More sharing options...
noobyt4 Posted May 16, 2019 Author Share Posted May 16, 2019 Yes it makes my inventory disapear along with my health and everything Link to comment Share on other sites More sharing options...
Ultroman Posted May 17, 2019 Share Posted May 17, 2019 There must be a crash or error of something in your logs. Otherwise, you've found the cleanest way to completely disable the HUD, in which case, congratulations! Link to comment Share on other sites More sharing options...
noobyt4 Posted May 17, 2019 Author Share Posted May 17, 2019 Alright here wand.lua try and fix or see whats wrong i guess Link to comment Share on other sites More sharing options...
Ultroman Posted May 17, 2019 Share Posted May 17, 2019 Give me a zip with your whole mod. Link to comment Share on other sites More sharing options...
noobyt3 Posted May 17, 2019 Share Posted May 17, 2019 there i think i dont know modinfo.lua modmain.lua wand.lua oh here clacker.zip Link to comment Share on other sites More sharing options...
Ultroman Posted May 17, 2019 Share Posted May 17, 2019 Yeah, the HUD does disappear, but the whole game also crashes. Looking at the log, we can see this is the error: Spoiler [00:10:00]: ...starve/data/../mods/clacker/scripts/prefabs/wand.lua:91: attempt to perform arithmetic on field 'WAND_DISTANCE' (a nil value) LUA ERROR stack traceback: E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/../mods/clacker/scripts/prefabs/wand.lua:91 in (field) fn (Lua) <74-118> Sim = Sim (1B5055D0) inst = 134622 - (valid:true) trans = Transform (8F73CCB8) anim = AnimState (8F73CD18) E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/mainfunctions.lua:137 in () ? (Lua) <126-161> name = wand prefab = Prefab wand - =[C]:-1 in (method) SpawnPrefab (C) <-1--1> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/mainfunctions.lua:178 in (global) SpawnPrefab (Lua) <172-210> name = wand E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/util.lua:51 in (global) DebugSpawn (Lua) <48-58> prefab = wand E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/consolecommands.lua:20 in (global) c_spawn (Lua) <16-26> prefab = wand count = 1 inst = nil i = 1 c_spawn("wand"):1 in () ? (main) <0-0> =[C]:-1 in (global) pcall (C) <-1--1> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua:45 in (global) ExecuteConsoleCommand (Lua) <39-50> fnstr = c_spawn("wand") E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua:319 in (method) Run (Lua) <314-320> self = edit_bg = Image - images/ui.xml:textbox_long_over.tex suggest_replace = shown = true autocompleteObjName = autocompleteOffset = -1 inst = 134602 - (valid:true) focus = true handlers = table: 12C0AA20 children = table: 12C0A408 enabled = true focus_target = false root = suggest_text = table: 12C0D450 parent = screenroot name = ConsoleScreen suggesting = false focus_flow = table: 12C0A890 focus_flow_args = table: 12C0A8B8 console_edit = Text - callbacks = table: 12C0A688 fnstr = c_spawn("wand") E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua:409 in (method) OnTextEntered (Lua) <408-415> self = edit_bg = Image - images/ui.xml:textbox_long_over.tex suggest_replace = shown = true autocompleteObjName = autocompleteOffset = -1 inst = 134602 - (valid:true) focus = true handlers = table: 12C0AA20 children = table: 12C0A408 enabled = true focus_target = false root = suggest_text = table: 12C0D450 parent = screenroot name = ConsoleScreen suggesting = false focus_flow = table: 12C0A890 focus_flow_args = table: 12C0A8B8 console_edit = Text - callbacks = table: 12C0A688 E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua:471 in (field) OnTextEntered (Lua) <471-471> [00:10:00]: Last called Lua: SpawnPrefabFromSim [00:10:00]: scripts/mainfunctions.lua(946,1) LUA ERROR stack traceback: E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(946,1) =[C] in function 'SpawnPrefab' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(178,1) in function 'SpawnPrefab' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/util.lua(51,1) in function 'DebugSpawn' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/consolecommands.lua(20,1) in function 'c_spawn' c_spawn("wand")(1,1) in main chunk =[C] in function 'pcall' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua(45,1) in function 'ExecuteConsoleCommand' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua(319,1) in function 'Run' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua(409,1) in function 'OnTextEntered' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua(471,1) in function 'OnTextEntered' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/widgets/textedit.lua(59,1) in function 'OnProcess' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/widgets/textedit.lua(70,1) in function 'OnRawKey' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/widgets/widget.lua(94,1) in function 'OnRawKey' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/widgets/widget.lua(94,1) in function 'OnRawKey' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/widgets/widget.lua(94,1) in function 'OnRawKey' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua(121,1) in function 'OnRawKey' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/frontend.lua(755,1) in function 'OnRawKey' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/frontend.lua(122,1) in function 'fn' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/events.lua(46,1) in function 'HandleEvent' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/input.lua(186,1) in function 'OnRawKey' E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/input.lua(403,1) [00:10:00]: scripts/mainfunctions.lua(947,1) ...starve/data/../mods/clacker/scripts/prefabs/wand.lua:91: attempt to perform arithmetic on field 'WAND_DISTANCE' (a nil value) LUA ERROR stack traceback: E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/../mods/clacker/scripts/prefabs/wand.lua:91 in (field) fn (Lua) <74-118> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/mainfunctions.lua:137 in () ? (Lua) <126-161> =[C]:-1 in (method) SpawnPrefab (C) <-1--1> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/mainfunctions.lua:178 in (global) SpawnPrefab (Lua) <172-210> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/util.lua:51 in (global) DebugSpawn (Lua) <48-58> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/consolecommands.lua:20 in (global) c_spawn (Lua) <16-26> c_spawn("wand"):1 in () ? (main) <0-0> =[C]:-1 in (global) pcall (C) <-1--1> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua:45 in (global) ExecuteConsoleCommand (Lua) <39-50> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua:319 in (method) Run (Lua) <314-320> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua:409 in (method) OnTextEntered (Lua) <408-415> E:/Gamez/SteamLibrary/steamapps/common/dont_starve/data/scripts/screens/consolescreen.lua:471 in (field) OnTextEntered (Lua) <471-471> The first line says that on line 91 in wand.lua, you are using a variable called WAND_DISTANCE, which is apparently nil, in a calculation. See my newcomer post for more great information about how to debug your mods. Also, your modinfo.lua says that the mod is DST compatible, which it is not. Link to comment Share on other sites More sharing options...
noobyt4 Posted May 17, 2019 Author Share Posted May 17, 2019 Removed the dst compatible plus could you just tell me what code i need to put im not the best at following tutorials if you can't then il just follow the guide Link to comment Share on other sites More sharing options...
Ultroman Posted May 18, 2019 Share Posted May 18, 2019 3 hours ago, noobyt4 said: Removed the dst compatible Great 3 hours ago, noobyt4 said: could you just tell me what code i need to put im not the best at following tutorials if you can't then il just follow the guide You need to know LUA if you're going to make a mod. Making a projectile weapon isn't simple, let alone one that can return to the caster. Your current error says that you're using an undeclared variable. If your don't know what to do about that, then we're going to spend way too much time going back and forth, or I'm going to end up writing the whole mod (which I do not have time for, but others might). I'm sure you can do it if you put in some more time. You might find it more fun than you think Link to comment Share on other sites More sharing options...
noobyt4 Posted May 18, 2019 Author Share Posted May 18, 2019 Fixed it the only problem i have is the images dont appear do you want the script or whole file? Link to comment Share on other sites More sharing options...
noobyt4 Posted May 18, 2019 Author Share Posted May 18, 2019 Also turns out the problem was lines 90,95,964 didn't have a number so i guess that was "simple" Link to comment Share on other sites More sharing options...
noobyt3 Posted May 18, 2019 Share Posted May 18, 2019 14 minutes ago, noobyt4 said: Also turns out the problem was lines 90,95,964 didn't have a number so i guess that was "simple" What i was talking about inst.components.weapon:SetDamage(30) inst.components.finiteuses:SetMaxUses(50) inst.components.finiteuses:SetUses(50) Link to comment Share on other sites More sharing options...
Ultroman Posted May 19, 2019 Share Posted May 19, 2019 7 hours ago, noobyt4 said: the only problem i have is the images dont appear do you want the script or whole file? Whole mod in a zip. Which images do not appear? There are many different images for an item mod. Is the inventory image missing? Or is it the image on the ground? Also, it seems you don't have any modicon files, or you haven't changed the filenames in your modinfo.lua Link to comment Share on other sites More sharing options...
noobyt3 Posted May 19, 2019 Share Posted May 19, 2019 1 hour ago, Ultroman said: Whole mod in a zip. Which images do not appear? Every image doesn't appear so yeah also here wand.zip Link to comment Share on other sites More sharing options...
Ultroman Posted May 19, 2019 Share Posted May 19, 2019 Well, first of all, your inventory image folder is not names correctly: wand\images\inventoryimages_2 It should just be inventoryimages. You never add the inventory image or atlas to your inventoryitem component. You also do not properly include them in the "assets" list at the top of the prefab file. Please see this example mod Cactus Armor - DST.zip. It's for DST, so don't mind the extra stuff. Just look at the "assets" list and line 55 in the armor_cactus.lua. Are you also going to add a recipe for this wand? If so, I can shared the code for that, as well. Link to comment Share on other sites More sharing options...
noobyt3 Posted May 19, 2019 Share Posted May 19, 2019 1 hour ago, Ultroman said: Are you also going to add a recipe for this wand? If so, I can shared the code for that, as well. Yes i am if you could share the code please do 1 hour ago, Ultroman said: Well, first of all, your inventory image folder is not names correctly: wand\images\inventoryimages_2 i did update the file but i guess you got the old file either way il try and fix it il update you Link to comment Share on other sites More sharing options...
Ultroman Posted May 19, 2019 Share Posted May 19, 2019 Waiting for the updated file, then. Recipe code: -- Recipe has the following parameters: -- Recipe(name, ingredients, tab, level, game_type, placer, min_spacing, nounlock, numtogive, aquatic, distance, decor, flipable, image, wallitem, alt_ingredients) -- If your image is named the same as the prefab, then you do not need to set the image manually. -- We only set the first 4 parameters, and then ignore the rest completely. local armor_cactus = Recipe("armor_cactus", { Ingredient("armorwood", 1), Ingredient("cactus_meat", 12)}, RECIPETABS.WAR, {SCIENCE = 1}) -- If your image is not named the same as the prefab, then you need to specify the image. -- We only set the first 4 parameters and the image parameter, and then ignore the last 2 completely. local armor_cactus = Recipe("armor_cactus", { Ingredient("armorwood", 1), Ingredient("cactus_meat", 12)}, RECIPETABS.WAR, {SCIENCE = 1}, nil, nil, nil, nil, nil, nil, nil, nil, nil, "armor_cactus") -- If your atlas is also named differently, then you have to set the atlas after calling Recipe, like this: armor_cactus.atlas = "images/inventoryimages/armor_cactus.xml" Link to comment Share on other sites More sharing options...
noobyt3 Posted May 19, 2019 Share Posted May 19, 2019 New file also NONE of the images appear the only image that does appear is the crafting one wand.zip Link to comment Share on other sites More sharing options...
Ultroman Posted May 19, 2019 Share Posted May 19, 2019 I see the folder name was changed, but you don't seem to have done this part: Quote You never add the inventory image or atlas to your inventoryitem component. You also do not properly include them in the "assets" list at the top of the prefab file. Please see this example mod Cactus Armor - DST.zip. It's for DST, so don't mind the extra stuff. Just look at the "assets" list and line 55 in the armor_cactus.lua Link to comment Share on other sites More sharing options...
noobyt3 Posted May 19, 2019 Share Posted May 19, 2019 about the image or atlas part ahem how do i do it (sorry if this sounds dumb im not the best at understanding) Link to comment Share on other sites More sharing options...
Ultroman Posted May 19, 2019 Share Posted May 19, 2019 It's really simple. Download my zip file and look at armor_cactus.lua in the "scripts\prefabs" folder. Look at the "assets" list at the top of the file and look at line 55. You have the "anim" parts of your "assets" list, but the INV_IMAGE part is wrong. See how it should look like in my file. Keep in mind what the folder structure is, understand that all you're supposed to do is provide file paths for the game to the files you have, and then look at the parts I mentioned. It should pop out at you. Line 55 is almost the same thing. Just copy the lines from my mod, and make sure to change the path to have your file names in them. I'll do it for you if you really can't get it to work, but I think you're dumbing yourself down a little or don't feel too confident in doing this. That'll never get better if you don't work at it If that's too forward, I do apologize. I just like to push people just a little bit. Link to comment Share on other sites More sharing options...
noobyt3 Posted May 19, 2019 Share Posted May 19, 2019 i can't get it to work so could you please do it im not the best at doing this if you need the new file here wand.zip forgot to mention this but would that fix the hand and throwing to appear? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.