KXWl1 Posted December 24, 2021 Share Posted December 24, 2021 Well, I'm going to make Clean Sweeper of my Mod able to return the items with skin to the state without skin, that is, when dsskin_dress.num[target] = 1, but in this way, as long as it is picked up, it will crash and show that the inventory image cannot be found. Is there any method or code to fix this? Here is the example crash: reskin_tool Code: target = target or staff.components.inventoryitem.owner if target.components.dsskins ~= nil and target.components.dsskins.skins ~= nil then if not staff.components.dsskin_dress.num[target] then staff.components.dsskin_dress.num[target] = 2 else staff.components.dsskin_dress.num[target] = staff.components.dsskin_dress.num[target]+1 end if staff.components.dsskin_dress.num[target] > #target.components.dsskins.skins then staff.components.dsskin_dress.num[target] = 1 end local num = staff.components.dsskin_dress.num[target] target.components.dsskins.skin = target.components.dsskins.skins[num].skin if target.components.dsskins.skins[num].fx ~= nil then target.components.dsskins.fx = target.components.dsskins.skins[num].fx end if target.components.dsskins.skins[num].build ~= nil then target.components.dsskins.build = target.components.dsskins.skins[num].build end target.components.dsskins:Changeskin() local fx = SpawnPrefab("reskin_tool_fx") local fx_info = reskin_fx_info[target.prefab] or {} local scale_override = fx_info.scale or 1 fx.Transform:SetScale(scale_override, scale_override, scale_override) local fx_pos_x, fx_pos_y, fx_pos_z = target.Transform:GetWorldPosition() fx_pos_y = fx_pos_y + (fx_info.offset or 0) fx.Transform:SetPosition(fx_pos_x, fx_pos_y, fx_pos_z) if IsDLCEnabled(PORKLAND_DLC) then staff.SoundEmitter:PlaySound("dontstarve_DLC003/common/crafted/vortex_armour/equip_on") staff.SoundEmitter:PlaySound("dontstarve_DLC003/common/crafted/vortex_armour/equip_off") else staff.SoundEmitter:PlaySound("dontstarve/wilson/attack_weapon") end return true end dsskins_dress code: function Dsskin_dress:Dress(target) if target.components.dsskins ~= nil and target.components.dsskins.skins ~= nil then if not self.num[target] then self.num[target] = 2 else self.num[target] = self.num[target] +1 end if self.num[target] > #target.components.dsskins.skins then self.num[target] = 2 end local num = self.num[target] target.components.dsskins.skin = target.components.dsskins.skins[num].skin if target.components.dsskins.skins[num].fx ~= nil then target.components.dsskins.fx = target.components.dsskins.skins[num].fx end if target.components.dsskins.skins[num].build ~= nil then target.components.dsskins.build = target.components.dsskins.skins[num].build end target.components.dsskins:Changeskin() local pt = Vector3(target.Transform:GetWorldPosition()) SpawnPrefab("collapse_small").Transform:SetPosition(pt:Get()) return true elseif TUNING.DSSKINS ~= nil and TUNING.DSSKINS.base["wendy"] ~= nil then local num = math.random(2,#TUNING.DSSKINS.base["wendy"]) target.AnimState:SetBuild(TUNING.DSSKINS.base["wendy"][num].name) return true end return false end Link to comment https://forums.kleientertainment.com/forums/topic/136468-about-my-clean-sweeper-mod/ Share on other sites More sharing options...
Leonidas IV Posted December 24, 2021 Share Posted December 24, 2021 (edited) Well, I would say for you you want the paths that this function is looking for the texture. It should be working... 11 hours ago, KXWl1 said: local pt = Vector3(target.Transform:GetWorldPosition()) GLOBAL.Vector3 11 hours ago, KXWl1 said: elseif TUNING.DSSKINS ~= nil and TUNING.DSSKINS.base["wendy"] ~= nil then GLOBAL.TUNING This probably won't solve the problem, but I think they're missing. If you haven't already defined it before... 11 hours ago, KXWl1 said: SpawnPrefab("collapse_small").Transform:SetPosition(pt:Get()) Maybe here too Edited December 24, 2021 by leonidas_iv 1 Link to comment https://forums.kleientertainment.com/forums/topic/136468-about-my-clean-sweeper-mod/#findComment-1527902 Share on other sites More sharing options...
KXWl1 Posted December 25, 2021 Author Share Posted December 25, 2021 11 hours ago, Leonidas IV said: Well, I would say for you you want the paths that this function is looking for the texture. It should be working... GLOBAL.Vector3 GLOBAL.TUNING This probably won't solve the problem, but I think they're missing. If you haven't already defined it before... Maybe here too Thank you for your reply! But it doesn't seem so simple...... I used your method, either ineffective or causing another form of crash. I don't know why its path was moved to the wrong place (inventroyimages/xxx.xml), it should have been found in the original file. 1 Link to comment https://forums.kleientertainment.com/forums/topic/136468-about-my-clean-sweeper-mod/#findComment-1528066 Share on other sites More sharing options...
KXWl1 Posted December 26, 2021 Author Share Posted December 26, 2021 On 12/25/2021 at 1:12 AM, Leonidas IV said: Well, I would say for you you want the paths that this function is looking for the texture. It should be working... GLOBAL.Vector3 GLOBAL.TUNING This probably won't solve the problem, but I think they're missing. If you haven't already defined it before... Maybe here too Maybe I have to use the most troublesome method to carry all the tex and XML of the items with skin. But the result is that the image is missing, but at least it won't crash. Link to comment https://forums.kleientertainment.com/forums/topic/136468-about-my-clean-sweeper-mod/#findComment-1528270 Share on other sites More sharing options...
Leonidas IV Posted December 28, 2021 Share Posted December 28, 2021 (edited) On 12/26/2021 at 2:26 AM, KXWl1 said: Maybe I have to use the most troublesome method to carry all the tex and XML of the items with skin. But the result is that the image is missing, but at least it won't crash. I don't know how you're doing, but wouldn't it be simpler to change the code of magic box already in the mod? Edited December 28, 2021 by Leonidas IV 1 Link to comment https://forums.kleientertainment.com/forums/topic/136468-about-my-clean-sweeper-mod/#findComment-1528891 Share on other sites More sharing options...
KXWl1 Posted December 29, 2021 Author Share Posted December 29, 2021 13 hours ago, Leonidas IV said: I don't know how you're doing, but wouldn't it be simpler to change the code of magic box already in the mod? Personally, I don't like magic boxes very much, First, its image is too blurred (I don't know why, all the skin images are very clear and good, but this...) second, it has no special sound and fx. On the contrary, the image of DST Clean Sweeper is very clear and interesting to use. After all, I'm aesthetic tired. By the way, if I know more about the code in the future, I may carry the Clean Sweeper skin from DST (brush...) into my mod. Anyway, thank you for your reply and keeping this forum alive! 1 Link to comment https://forums.kleientertainment.com/forums/topic/136468-about-my-clean-sweeper-mod/#findComment-1529086 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