Jump to content

trying to have a script call the player characters special stats. (SOLVED!)


Recommended Posts

Basicly i'm attempting to make my own version of diverse bodies, but have it only work for the player character, and also only update on sleep.

 

for testing purposes the magiceffect that triggers the body change is tied to a consumed item. 

 

I know the body morph works, because i can manually assign a float to it, such as 2.0 and will get the body changes i want when i consume the item.

 

The problem is when i attempt to make a float variable that is determined by the players Strength special.

 

 

Heres my code.

 

Scriptname AKTBodyChangesEffect extends activemagiceffect

Actor property PlayerREF auto

ActorValue property Strength auto Const 
ActorValue property Endurance auto const
ActorValue property Charisma auto const
ActorValue property Agility auto const
ActorValue property Luck auto const

ActorValue Property Rads Auto Const


Bool BCenabled = true


Keyword property aktBC_Keyword auto

Event OnEffectStart(Actor playerREF, Actor akCaster)

    
    
    if BCenabled == false
        debug.notification("You need to enable body changes")
        utility.Wait(0.1)
    Else
        int Gender = playerREF.GetLeveledActorBase().GetSex()
            If Gender == 0
                debug.notification("This mod only works for Female Player Characters")
                utility.Wait(0.1)
            Else
                debug.notification("You feel the drug taking effect on your body")
                utility.Wait(0.1)
                
                debug.notification("your strength is ? " + playerREF.getvalue(Strength) )
                utility.Wait(0.1)

                PlayerBC(playerREF)
            Endif 
    Endif
EndEvent


Float function findmySTR()
    float tempSTR = PlayerRef.GetValue(Strength)
    
    return tempSTR / 10
endfunction    


Function PlayerBC (Actor playerREF)
        float mySTR = findmySTR()
        debug.notification("print mySTR " + mySTR)        
        
        utility.Wait(0.1)
        BodyGen.SetMorph(playerREF, true, "MuscularArms", aktBC_Keyword, mySTR)
        BodyGen.SetMorph(playerREF, true, "MuscularLegs", aktBC_Keyword, mySTR)
        BodyGen.SetMorph(playerREF, true, "Muscular Body", aktBC_Keyword, mySTR)
        BodyGen.SetMorph(playerREF, true, "MuscularChest", aktBC_Keyword, mySTR)
        debug.notification("Morphs should have been set")
        utility.Wait(0.1)
        BodyGen.UpdateMorphs(playerREF)
        debug.notification("morphs should have updated")
        utility.Wait(0.1)
EndFunction 

 

 

 

 

The main issue that i can tell based on my debug notifs, is playerREF.getvalue(Strength) seems to be returning 0? but i'm really not sure why.

 

 

 

 

Edited by AKawaiiTent
figured it out
Link to comment
  • AKawaiiTent changed the title to trying to have a script call the player characters special stats. (SOLVED!)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use