halomantis Posted February 24, 2015 Share Posted February 24, 2015 Ok so I have gotten new Fish and New bait to work, meaning they are added to the Fishing.fishes and Fishing.lure but the problem I am having is getting to the new fish to show up when caught. What is happening is that when you catch them they are showing up as Medium IGUI_LongnoseGar 12cm blah blah. Now my guess is that it has something to do with the translate file. I am trying to find a way to fix this without having to edit any of the main files.if not fish.noNameChange then fishToCreate:setName(getText("IGUI_Fish_" .. fishType.size) .. " " .. getText("IGUI_Fish_" .. string.gsub(fish.name, "%s+", "")) .. " - " .. size .. "cm"); endThis is the line I think is causing the problem in ISFishingAction to create the fish. Not that anything is wrong with it, obviously just what is making the IGUI_Fish_ appear. In IG_UI_EN translate you can see IGUI_Fish_Medium = "Medium", IGUI_Fish_Pike = "Pike", So this looks like where they build the fish name and whatnot off the data from the fish. Ok lots of info probably not needed, but there we go. Link to comment Share on other sites More sharing options...
halomantis Posted February 27, 2015 Author Share Posted February 27, 2015 Ok so I have been delving deeper. I added a line to the translate file in the main media folder IG_UI_EN IGUI_Fish_LongnoseGar = "Longnose Gar", Everything ran just perfect, I used my new "lure" to catch the new fish. Sooooooo.... really the question comes to something really simple or harder depending on the answer. How do I add an item to the translation table without editing the main file in the media/lua/shared/translate folder. Link to comment Share on other sites More sharing options...
SiderisAnon Posted February 27, 2015 Share Posted February 27, 2015 Why not just skip the getText() call entirely and just use a string? The only purpose that call serves is to pull information from the various languages. If you are not planning on providing translation entries for multiple languages, there's no point in using getText() anyway. Link to comment Share on other sites More sharing options...
halomantis Posted February 28, 2015 Author Share Posted February 28, 2015 The getText() call is built into the games ISFishingAction, which is used for when the player fishes. Part of that code is to build the name of the fish with the size. Link to comment Share on other sites More sharing options...
halomantis Posted March 3, 2015 Author Share Posted March 3, 2015 Ok after some time looking at the DirtyWaterMod (which has been a massive help in this), I did a quick translate function to remove the IGUI from the name put there by ISFishingAction. I do always love learning more 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