Jump to content

Error object activate change player hair.


Recommended Posts

I am trying to make an object that when it is activated by the player it changes the facial hair of the player. I've been trying to do this to figure out how the ChangeHeadPart command works, and I have been unsuccessful. The following is what I have so far for the source.

 

Scriptname ChangeHair extends ObjectReference Native Hidden
Function ChangeHeadPart(headpart apHeadPart, bool abRemovePart = false, bool abRemoveExtraParts = false) native
Event OnActivate(ObjectReference akActionRef)
ActorToChange.ChangeHeadPart(BigBeard06)
EndEvent
I get the following three errors:
(6,1): variable ActorToChange is undefined
(6,30): variable BigBeard06 is undefined
(6,15): none is not a known user-defined script type
I see where the errors point, but I'm not understanding what is wrong because I pulled the pieces of it straight from the wiki. I'm doing this as an initial test to try and learn and understand the ChangeHeadPart script with the end goal of using that command with an in game timer to change the player's hair after a set time. This is my first attempt at a mod. I have had basic C, but I have never used Papyrus. Any help, tips, or recommendations are appreciated.

 

Link to comment
Share on other sites

Compiler doesn't know who that ActorToChange is and which headpart is that BigBeard06. You must define properties with that names and then fill them with needed Actor and Headpart.But For your case, ActorToChange will be player, so you don't need to define it's property and can just call: Game.getplayer().changeHeadPart(BigBeard06). But you will need to define property BigBeard06. For this write this at the beginning of your script:ÃÂ

headpart property BigBeard06 Auto

Then compile, save, go to pproperties and point that to needed head part. Final script should be something like this:

Scriptname ChangeHair extends ObjectReference Native Hidden
Headpart property BigBeard06 Auto 

Event OnActivate(ObjectReference akActionRef)   
  Game.getplayer().ChangeHeadPart(BigBeard06)
EndEvent
Edited by shavkacagarikia
Link to comment
Share on other sites

Compiler doesn't know who that ActorToChange is and which headpart is that BigBeard06. You must define properties with that names and then fill them with needed Actor and Headpart.But For your case, ActorToChange will be player, so you don't need to define it's property and can just call: Game.getplayer().changeHeadPart(BigBeard06). But you will need to define property BigBeard06. For this write this at the beginning of your script:ÃÂ

headpart property BigBeard06 Auto

Then compile, save, go to pproperties and point that to needed head part. Final script should be something like this:

Scriptname ChangeHair extends ObjectReference Native Hidden
Headpart property BigBeard06 Auto 

Event OnActivate(ObjectReference akActionRef)   
  Game.getplayer().ChangeHeadPart(BigBeard06)
EndEvent

 

 

Thanks for the help I really appreciate it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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