Jump to content

GetActorValue?


Woverdude

Recommended Posts

So, I'm working on a script that will modify the UnarmedDamage Actor Value. I need to figure out how to get the value for the Actor value, though. I tried using the code from the CK wiki, but it isn't working.

 

The basic idea is that there are two variables: the UnarmedDamage AV and a Global Variable named Level.

 

I want to multiply the AV by (1 + [Level/20]).

 

Here is the code that I tried to use:

 

Scriptname UnarmedDamageMulti extends ObjectReference  
{Scales the Unarmed damage according to player's Unarmed level.}

GlobalVariable Property Level auto
int UD = Game.GetPlayer().GetActorValue("UnarmedDamage") as int

Event OnEffectStart(Actor akTarget, Actor akCaster)
Game.GetPlayer().SetActorValue("UnarmedDamage", UD*(1 + Level.GetValue()/20))
EndEvent

 

Please help? :smile:

Edited by Woverdude
Link to comment
Share on other sites

OnEffectStart is an event for active magic effects, while your script extends ObjectReference. It won't work. Also,

 

int UD = Game.GetPlayer().GetActorValue("UnarmedDamage") as int

 

should be put inside an event or function.

Link to comment
Share on other sites

Thank you for your help. The script works now. :smile:
Link to comment
Share on other sites

  • Recently Browsing   0 members

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