Jump to content
Heavy Traffic ×

[LE] Help for Papyrus Coding (I'm a beginner)


Recommended Posts

Hello! Im making a mod, (or at least trying to) And I would like the mod to turn the player into a Wraith (using Ethereal FX) when crouched. I know I need to write a script for this, But I have no idea what I'm doing. Here's what I have so far



Event OnInit()

If Game.Getplayer().IsSneaking()

WraithBind.Cast(Game.GetPlayer())

endIf

EndEvent

"Wraith Bind" Is the name of the spell I created with the effects. yet, The magic effect itself still needs the code so this only happens while sneaking. I have it so when I equip the ring It turns me Ethereal ALLL the time. Not only when I'm sneaking. Thanks so much for any help. And keep in note, I'm a beginner. Thanks again!!!


(Yes I did post the same thing on reddit, I nEeD sOmE hElP)


Link to comment
Share on other sites

You may not need any scripting at all for this, in fact!

 

So, spells and enchantments work by having a list of magic effects added to them, I assume you're familiar with this, since you say you've created a spell with those effects.

 

You can add conditions to what effects happens in that screen. If they're added *on the spell* editing screen they will be polled for by the game engine without the need for further scripts. IsSneaking is a valid condition function (full list here: https://www.creationkit.com/index.php?title=Condition_Functions).

 

If this is an enchantment on the ring, boom, you're done.

Link to comment
Share on other sites

onInit() is bad choice for a script, which should check if the player is sneaking. https://www.creationkit.com/index.php?title=Category:Events here you will find a list of all possible events and where they are running. If you want to learn more about programming in Papyrus, bookmark this site, it is very helpful.

 

If i understood you right, you want to cast a spell and if player is sneaking do the effect.

Event OnEffectStart(Actor akTarget, Actor akCaster)
  If Game.Getplayer().IsSneaking()
      ;your turning into wraith code here 
  endif
endEvent

You have to bind the script onto the magic effect the spell is using.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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