Jump to content

Can I roll back to previous actor after a showracemenu() in script?


fanerion

Recommended Posts

Hello,

 

I am new in modding, so my knowledge is still basic.

My need: I would like to create a shapeshifting spell.

 

For now, I try to make my spell working as follow:

 

On_Init()

1) Save the items the player is wearing in variables

2) First problem: Trying to save the current playerRef in a variable

3) Save the player's infamy in a local variable

 

OnEffectStart(Target,Caster)

4) Ask the player in game if he/she wants to change his/her outfit thanks to a messageBox with limited options (Bandit outfit, Merchant, Robe, Fine Clothes, Archer, Blacksmith...)

5) RegisterForSingleUpdate(1.0)

 

OnUpdate()

6) Game.showraceMenu()

7) If the player is not seen during the "shapeshifting", remove the infamy on him/her

 

OnEffectFinish()

8 ) Second Problem: Trying to load previous character shapes on the player (before the showracemenu => fail

9) Remove the current outfit if it was changed in step 4

10) Put back the items the player was wearing in step 1 if needed

11) Put back his/her infamy

 

Basically my problem is when I process the showracemenu(), it changes allthe references of my player so it seems not possible to get back the previous form/race/bodypart of my player before the showracemenu.

Does someone know a way to do so? I tried to apply the VampireLordChange script logic to my script without success.

 

Thanks all in advance for your help!

Edited by fanerion
Link to comment
Share on other sites

By looking on the forum, I might find an idea how to solve it. The original Race is saved in other quest (Werewolf or VampireLord)

 

So basically, I could make it working with

- Game.GetPlayer().SetRace((CompanionsTrackingQuest as CompanionsHousekeepingScript).PlayerOriginalRace)

- or with Game.GetPlayer().SetRace((DLC1VampireLordTrackingQuest as DLC1VampireTrackingQuest).playerRace))

 

I will test it tonight and I will keep you posted.

 

source: http://www.nexusmods.com/skyrim/mods/11307/?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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