Jump to content

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


Recommended Posts

Posted

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.

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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