Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Script triggering after race selection?


SkyrimModHunter
 Share

Recommended Posts

Hello,

 

I'm looking for a way to trigger a script after one picks their race. 

 

I will use this script to add starting powers and perks.  The benefit of adding them after character selection is that they can later be removed, while spells that are "hard coded" to the race cannot be removed (at least I haven't found a way) even forcefully via a script. 

 

At first I was just going to use this script to add the starting stuff, but since the script triggers before the player picks their race, they don't yet have the ActorTypeDrow keyword.  Thanks for any help that someone might be able to provide.

 

Scriptname yyyRacialDrowStartingSpells extends Quest  

Event OnInit()
    RegisterForSingleUpdate(2.0)
    actor target = Game.GetPlayer()

         Debug.Notification("Checking if Drow")

    if target.hasKeyword(ActorTypeDrow)

         Debug.Notification("Target is a Drow, so adding starter spells")

        target.addspell(ShadowScourgeTigger)
        target.addspell(ShadowStalkerTrigger)
        target.addspell(ShadowSlayerTrigger)
        target.addspell(ShadowSorcererTrigger)
        
        target.addperk(FearedHeritage_0)

        target.addspell(FaerieFire_0)         
        target.addspell(DancingLightTrigger)
        target.addspell(Levitate_0)

    endif

EndEvent

Keyword Property ActorTypeDrow Auto

Perk Property FearedHeritage_0 Auto

Spell Property ShadowScourgeTigger Auto
Spell Property ShadowStalkerTrigger Auto
Spell Property ShadowSlayerTrigger Auto
Spell Property ShadowSorcererTrigger Auto

Spell Property FaerieFire_0 Auto
Spell Property DancingLightTrigger Auto
Spell Property Levitate_0 Auto

 

Link to comment
Share on other sites

I think I may have found the right event to use so that scripts run after character selection. 

 

Event OnRaceSwitchComplete()
Debug.Trace("This actor's race has finished changing")
endEvent

 

I'm hoping that it'll trigger when first selecting your race, rather than just if one had used "~ showracemenu" to forcefully change it.  Well, time to go test it.

 

EDIT:  I tested this event out, but have been unsuccessful getting it to trigger.  I attached the script to the Actor ID of one of the races preset character gen options.  When I pick that particular character preset, shouldn't the below script get attached to that actor, so that after character creation, the OnRaceSwitchComplete() event would trigger?  I've never used an "extends Actor" type of script before, so it's highly likely that I'm doing something wrong.

 

Scriptname yyyRacialDrowRaceChangeManager extends Actor

 

Event OnRaceSwitchComplete()
Debug.Trace("This actor's race has finished changing")
endEvent


 

Edited by SkyrimModHunter
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...