. . . Posted November 3, 2016 Share Posted November 3, 2016 (edited) Hello, I have a question! So, on a certain event is there a code or something I can do to swap the health badge's textures with "gelid_health" I made? And then on another event a code to make the health badge's textures back to default again? Any help would be appreciated! Also, thanks so much for reading my question & have a wonderful day/night ! Edited November 6, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/ Share on other sites More sharing options...
. . . Posted November 4, 2016 Author Share Posted November 4, 2016 (edited) I hope this isn't too complicatedt ... Edited November 5, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/#findComment-833012 Share on other sites More sharing options...
. . . Posted November 6, 2016 Author Share Posted November 6, 2016 (edited) I guess i'm asking the impossible ... Edited November 6, 2016 by SuperDavid It's impossible ;-; Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/#findComment-834090 Share on other sites More sharing options...
Zeklo Posted November 9, 2016 Share Posted November 9, 2016 Bumping, because I'm curious as well. Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/#findComment-835709 Share on other sites More sharing options...
Serpens Posted November 10, 2016 Share Posted November 10, 2016 dont know specific code, but if I got it right, you simply want to hide/remove the heart and show another icon you made? Why not just hiding the heart and show your icon? Put them at the same location and everything is fine. I'm not experienced on how to do this, but it sounds quite easy, so I wonder why you don't do this? To find out how to hide/show and set position of icons you can look at any mods that modding these icons, like combined status or PartyHUD - Team Health Display Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/#findComment-835994 Share on other sites More sharing options...
. . . Posted November 10, 2016 Author Share Posted November 10, 2016 (edited) 10 hours ago, Serpens said: I'm not experienced on how to do this, but it sounds quite easy, so I wonder why you don't do this? To find out how to hide/show and set position of icons you can look at any mods that modding these icons I don't understand those mods, most of the time they're extremely complicated but i'll try to take a look but I probably won't be able to do anything.. Edited November 11, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/#findComment-836045 Share on other sites More sharing options...
. . . Posted November 11, 2016 Author Share Posted November 11, 2016 (edited) Okay, so I have something like this in my modmain.lua table.insert(Assets, Asset("ANIM", "anim/gelid_health.zip")) local function GelidHealthBadge(class, inst) if GLOBAL.ThePlayer.prefab == "adam" and inst.gelid_mode == true then class.heart.anim:GetAnimState():SetBuild("gelid_health") elseif GLOBAL.ThePlayer.prefab == "adam" and inst.gelid_mode == nil then class.heart.anim:GetAnimState():SetBuild("health") end end AddClassPostConstruct("widgets/statusdisplays", GelidHealthBadge) and it works the only problem is I have no idea how to activate this function in other functions inside modmain.lua or inside mycharacter.lua ... If anyone can help with those that would be great because I don't know how to do this ... Thanks for reading have a wonderful day/night ! Edited November 11, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/#findComment-836186 Share on other sites More sharing options...
Serpens Posted November 11, 2016 Share Posted November 11, 2016 why not putting this into an event? or the same time when the mode gets true Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/#findComment-836260 Share on other sites More sharing options...
. . . Posted November 11, 2016 Author Share Posted November 11, 2016 1 hour ago, Serpens said: why not putting this into an event? or the same time when the mode gets true You can put functions in other functions ? Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/#findComment-836300 Share on other sites More sharing options...
Serpens Posted November 11, 2016 Share Posted November 11, 2016 2 minutes ago, SuperDavid said: You can put functions in other functions ? you can call functions within function =P But I don't know the way to call this specific function... and of course you have to make sure, that you don't call a function that belongs to a bigger complex. I mean you have to know what the function does and what is the original purpose of this function. If the function is ment to be called only if xy happens and you call it at xz, it might cause problems. So you have to understand if there will be problems or not. What you did was to put a function into the StatusDisplay script... I don't think this is good way to do it... But as I already stated, I have not much knowledge with dealing icons and such stuff... And why are you using ThePlayer and inst in your code? Isn't "inst" the player? .... hm no, sry I can't help you more. I would need to dig deeper ind learn on my own how to do it properly. And therefore I would need one or two hours I can't afford at the moment. All I can tell you, that you could try when the mode activates: local StatusDisplays = require "widgets/statusdisplays" StatusDisplay.GelidHealthBadge(inst) But don't know if this will work. And I don't know if your code will work for everyone and with caves... Link to comment https://forums.kleientertainment.com/forums/topic/71376-possible-swap-health-badges-textures-on-event/#findComment-836308 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