Jump to content

SetRace problem


Arrawnt

Recommended Posts

Okay, I am trying to do the following.

 

When the player is Conjuration 100, he can acquire the perk "Lich Form", which obviously transforms him into a lich permanently.

 

So I created a perk, added it to the conjuration perk tree, and obviously I have to use the SetRace command to set the new player's race to DragonPriestRace (which actually transforms it into a Dragon Priest / Lich-like form).

 

According to the official Creation Kit wiki, the "extend Form" header is needed to manipulate the race. I have created a very simple script that should do the trick, but I don't seem to get it because it says no viable alternative at input '.'

 

Yes I know the period is the problem, so here's my little script (attached to this perk):

 

Scriptname LichPerk extends Form

Game.Getplayer().SetRace(DragonPriestRace)

 

I am very new to scripting so, am I missing something? Thank you.

Edited by Arrawnt
Link to comment
Share on other sites

Only declarative code can be used outside of function bodies.

 

You don't want to attach a script to the race, though. In fact, I'm pretty sure the game doesn't know how to handle that, and none of your code would ever be run (unless a global function was called from another script).

 

You could try using a quest script to add an ability to the player which is conditionalised to activate a scripted effect when the player's skill in Conjuration reaches 100, so an OnEffectStart event would be called, and then call SetRace in there.

 

You also can't use editorIDs directly in Papyrus. Read this for more information - EditorIDs in Papyrus

 

Cipscis

Link to comment
Share on other sites

  • Recently Browsing   0 members

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