JennaBelle Posted August 14, 2020 Share Posted August 14, 2020 I know that there's a console command that makes character invisible to monsters, c_makeinvisible(1). I'm trying to figure out how to add this to a character as a feature so that that specific character is always invisible to monsters. I've tried adding the "monster" tag to the character but that doesn't seem to be working as they still get attacked while insane. How do I do this? Link to comment Share on other sites More sharing options...
CarlZalph Posted August 14, 2020 Share Posted August 14, 2020 function c_makeinvisible() local player = ConsoleCommandPlayer() player:AddTag("debugnoattack") print("Has debugnoattack tag?", player, player:HasTag("debugnoattack")) end From the files. I haven't checked how far reaching debugnoattack tag has, so there might be other side effects that this introduces. Link to comment Share on other sites More sharing options...
Mobbstar Posted August 14, 2020 Share Posted August 14, 2020 There are also two tags "notarget" and "invisible", but I think both of those are used somewhere already and thus may get removed at some point (e.g. using Bush Hat) Link to comment Share on other sites More sharing options...
JennaBelle Posted August 14, 2020 Author Share Posted August 14, 2020 (edited) On 8/14/2020 at 12:05 AM, CarlZalph said: function c_makeinvisible() local player = ConsoleCommandPlayer() player:AddTag("debugnoattack") print("Has debugnoattack tag?", player, player:HasTag("debugnoattack")) end From the files. I haven't checked how far reaching debugnoattack tag has, so there might be other side effects that this introduces. Where is the character's prefab file should this go? Update: This isn't working regardless of where in the character's prefab or modmain files I put it. I get an error and the game won't load. Edited August 16, 2020 by JennaBelle update Link to comment Share on other sites More sharing options...
JennaBelle Posted August 17, 2020 Author Share Posted August 17, 2020 I still can't figure this out. Link to comment Share on other sites More sharing options...
JennaBelle Posted August 27, 2020 Author Share Posted August 27, 2020 I haven't figured this out yet. Anybody? Link to comment Share on other sites More sharing options...
penguin0616 Posted August 27, 2020 Share Posted August 27, 2020 (edited) That is a command you run in the console. If you want to add it to your prefab, then you can add inst:AddTag("debugnoattack") into your prefab code before the :SetPristine() or TheWorld.ismastersim check. Also, like Carl said, there's no guarantee that you won't be attacked. For example, frogs appear to ignore that and will attack anyway. Edited August 27, 2020 by penguin0616 1 Link to comment Share on other sites More sharing options...
JennaBelle Posted August 29, 2020 Author Share Posted August 29, 2020 On 8/27/2020 at 1:55 PM, penguin0616 said: That is a command you run in the console. If you want to add it to your prefab, then you can add inst:AddTag("debugnoattack") into your prefab code before the :SetPristine() or TheWorld.ismastersim check. Also, like Carl said, there's no guarantee that you won't be attacked. For example, frogs appear to ignore that and will attack anyway. I can't find either of ":SetPristine()" or "TheWorld.ismastersim" in the character's prefab file. Are you maybe talking about a different prefab file? Because this needs to be included with the character as a feature. Link to comment Share on other sites More sharing options...
penguin0616 Posted August 29, 2020 Share Posted August 29, 2020 Should have clarified, it would go before the :SetPristine() or TheWorld.ismastersim check in the player_common if you were doing it to each character. Assuming this is a vanilla character, you can add it to their master_postinit, 1 Link to comment Share on other sites More sharing options...
JennaBelle Posted August 29, 2020 Author Share Posted August 29, 2020 20 hours ago, penguin0616 said: Should have clarified, it would go before the :SetPristine() or TheWorld.ismastersim check in the player_common if you were doing it to each character. Assuming this is a vanilla character, you can add it to their master_postinit, it's actually a custom character, not one of the vanilla characters. Does that change anything? Link to comment Share on other sites More sharing options...
penguin0616 Posted August 30, 2020 Share Posted August 30, 2020 2 hours ago, JennaBelle said: it's actually a custom character, not one of the vanilla characters. Does that change anything? Assuming that you have some sort of master_postinit (can be called anything) already present, no. 1 Link to comment Share on other sites More sharing options...
JennaBelle Posted September 2, 2020 Author Share Posted September 2, 2020 On 8/29/2020 at 8:16 PM, penguin0616 said: Assuming that you have some sort of master_postinit (can be called anything) already present, no. That seems to be working. Thank you! Link to comment Share on other sites More sharing options...
penguin0616 Posted September 2, 2020 Share Posted September 2, 2020 @JennaBelle You're welcome. 1 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