Jump to content

Recommended Posts

Hi,

Is there a way to disable combat (player can't attack at all)?

If yes, how? Also how to re-enable it?

Thanks!

 

Edit:

Maybe I can set inst.combat.canattack to false?

Edit:

Kind of, but force attack still works even with canattack set to false.

Edited by SenL
Link to comment
https://forums.kleientertainment.com/forums/topic/63168-disable-combat/
Share on other sites

I don't know if disabling combat is possible, but if you want them to deal no damage you can set their damage multiplier to 0. That way they can't hurt anything. And then keep canattack set to false so that they generally don't attack.

Out of curiosity, is there a reason you don't want the character to be able to attack at all? It sounds like the character would be a burden online. Even if the game they are from shows them to never attack anything (and I know how that feels; making Frisk from Undertale, who should always be passive), sometimes a character needs to fight in Don't Starve, unless you make all creatures passive towards the character which is a hard task.

I looked at it and still have no clue.

Looking at Gesture Wheel's code, it has "SetModHUDFocus("GestureWheel", true)" and "SetModHUDFocus("GestureWheel", false)".

Tried that (replaced "GestureWheel" with my own) and it disables the control (not HUD) but does not re-enable the control (even when "true" is passed).

Not sure how to use this properly... 

 

Now about the "character to not able to move (instead of walking/running in place)" ... how would one do that, is it possible?

 

Thanks.

You having it found it used in Gesture Wheel mod is great.

I discovered it the other way - I found out that having the gesture wheel shown disables the controls and hiding the wheel enables them again and looked up how it has achieved that.

And you actually wrote it as well - SetModHUDFocus("id", true) for disabling the controls, SetModHUDFocus("id", false) for enabling them again. Having access to SetModHUDFocus's definition (yay!), I could also see how are its parameters used - hasfocus as a boolean and focusid as an identifier.

Trying SetModHUDFocus("id", true), the character did not move when I pressed WASD, and it did not run in place.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...