Sign in to follow this  
Arkonick

Need help in finding texture method for signs

Recommended Posts

ok looking for some help. I've done searches in Intellij but it doesn't find this string which I've had this some times happen when searching for a string value. I know it's there but haven't found it. Anyone know where the shopsign strings are at for the drop down image file?

I looked for the method but in the method it does not include the drop down string or list. example the image for sword and the bowl sign is called "Sword and bowl" this string is linked to the actual pic image in the mapping.txt file. Some where in the class files is the string list with "Sword and bowl". Anyone know which class this drop down list of strings are.

I could do this the hard way and just create a new id x amount of times for the new shop signs I'm adding but this would be the dumb way when the method and list already exist.

 

Now that's done ran into another road block. Can't find the method or code that calls the texture once you select the sign. 

Names are in the drop down box to change the shop sign image and the mapping.txt file is set but when select the name in the drop down box image doesn't change so there has to be a method some where that tells it to look for the image in a array or something.

Need help if you know where this is called been looking in methods and such just havn't found where this last thing is.

 

Cool signs waiting to go in soon as I find this.WU%20Shop%20Signs?sort=3&page=1

Edited by Arkonick

Share this post


Link to post
Share on other sites

In TextInputQuestion.java 

 

        if (this.sign) {
            buf.append("harray{label{text='Sign image'}dropdown{id='data1';options=\"");
            buf.append("No change,");
            buf.append("Bowl,Beer,Bear and beer,Crops,Construction,Sleep,Wine,Coins,Horse,Hunt,Sword and bowl,Lumber,Swordsmith,Anvil,Helmet,Baker,Shipwright,Anchor,Pirate,Mystery,Tailor,Alchemy,");
            buf.append("No change");
            buf.append("\"}}");
        }

 

Do you mean this?

  • Like 1

Share this post


Link to post
Share on other sites
9 minutes ago, bdew said:

In TextInputQuestion.java 

 


        if (this.sign) {
            buf.append("harray{label{text='Sign image'}dropdown{id='data1';options=\"");
            buf.append("No change,");
            buf.append("Bowl,Beer,Bear and beer,Crops,Construction,Sleep,Wine,Coins,Horse,Hunt,Sword and bowl,Lumber,Swordsmith,Anvil,Helmet,Baker,Shipwright,Anchor,Pirate,Mystery,Tailor,Alchemy,");
            buf.append("No change");
            buf.append("\"}}");
        }

Do you mean this?

yes thanks Bedew, Keenan beat you to it in #wurmunlimited channel but thanks for the reply this will help others in the future. I spent over a week looking for this and I can't believe I didn't think to look in that question section. My brain is over worked here as of late.

Share this post


Link to post
Share on other sites

Are you sending additional mapping strings like model.sign.shop.23 if you want to add more, and does the mouseover text on the sign change to the correct mapping?

Share this post


Link to post
Share on other sites

yes I added to the drop down menue behind the Alchemy tag then in the mapping.txt I added in order and numbered them just like the originals where named. At first I started with number 30 but after that didn't work I renamed them starting after 22 which was alchemy incase it was going by an array in order, and it still want work. So then I tried to move alchemy down 1 and one of mine up in alchemys place in the textinput in game when i select mine example wagon wright it shows alchemy sign image so that didn't work.

 

When i select my names in the drop down the sign does not update to the new image it stays at what ever image it was before the change so if it was base it stays base.0 if it was anvil then it stays anvil if trying to switch to one of mine.

 

There is something I'm missing I can't find a array with a limit to a switch statement. This same method is tied to alot of texture models that only changes textures that have 1 model so soon as I find out what this is I can get mine to work.

Share this post


Link to post
Share on other sites

This is what I done in the TextInputQuestions

buf.append("Bowl,Beer,Bear and beer,Crops,Construction,Sleep,Wine,Coins,Horse,Hunt,Sword and bowl,Lumber,Sword Smith,Anvil,Helmet,Baker,Shipwright,Anchor,Pirate,Mystery,Tailor,Alchemy,Wagon Wright,Apple Orchard,Cherry Orchard,Lemon Orchard,Olive Orchard,Orange Orchard,Walnut Orchard,Chestnut Orchard,Bears,Wolfs,Sheeps,Lions,Chickens,Bees,Turtles,Spider,Snake,Scorpion,Lamb,Cows,Horses,Goats,Fishs,Pigs,Animals,Horse an Barrel,Puppies,");

 

