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 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 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 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 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.