ntdi Posted June 18, 2015 Share Posted June 18, 2015 Hello. I would like to create a custom range weapon. Something like the staff, but other sprites. Does anyone has a template for me, or may tell me, which files I will need? I made already meele weapons, but these staffs looking confused, alot of files called "staffgfx". Link to comment Share on other sites More sharing options...
Seiai Posted June 18, 2015 Share Posted June 18, 2015 (edited) @ntdi, u really only need staff.lua, theres an initfunction for each color of staff in there. just remove all of those but the one that is most like what u need, the other files are just for specific things that certain colored staffs can do.alternatively u could use the throwable spears mod as a base. Edited June 18, 2015 by Seiai Link to comment Share on other sites More sharing options...
ntdi Posted June 18, 2015 Author Share Posted June 18, 2015 thanks for helping again, seiai. but will i be able to do my own sprite for the missile of my weapon by jus tusing the 1 file? Link to comment Share on other sites More sharing options...
Seiai Posted June 18, 2015 Share Posted June 18, 2015 @ntdi, if u leave only the stuff that relates to for example the fire-staff, u will notice that it uses a prefab called fire_projectile. this prefab is in the file staff_projectile.lua. so u will probably need that file too. Link to comment Share on other sites More sharing options...
ntdi Posted June 19, 2015 Author Share Posted June 19, 2015 took another range weapon as example. tried everything to make it work. following problems: weapon isnt shooting projectiles (not visible), weapon doesnt deals any damage. anyone may tell me how to fix that? heres my current weapon:bowandarrow.zip Link to comment Share on other sites More sharing options...
Seiai Posted June 19, 2015 Share Posted June 19, 2015 (edited) @ntdi, this is what u set as the animation in bow_projectile.lua: inst.AnimState:SetBank("projectile") inst.AnimState:SetBuild("bow_projectile") inst.AnimState:PlayAnimation(anim, true) the build is the name of the spriterfile. u correctly named both "bow_projectile". the bank is the name of the folder inside of the spriterfile in the animationstab. in the spriterfile u named that "bow_projectile". the variable anim in PlayAnimation(anim, true) is the parameter u call your common-function with, from the fire function: local function fire() return common("bow_spin_loop", "shaders/anim.ksh") endso u are trying to play the animation "bow_spin_loop". but the animation in your spriterfile is called "idle". Edited June 19, 2015 by Seiai Link to comment Share on other sites More sharing options...
ntdi Posted June 22, 2015 Author Share Posted June 22, 2015 hello seiai. really happy that youre trying to help me out with my stuff. i renamed the animationname in the scml file into "bow_spin_loop", also i renamed the folder the spritefile into "bow_projectile". after trying to make it work ingame, my character still made the attack animation with the weapon,but dealt 0 damage and no arrows were seen. i cant upload the edited file now because im not home. may u help me out once again please? Link to comment Share on other sites More sharing options...
rons0n Posted June 22, 2015 Share Posted June 22, 2015 Did you forget to add your projectile prefab in your PrefabFiles in Modmain? I used to do that a lot. If not I have no idea Link to comment Share on other sites More sharing options...
ntdi Posted June 22, 2015 Author Share Posted June 22, 2015 wow, you are them an rons0n. i thank you so fkin much. i didnt added it to the prefabfiles, u were right. does it has to be in the prefabfiles? if yes, why is that? i thought u add names to the prefabfiles u want to be able to spawn ingame. is there anything else behind it? Link to comment Share on other sites More sharing options...
Seiai Posted June 22, 2015 Share Posted June 22, 2015 is there anything else behind it?prefabfiles by themselfes(the way we create them) are actually not doin anything in objectoriented programming. that's why we return the Prefab()-function at the bottom, to make it an actual object(there's a Class-defninition in prefabs.lua).and then we still just have an object, that has to be used by something. so we tell the game that this is a prefab, so it can be used like all other prefabs ingame. 1 Link to comment Share on other sites More sharing options...
ntdi Posted June 22, 2015 Author Share Posted June 22, 2015 but do the prefab could be the reason why my weapon wont work as i wish it to? can you find anything else in my files i did wrong? Link to comment Share on other sites More sharing options...
Seiai Posted June 22, 2015 Share Posted June 22, 2015 but do the prefab could be the reason why my weapon wont work as i wish it to?this sentence does not make any sense^^ can you find anything else in my files i did wrong?attach your new version. Link to comment Share on other sites More sharing options...
ntdi Posted June 23, 2015 Author Share Posted June 23, 2015 got everything fixed. another problem right now:I tried to create a configurable modconfig, so you can set your own recipe.If I set it and press apply, following happens: [00:00:52]: loaded modindex [00:00:52]: ModIndex: Beginning normal load sequence. [00:00:52]: WARNING loading modinfo.lua: workshop-401483511 does not specify if it is compatible with Don't Starve Together. It may not work properly. [00:00:52]: ModIndex:GetModsToLoad inserting moddir, shuriken [00:00:52]: loaded mod_config_data/modconfiguration_shuriken [00:00:52]: Loading mod: shuriken (Shuriken) Version:1.0 [00:00:52]: Mod: shuriken (Shuriken) Loading modworldgenmain.lua [00:00:52]: Mod: shuriken (Shuriken) Mod had no modworldgenmain.lua. Skipping. [00:00:52]: Mod: shuriken (Shuriken) Loading modmain.lua [00:00:52]: Warning: Calling Recipe from a mod is now deprecated. Please call AddRecipe from your modmain.lua file. [00:00:52]: Mod: shuriken (Shuriken) Error loading mod![string "../mods/shuriken/modmain.lua"]:45: attempt to index global 'shuriken' (a nil value)LUA ERROR stack traceback: ../mods/shuriken/modmain.lua(45,1) in main chunk =[C] in function 'xpcall' scripts/util.lua(560,1) in function 'RunInEnvironment' scripts/mods.lua(382,1) in function 'InitializeModMain' scripts/mods.lua(363,1) in function 'LoadMods' scripts/main.lua(248,1) in function 'ModSafeStartup' scripts/main.lua(296,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(25,1) in function 'SavePersistentString' scripts/modindex.lua(78,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(65,1) in function 'BeginStartupSequence' scripts/main.lua(295,1) in function 'callback' scripts/modindex.lua(474,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(451,1) in function 'Load' scripts/main.lua(294,1) in main chunk [00:00:52]: [string "../mods/shuriken/modmain.lua"]:45: attempt to index global 'shuriken' (a nil value)LUA ERROR stack traceback: ../mods/shuriken/modmain.lua(45,1) in main chunk =[C] in function 'xpcall' scripts/util.lua(560,1) in function 'RunInEnvironment' scripts/mods.lua(382,1) in function 'InitializeModMain' scripts/mods.lua(363,1) in function 'LoadMods' scripts/main.lua(248,1) in function 'ModSafeStartup' scripts/main.lua(296,1) =[C] in function 'SetPersistentString' scripts/mainfunctions.lua(25,1) in function 'SavePersistentString' scripts/modindex.lua(78,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(65,1) in function 'BeginStartupSequence' scripts/main.lua(295,1) in function 'callback' scripts/modindex.lua(474,1) =[C] in function 'GetPersistentString' scripts/modindex.lua(451,1) in function 'Load' scripts/main.lua(294,1) in main chunk[00:00:52]: Error error! We tried displaying an error but TheFrontEnd isn't ready yet... [00:00:52]: LOADING LUA SUCCESS[00:00:52]: PlayerDeaths loaded morgue 5261 [00:00:52]: loaded profile [00:00:52]: bloom_enabled false [00:00:52]: loaded saveindex [00:00:52]: OnFilesLoaded() [00:00:52]: OnUpdatePurchaseStateComplete [00:00:52]: Unload BE [00:00:52]: Could not unload undefined prefab 0xee4faffd (shuriken)[00:00:52]: Could not unload undefined prefab 0xee4faffd (shuriken)[00:00:52]: Unload BE done [00:00:53]: Mod: shuriken (Shuriken) Registering prefabs [00:00:53]: Mod: shuriken (Shuriken) Registering prefab file: prefabs/shuriken [00:00:53]: Mod: shuriken (Shuriken) shuriken [00:00:53]: Mod: shuriken (Shuriken) Registering prefab file: prefabs/shuriken_projectile [00:00:53]: Mod: shuriken (Shuriken) ice_projectile [00:00:53]: Mod: shuriken (Shuriken) shuriken_projectile [00:00:53]: Mod: shuriken (Shuriken) Registering default mod prefab [00:00:53]: Load FE [00:00:53]: Load FE: done [00:00:53]: platform_motd table: 0E0366D0 [00:00:53]: SimLuaProxy::QueryServer()[00:00:53]: SimLuaProxy::QueryServer()[00:00:53]: SimLuaProxy::QueryServer()[00:00:53]: Disabling shuriken (Shuriken) because it had an error. [00:00:53]: SCRIPT ERROR! Showing error screen [00:00:53]: ModIndex: Load sequence finished successfully. [00:00:53]: Reset() returning[00:00:54]: platform_motd table: 0E033638 [00:00:54]: Stale Component Reference: GUID 100025, scripts/widgets/text.lua:55[00:00:54]: Stale Component Reference: GUID 100026, scripts/widgets/text.lua:55[00:00:54]: Stale Component Reference: GUID 100037, scripts/widgets/text.lua:55[00:00:54]: Stale Component Reference: GUID 100037, scripts/widgets/text.lua:25 need help from you guys, please. heres the new v:shuriken.zip Link to comment Share on other sites More sharing options...
ntdi Posted June 25, 2015 Author Share Posted June 25, 2015 tried to compare my file with another mods that allows you to change recipes, i cant find any mistakes in the line 45, whats wrong? Link to comment Share on other sites More sharing options...
Seiai Posted June 25, 2015 Share Posted June 25, 2015 (edited) @ntdi,it has nothing to do with the modconfig, u never declared the "shuriken" variable u use in "shuriken.atlas". what u probably meant to do is "shurikenrecipe.atlas".aside from that, u should add recipes like that:AddRecipe("itemtobuild", {Ingredient("meat", 1)}, GLOBAL.RECIPETABS.TOWN, GLOBAL.TECH.NONE, nil, nil, nil, nil, "charactername","images/inventoryimages/itemtobuild.xml")GLOBAL.STRINGS.RECIPE_DESC.ITEMTOBUILD = "Item to Build." Edited June 25, 2015 by Seiai Link to comment Share on other sites More sharing options...
ntdi Posted June 28, 2015 Author Share Posted June 28, 2015 [00:04:17]: [string "scripts/components/playercontroller.lua"]:804: attempt to index field 'placer' (a nil value)LUA ERROR stack traceback:scripts/components/playercontroller.lua:804 in (method) StartBuildPlacementMode (Lua) <797-809> self = placer = 116120 - shuriken (valid:true) predictionsent = false controller_target_age = 1.#INF draggingonground = false handler = table: 41AD9F78 inst = 112606 - wilson (valid:true) remote_vector = (0.00, 0.00, 0.00) classified = 112607 - player_classified (valid:true) map = Map (2D18E9F0) directwalking = false placer_recipe = table: 14C96630 locomotor = table: 39FE3760 time_direct_walking = 1.1666667275131 ismastersim = true predictwalking = false mousetimeout = 10 dragwalking = false deploy_mode = true remote_controls = table: 3A1F8A28 recipe = table: 14C96630scripts/widgets/widgetutil.lua:67 in (global) DoRecipeClick (Lua) <22-94> owner = 112606 - wilson (valid:true) recipe = table: 14C96630 knows = true can_build = true buffered = falsescripts/widgets/craftslot.lua:48 in (method) OnControl (Lua) <41-53> self = callbacks = table: 3A57C4E8 recipe = table: 14C96630 recipepopup = Text - Shuriken inst = 112917 - (valid:true) focus = true locked = false children = table: 3A57C128 focus_flow_args = table: 3A57C908 focus_target = false atlas = images/hud.xml tile = RecipeTile owner = 112606 - wilson (valid:true) open = true canbuild = true fgimage = Image - images/hud.xml:craft_slot_locked.tex parent = CraftSlots name = Craftslot enabled = true focus_flow = table: 3A57C8E0 shown = true recipename = shuriken bgimage = Image - images/hud.xml:craft_slot.tex control = 29 down = falsescripts/widgets/widget.lua:115 in (method) OnControl (Lua) <109-119> self = enabled = true focus_target = false shown = true owner = 112606 - wilson (valid:true) slots = table: 3A55FA10 parent = Crafting focus_flow_args = table: 3A55F678 inst = 112881 - (valid:true) focus = true focus_flow = table: 3A55F650 name = CraftSlots children = table: 3A55EC00 callbacks = table: 3A55EB38 control = 29 down = false k = Craftslot v = Craftslotscripts/widgets/widget.lua:115 in (field) OnControl (Lua) <109-119> self = use_idx = true out_pos = (0.00, 0.00, 0.00) callbacks = table: 3A55D8C8 scrolldir = true downbutton = BUTTON parent = CraftTabs inst = 112879 - (valid:true) focus = true in_pos = (145.00, 0.00, 0.00) horizontal = false children = table: 3A55D800 max_slots = 10 focus_flow_args = table: 3A55E6B0 focus_target = false current_slots = 10 num_recipes = 17 valid_recipes = table: 2DCB09A8 owner = 112606 - wilson (valid:true) open = true idx = 8 upbutton = BUTTON enabled = true name = Crafting filter = function - scripts/widgets/crafttabs.lua:107 focus_flow = table: 3A55E318 craftslots = CraftSlots shown = true bg = TileBG control = 29 down = false k = CraftSlots v = CraftSlotsscripts/widgets/crafting.lua:180 in (method) OnControl (Lua) <179-191> self = use_idx = true out_pos = (0.00, 0.00, 0.00) callbacks = table: 3A55D8C8 scrolldir = true downbutton = BUTTON parent = CraftTabs inst = 112879 - (valid:true) focus = true in_pos = (145.00, 0.00, 0.00) horizontal = false children = table: 3A55D800 max_slots = 10 focus_flow_args = table: 3A55E6B0 focus_target = false current_slots = 10 num_recipes = 17 valid_recipes = table: 2DCB09A8 owner = 112606 - wilson (valid:true) open = true idx = 8 upbutton = BUTTON enabled = true name = Crafti[00:04:17]: [string "scripts/components/playercontroller.lua"]:804: attempt to index field 'placer' (a nil value)LUA ERROR stack traceback: scripts/components/playercontroller.lua:804 in (method) StartBuildPlacementMode (Lua) <797-809> scripts/widgets/widgetutil.lua:67 in (global) DoRecipeClick (Lua) <22-94> scripts/widgets/craftslot.lua:48 in (method) OnControl (Lua) <41-53> scripts/widgets/widget.lua:115 in (method) OnControl (Lua) <109-119> scripts/widgets/widget.lua:115 in (field) OnControl (Lua) <109-119> scripts/widgets/crafting.lua:180 in (method) OnControl (Lua) <179-191> scripts/widgets/widget.lua:115 in (field) OnControl (Lua) <109-119> scripts/widgets/crafttabs.lua:240 in (method) OnControl (Lua) <239-293> scripts/widgets/widget.lua:115 in (method) OnControl (Lua) <109-119> scripts/widgets/widget.lua:115 in (method) OnControl (Lua) <109-119> scripts/widgets/widget.lua:115 in (method) OnControl (Lua) <109-119> scripts/widgets/widget.lua:115 in (method) OnControl (Lua) <109-119> scripts/widgets/widget.lua:115 in (field) OnControl (Lua) <109-119> scripts/screens/playerhud.lua:404 in (method) OnControl (Lua) <403-480> scripts/frontend.lua:267 in (method) OnControl (Lua) <260-309> scripts/input.lua:163 in (method) OnControl (Lua) <160-167> scripts/input.lua:362 in () ? (Lua) <361-363> [00:04:17]: SCRIPT ERROR! Showing error screen [00:04:40]: Force aborting... got fixed everything, except this error. it is happening if I craft the item. It works to spawn it via console. Whats wrong? need help please.... Shurkanz.zip Link to comment Share on other sites More sharing options...
ntdi Posted June 30, 2015 Author Share Posted June 30, 2015 anyone?... still trying.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now