Gryffo Posted September 7, 2015 Share Posted September 7, 2015 (edited) Hey, so I got a simple mod for wigfrid working (thanks to help from DarkXero) that shows her amount of 'battleborn' to the user through a beaver badge. It's working great so far. Now I want to swap the placeholder beaver badge for a custom one. I would like to do this by editing a copy of the beaver badge. Thus I've created battlebornbadge.lua in a widgets folder inside my mods', and called it in modmain.--local BattlebornBadge = _G.require "widgets/beaverbadge"local BattlebornBadge = _G.require "widgets/battlebornbadge"status.battleborn = status:AddChild( BattlebornBadge( status.owner ) ) But it doesn't show up! Everything seems to be working fine, I just can't see the badge. The contents of battlebornbadge.lua are a pretty barebones version of beaverbadge, but the constructor calls Badge._ctor(self, "battle_meter", owner) instead of beaver_meter. It appears to me I must have messed up something on the battle_meter.zip itself. What might I have missed? I've seen similar problems, but few seem to be widget related. I've changed the zip and build.bin name from 'battleborn_meter' to 'battle_meter' in case it was the number of characters. Also added, in modmain:Assets = { Asset( "ANIM", "anim/battle_meter.zip"),}but it still doesn't do the trick. Is there an additional step I'm not aware of?battle_meter.zip Edited September 7, 2015 by Gryffo Link to comment Share on other sites More sharing options...
ZupaleX Posted September 8, 2015 Share Posted September 8, 2015 Could you provide a bigger piece of code? Because what is this famous "status" here? Link to comment Share on other sites More sharing options...
Gryffo Posted September 9, 2015 Author Share Posted September 9, 2015 Could you provide a bigger piece of code? Because what is this famous "status" here? Hello ZupaleX, I'm a fan of your mods Yes, I can in fact provide you with the whole mod. It's a simple one that aims to make Wigfrid a little more fun for me and my fellows while helping me understand modding better. Please note since posting this message I decided to do things 'the dirty way' and got it to work by adding a bunch of childs to the badge and loading various Image assets (.tex's and .xml's ) to them. I am still interested, though, in learning how to do it the way I feel blends best with the official approach (having the game understand my Anim folder's .zip with anim and build and atlas files). I should mention the file is a renamed .rar, instead of a proper .zip. Hope that doesn't ruin anyone's day.Wigfrid Tweaks.zip Link to comment Share on other sites More sharing options...
ZupaleX Posted September 9, 2015 Share Posted September 9, 2015 (edited) You should have left it as a rar because windows refuses to open the .zip actually. Anyway, I extracted it by renaming it to .rar again I check this a come back to you if I have anything interesting to say. EDIT: I am not sure I understand your issue. The badge shows up for me. EDIT2: ok forget what I said I read your previous post properly and understand what you want now. You have the exported folder somewhere? Edited September 9, 2015 by ZupaleX Link to comment Share on other sites More sharing options...
ZupaleX Posted September 9, 2015 Share Posted September 9, 2015 (edited) Soooo, I commented out all the stuffs related to your dirty "fix" with images, put back the ANIM as an asset only, modify something and : http://prntscr.com/8ej8eu I just modify one single stuff. Here are the hints for you : in beaverbadge.lua Badge._ctor(self, "beaver_meter", owner)Then in badge.lua local Badge = Class(Widget, function(self, anim, owner) ........ self.anim:GetAnimState():SetBank(anim) self.anim:GetAnimState():SetBuild(anim) self.anim:GetAnimState():PlayAnimation("anim")Now look into your scml file. (<- That's me after seeing what you did) PS : just kidding Edited September 9, 2015 by ZupaleX Link to comment Share on other sites More sharing options...
Gryffo Posted September 10, 2015 Author Share Posted September 10, 2015 Could you explain in more detail? I'm not sure I have a scml file anywhere, nor what they're supposed to do exactly. Sorry if this is a simple mistake. Link to comment Share on other sites More sharing options...
ZupaleX Posted September 11, 2015 Share Posted September 11, 2015 How did you create the zipfile btl_meter.zip?Didn't you use spriter? If not then I understand everything. I explain :I used krane to decompile the anim.bin and build.bin from your ctl_meter.zip to see what was inside.I noticed that the file contains one build which is called "beaver_meter"This build contains one anim called "anim". The issue is that the constructor of the badge takes as an argument a name. You put "btl_meter" because that's how your file is called. Unfortunatly you cannot do it like that. Because then look in the constructor : this name is called to set the build (ok the build is called btl_meter, it's the name of the file), but also the bank! And here is the issue, the bank is called "beaver_meter" so the game doesn't find it so you get nothing. You have to name the bank "btl_meter" as well.Now, I guess you just took the beaver_meter.zip, extracted it, modified the .tex and thought that you'll be done with it. NOPE. Just create a new spriter file and name everything properly, it will be much better.Otherwise do what I did. Decompile your anim.bin and build.bin with krane, rename the "beaver_meter" by "btl_meter" in the scml file you get as an output, launch the game (it will recompile the file) and enjoy. I hope it is not too confused what I said? Link to comment Share on other sites More sharing options...
Gryffo Posted September 15, 2015 Author Share Posted September 15, 2015 I understand, thank you for your time. 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