Jump to content

papyrus troubleshooting


jahnarae

Recommended Posts

I am trying to make a skyrim version of the Boots of Springheel Jak and my papyrus skills are too novice for this task. The idea is for the boots to activate a perk when equipped and remove the perk when unequipped Here is my script that i have made based on web tutorials:

 

Scriptname BootsofSpringheelJak extends ObjectReference

{Scriptname BootsofSpringheelJak

 

Event OnEquip(Actor akActor)

If (akActor == Game.GetPlayer())

Game.GetPlayer()akActor.AddPerk(SpringheelJakPerk)

endif

endEvent

 

Event OnUnequip(Actor akActor)

If (akActor == Game.GetPlayer())

Game.GetPlayer()akActor.RemovePerk(SpringheelJakPerk)

endif

endEvent}

 

Can somebody please correct the script so it adds the script when the item is equipped?

Link to comment
Share on other sites

Scriptname BootsofSpringheelJak extends ObjectReference 

Event OnEquip(Actor akActor)
If (akActor == Game.GetPlayer())
Game.GetPlayer().AddPerk(SpringheelJakPerk)
endif
endEvent

Event OnUnequip(Actor akActor)
If (akActor == Game.GetPlayer())
Game.GetPlayer().RemovePerk(SpringheelJakPerk)
endif
endEvent

 

You don't need (and it's not possible) to script Game.GetPlayer()akActor. The script will fire when the player equips the boots and the perk will be assigned to the player without messing with the parameter. Also, i removed the { wich was invalidating the whole script (treating it as a comment)

Link to comment
Share on other sites

This is my

 

Scriptname BootsofSpringheelJak extends ObjectReference

 

Event OnEquip(Actor akActor)

If (akActor == Game.GetPlayer())

Game.GetPlayer().AddPerk(SpringheelJakPerk)

endif

endEvent

 

Event OnUnequip(Actor akActor)

If (akActor == Game.GetPlayer())

Game.GetPlayer().RemovePerk(SpringheelJakPerk)

endif

endEvent

 

but the scripter says that variable SpringheelJakPerk is undefined

 

how do i fix this?

Link to comment
Share on other sites

You need to define SpringheelJakPerk as the script does not know about perks (or anything else inside the CK for that matter) add these lines line after

Scriptname BootsofSpringheelJak extends ObjectReference

 

Perk Property SpringheelJakPerk auto
{Perk to add/remove}

 

and then set the property in the CK to whatever your perk is called, if ot's the same name the press autofill.

Edited by flobalob
Link to comment
Share on other sites

Scriptname BootsofSpringheelJak extends ObjectReference
{
Jahnarae's Boots of Springheel Jak script.
Adds perk "SpringheelJakPerk" when worn.
Removes the perk when the boots are removed.
}

Perk Property SpringheelJakPerk auto
{Assign the perk to this property using the Property button in CK}

Event OnEquip(Actor akActor)
{If the Player doesn't have the perk already, add it.}
If (akActor == Game.GetPlayer())
	If !AkActor.HasPerk(SpringheelJakPerk)
		akActor.AddPerk(SpringheelJakPerk)
	EndIf
Endif
EndEvent

Event OnUnequip(Actor akActor)
{If the Player has the perk then remove it.}
If (akActor == Game.GetPlayer())
	If AkActor.HasPerk(SpringheelJakPerk)
		akActor.RemovePerk(SpringheelJakPerk)
	EndIf
Endif
EndEvent

Edited by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

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