Jump to content

[LE] How to make the player deal 0 damage creation kit Slyrim SE


Recommended Posts

I am trying to make a mod where I need to have the player unable to harm anything while wearing a piece of armor. Its basically an enchantment I want to make without going into too much detail of what its for. I have been trying the different damage modifiers in the creation kit but none of them subtract damage, only add to it. I have also tried the etherealize effect arch type under magic effects but that didnt work either. I tried messing with making a custom perk in a magic effect then placing it on an enchantment and still nothing. I have been at this for hours. i believe the only way to do it is through scripting. I know basic scripting but really have never scripted anything in papyrus. Would anyone have any ideas?

Link to comment
Share on other sites

A quick and simple way to do this is to put a simple script on the armor.


Event OnEquipped(Actor akActor)
Game.DisablePlayerControls(0, 1, 0, 0, 0, 0, 0)
EndEvent


Event OnUnequipped(Actor akActor)
Game.EnablePlayerControls()
EndEvent



* There are also other ways you can do this.

Link to comment
Share on other sites

The player retains full control while wearing your armor but he can't do combat unless he unequips it.

* As long as this line:

Game.DisablePlayerControls(0, 1, 0, 0, 0, 0, 0)
DOES NOT CHANGE !.

 

* This is the simplest way to do this.

 

SSE forum link bellow:

https://forums.nexusmods.com/index.php?/forum/4070-skyrim-special-edition-creation-kit-and-modders/

 

I hope it helps.

Edited by maxarturo
Link to comment
Share on other sites

So I copied the script exactly as you wrote it into a new magic effect. I made sure that it was script, on self, constant effect, compiled it, and it did not work. I then tried adding some properties to the script, even though I have no idea what i am doing in that sense. I tried making a property that made it so it would run on the player, but still did not work. I can still do damage to NPC's.

Link to comment
Share on other sites

"So I copied the script exactly as you wrote it into a new magic effect"

What...??


I clearly dictated to :

"A quick and simple way to do this is to put a simple script on the armor."

I didn't said anything about a "Magic Effect", you can do this with a magic effect but requires a different approach.


Open your armor in CK, the armor's property window and place the script there, it should extend "ObjectReference".

Link to comment
Share on other sites

SOLVED!

I figured it out! I found someone else's script that did something similar, and kind of mixed it with the code you posted. It was a lot of trial and error, but It now works! Thank you for your help!

and for anyone who wants to use it here is the code and it is set up as a magic effect script so that it can be applied to an armor piece and disenchanted so you can put it on other items:



Scriptname PlayerDealsNoDamage extends activemagiceffect


Bool Property Fighting = false auto


EVENT OnEffectStart(Actor akTarget, Actor akCaster)
Game.DisablePlayerControls(Fighting)
Game.EnablePlayerControls(true, false, true, true, true, true, true, true)


ENDEVENT

EVENT OnEffectFinish(Actor akTarget, Actor akCaster)
Game.EnablePlayerControls(true, true, true, true, true, true, true, true)

ENDEVENT

Edited by WondraBox
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...