this is my mapping.txt info

# ShopSigns ------------------------------------------------------------------
model.sign.shop.23  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_23.png
model.sign.shop.24  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_24.png
model.sign.shop.25  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_25.png
model.sign.shop.26  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_26.png
model.sign.shop.27  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_27.png
model.sign.shop.28  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_28.png
model.sign.shop.29  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_29.png
model.sign.shop.30  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_30.png
model.sign.shop.31  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_31.png
model.sign.shop.32  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_32.png
model.sign.shop.33  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_33.png
model.sign.shop.34  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_34.png
model.sign.shop.35  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_35.png
model.sign.shop.36  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_36.png
model.sign.shop.37  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_37.png
model.sign.shop.38  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_38.png
model.sign.shop.39  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_39.png
model.sign.shop.40  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_40.png
model.sign.shop.41  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_41.png
model.sign.shop.42  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_42.png
model.sign.shop.43  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_43.png
model.sign.shop.44  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_44.png
model.sign.shop.45  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_45.png
model.sign.shop.46  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_46.png
model.sign.shop.47  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_47.png
model.sign.shop.48  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_48.png
model.sign.shop.49  = ArkStuff/structures/ShopSign/ShopSign_main.wom?sign.texture=Sign_49.png

Share this post


Link to post
Share on other sites

The number is stored in the aux data as a byte and is automatically added to the model name in Item.getModelName for signs.

 

Your problem i think is in QuestionParser.parseTextInputQuestion which has 22 hardcoded

 

                        if (stype != null && stype.length() > 0) {
                            final byte bt = Byte.parseByte(stype);
                            if (bt > 0 && bt <= 22) {
                                item.setAuxData(bt);
                                if (!item.setDescription(answer2) && item.getZoneId() > 0 && item.getParentId() == -10L) {
                                    final VolaTile t = Zones.getTileOrNull(item.getTileX(), item.getTileY(), item.isOnSurface());
                                    if (t != null) {
                                        t.renameItem(item);
                                    }
                                }
                                updated = true;
                            }
                        }

You'll probably need to use bytecode editing to change that

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Bdew that was it. I looked in there earlier and must have got distracted by my wife and her testing online asking me questions. Cause I know I was in that file and didn't see it.

Thanks for taking time help me locate it. I knew there was a number that had to be changed the way it wouldn't look past 22 and that was what I was looking for.

Share this post


Link to post
Share on other sites
On 3/2/2017 at 1:13 PM, bdew said:

The number is stored in the aux data as a byte and is automatically added to the model name in Item.getModelName for signs.

 

Your problem i think is in QuestionParser.parseTextInputQuestion which has 22 hardcoded

 


                        if (stype != null && stype.length() > 0) {
                            final byte bt = Byte.parseByte(stype);
                            if (bt > 0 && bt <= 22) {
                                item.setAuxData(bt);
                                if (!item.setDescription(answer2) && item.getZoneId() > 0 && item.getParentId() == -10L) {
                                    final VolaTile t = Zones.getTileOrNull(item.getTileX(), item.getTileY(), item.isOnSurface());
                                    if (t != null) {
                                        t.renameItem(item);
                                    }
                                }
                                updated = true;
                            }
                        }

You'll probably need to use bytecode editing to change that

 

I'm doing a similar project to what Arkonick did and without trying happen to need to change 22 to 49 as well. I found what I needed in TextInputQuestions.class and updated it with my additional drop down menu items. I however am having difficulty locating what you are referring to above. I looked in QuestionParser.class and don't see a match to the above code. Do you happen to have any better  way to direct me like am I in the right class file and maybe provide a line #?

 

Thanks in advance,

Share this post


Link to post
Share on other sites

do a search for this 

bt > 0 && bt <= 22 it should be same regardless the decompiler you used.

Share this post


Link to post
Share on other sites

I have no idea why I wasn't finding it (I use IntelliJ and NetBeans btw). Came back to this the next day with fresh eyeballs and had no problem finding it.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this