rons0n Posted March 13, 2015 Share Posted March 13, 2015 Is it possible to not make our character see the map? As in, no matter how many times he looks at the map he'll forever see nothing but his Map icon. (Maybe not even his map icon) Or alternatively, just disable him from using the map completely. Though we much prefer the 1st option. Link to comment Share on other sites More sharing options...
rezecib Posted March 13, 2015 Share Posted March 13, 2015 @rons0n, TheWorld.minimap.MiniMap:ContinuouslyClearRevealedAreas(true)You have to make sure this runs on the client, though, so finding the right hook to run the code may be a challenge. Once you find the right place for it to run, you can check that you're on the client with this:if ThePlayer.prefab == "mycharacterwhocantseethemap" then --clear minimapendAs for the right place to run... maybe this?inst:ListenForEvent("setowner", fn)So to put that all together, in the character's common_postinit, put this:inst:ListenForEvent("setowner", function() if ThePlayer.prefab == inst.prefab then TheWorld.minimap.MiniMap:ContinuouslyClearRevealedAreas(true) endend)You might also need a way to restore this behavior on the ghost -> living character transition, but I think it will get preserved without a special case for that. Link to comment Share on other sites More sharing options...
rons0n Posted March 14, 2015 Author Share Posted March 14, 2015 @rezecib, Gosh this is absolutely wonderful! This will definitely make this character more unique! Thanks for being so helpful yet again rezecib Link to comment Share on other sites More sharing options...
rons0n Posted March 16, 2015 Author Share Posted March 16, 2015 @rezecib, Everything is going well! Well, maybe a bit too well. So during some quick testing I noticed when I entered in console:local p = ThePlayer DeleteUserSession(p) p:Remove()Then chose a different character, my Character's No-map awareness perk is still in place. As in, no matter how many times I changed characters it still has his character perk. Now I thought it was because i didn't replace if ThePlayer.prefab == inst.prefab thenwith if ThePlayer.prefab == "thecharacter" thenbut even doing so, other characters still gain his no map awareness perk. I wonder if there's a way to bypass this? Link to comment Share on other sites More sharing options...
Kzisor Posted March 16, 2015 Share Posted March 16, 2015 @rons0n, did you try adding an else statement and setting it to false?if ThePlayer.prefab == inst.prefab then TheWorld.minimap.MiniMap:ContinuouslyClearRevealedAreas(true)else TheWorld.minimap.MiniMap:ContinuouslyClearRevealedAreas(false)end Link to comment Share on other sites More sharing options...
rezecib Posted March 16, 2015 Share Posted March 16, 2015 (edited) @Kzisor, Or a little bit more easily written as:TheWorld.minimap.MiniMap:ContinuouslyClearRevealedAreas(ThePlayer.prefab == inst.prefab)Edit: Also, @rons0n, there's a command for switching characters now, c_despawn(ThePlayer) Edited March 16, 2015 by rezecib Link to comment Share on other sites More sharing options...
Kzisor Posted March 16, 2015 Share Posted March 16, 2015 @Kzisor, Or a little bit more easily written as:TheWorld.minimap.MiniMap:ContinuouslyClearRevealedAreas(ThePlayer.prefab == inst.prefab)Edit: Also, @rons0n, there's a command for switching characters now, c_despawn(ThePlayer) rons0n isn't that great with code, so I was using code which might be a little easier to understand when they look back at it in the future. I've been helping them with their mods a lot so I want to make sure they understand how it works. I think using your code would be best rezecib as it's the most optimized and it's understandable now as I've posted the basics of how it works, that is it works like the if-else statement without the if-else statement being there. Link to comment Share on other sites More sharing options...
rons0n Posted March 16, 2015 Author Share Posted March 16, 2015 @Kzisor@rezecib This might be a little tougher than I thought. I applied both of your codes but it did not remove the issue of the perk glitch. Wonder whats happening? Link to comment Share on other sites More sharing options...
Kzisor Posted March 16, 2015 Share Posted March 16, 2015 (edited) @rons0n, is it affecting all players on the server or just you when you change characters? If it's affecting all players try:if not TheWorld.ismastersim then TheWorld.minimap.MiniMap:ContinuouslyClearRevealedAreas(ThePlayer.prefab == inst.prefab)endIt might be the case of how Lights work, if on non-dedicated servers the host has a light source equipped to their character it affects all players on the server. Edited March 16, 2015 by Kzisor Link to comment Share on other sites More sharing options...
DarkXero Posted March 16, 2015 Share Posted March 16, 2015 His TheWorld must keep existing when he changes characters. When you pick that character, TheWorld gets told to not update.When you don't pick it, TheWorld gets told nothing.Not picking that character does not equate to setting revealed areas into false.Therefore, the perk persists.TheWorld = GLOBAL.TheWorldAddPlayerPostInit(function(inst) TheWorld.minimap.MiniMap:ContinuouslyClearRevealedAreas(inst.prefab == "thecharacter")end)Try this. Link to comment Share on other sites More sharing options...
rons0n Posted March 16, 2015 Author Share Posted March 16, 2015 Yes! Everything is now working as expected! Appreciate all the help guys! Slamming that 'like' button like fist of the north star Link to comment Share on other sites More sharing options...
kormann Posted March 19, 2015 Share Posted March 19, 2015 Which character are you working on? I'm curious. Is it Dare Devil? LOL Link to comment Share on other sites More sharing options...
rezecib Posted March 19, 2015 Share Posted March 19, 2015 @kormann, Judging by what's on the workshop, I think it's the Zoro character. Link to comment Share on other sites More sharing options...
kormann Posted March 19, 2015 Share Posted March 19, 2015 (edited) Thanks @rezecib!This character looks pretty good. It's like an oriental swordsman version of Zorro but blind? Is that why it's called ZORO? Hehe.I might try it. Well done @rons0n,! Edited March 19, 2015 by kormann Link to comment Share on other sites More sharing options...
rezecib Posted March 20, 2015 Share Posted March 20, 2015 @kormann, a Google search suggests it's based on a One Piece character by that name. Link to comment Share on other sites More sharing options...
kormann Posted March 20, 2015 Share Posted March 20, 2015 Oh... this anime/manga, I never watched/read it, just heard from my friends. Maybe the One Piece creator did that on purpose then =P 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