aquelarrefox Posted June 16, 2019 Share Posted June 16, 2019 Hi, basicly i want to make a mod similar as better compass, but instead of reveal the map, hide map if you dont equip the compass. I was looking some way to do it, 2 ways i think should be paths are working with a keyfuntion change (a realy bad idea for modding in any game) the other is get an black overlay over the map screen. Someone knows other better way? block the function of calling the map is mybe a way but i dont know if the script let you block a funtion temporaly (or something similar) some idea? Link to comment https://forums.kleientertainment.com/forums/topic/107622-i-want-no-see-the-map-if-you-dont-use-the-compass/ Share on other sites More sharing options...
CarlZalph Posted June 16, 2019 Share Posted June 16, 2019 To temporarily block a function in LUA is pretty easy if you have access to the function. Hook the function and in the prehook check your toggle variable, local to the player table or something, and if it's on then don't call the original function. Example in LUA: -- Given: a = {} function a:SomeFunction(a, b, c) print(self, a, b, c) end player = {} -- Do: player.blockmap = false local SomeFunction_old = a.SomeFunction a.SomeFunction = function(self, a, b, c, ...) if player.blockmap == true then return end return SomeFunction_old(self, a, b, c, ...) end -- Test: a:SomeFunction("a", "b") Link to comment https://forums.kleientertainment.com/forums/topic/107622-i-want-no-see-the-map-if-you-dont-use-the-compass/#findComment-1210696 Share on other sites More sharing options...
aquelarrefox Posted June 16, 2019 Author Share Posted June 16, 2019 fine i will try work over "function Controls:ToggleMap()", appears to be the funtion calling the map on screen Link to comment https://forums.kleientertainment.com/forums/topic/107622-i-want-no-see-the-map-if-you-dont-use-the-compass/#findComment-1210711 Share on other sites More sharing options...
Giano Posted June 17, 2019 Share Posted June 17, 2019 Not very much helping but i love the idea of making the compass finally useful. Can't wait to play with your mod when it's done. Thanks for trying to make it. Link to comment https://forums.kleientertainment.com/forums/topic/107622-i-want-no-see-the-map-if-you-dont-use-the-compass/#findComment-1210817 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