Alighieri00 Posted February 11, 2012 Share Posted February 11, 2012 So I wanted a script that adds +20 skill to TwoHanded tree. Seems simple. The wiki says to use the following: Function SetActorValue (string asValueName, float afValue) My script reads: Scriptname TwoHanded extends Perk Function SetPlayerValue (TwoHanded, 20) EndFunction And I get the following errors: (3,33): missing ID at ','(3,35): no viable alternative at input '20' I've tried just about every variation of this - SetActorValue (TwoHanded, 20), with and without commas, parentheses, I've tried 20.00, tried... well.. I've been trying for three hours now. Lil' help? Link to comment Share on other sites More sharing options...
jimhsu Posted February 11, 2012 Share Posted February 11, 2012 "TwoHanded" Link to comment Share on other sites More sharing options...
Alighieri00 Posted February 11, 2012 Author Share Posted February 11, 2012 "TwoHanded" :/ Tried it. Getting this error when I run that in the compiler: (3,24): mismatched input '"TwoHanded"' expecting RPAREN(0,0): Object reference not set to an instance of an object Link to comment Share on other sites More sharing options...
skizophrenic Posted February 11, 2012 Share Posted February 11, 2012 (edited) Game.GetPlayer().SetActorValue("TwoHanded", 20) Edit: Game.GetPlayer().ModActorValue("TwoHanded",20) is probably what you're looking for. Edited February 11, 2012 by skizophrenic Link to comment Share on other sites More sharing options...
Galacticat42 Posted February 11, 2012 Share Posted February 11, 2012 No, none of those... Perk isn't an extension option. You're looking to either extend Actor or Form. Link to comment Share on other sites More sharing options...
porroone Posted February 11, 2012 Share Posted February 11, 2012 Will nobody tell this poor guy that he needs to call the function inside an event ? This might help you, im not sure if its what you are trying to accomplish.. but at least it will show you the syntax. Scriptname MyScript extends ObjectReference Event OnEquipped(Actor akActor) Game.GetPlayer().SetPlayerValue(TwoHanded, 20) endEvent So when you equip the weapon it sets two handed to 20 Link to comment Share on other sites More sharing options...
nosisab Posted February 11, 2012 Share Posted February 11, 2012 (edited) Without looking further, are you sure want to set the actor value instead modifying it? As it is it actually changes the actor base value, what is persistent... could make furious someone who had let's say 80 points in TwoHanded... Unless you have a way to "return" the previous value you should not use SetAV but ModAV. Ahh, and since you are "getting" the actor, is ModActorValue you want and Not ModPlayerValue. Edit: You should have another event to remove the boost on unequip. But this is supposition, I don't really know what is your real purpose (as in what want to achieve, just I think dangerous changing base values in persistent way). Edited February 11, 2012 by nosisab Link to comment Share on other sites More sharing options...
porroone Posted February 11, 2012 Share Posted February 11, 2012 Without looking further, are you sure want to set the actor value instead modifying it? As it is it actually changes the actor base value, what is persistent... could make furious someone who had let's say 80 points in TwoHanded... Unless you have a way to "return" the previous value you should not use SetAV but ModAV. Ahh, and since you are "getting" the actor, is ModActorValue you want and Not ModPlayerValue. Edit: You should have another event to remove the boost on unequip. But this is supposition, I don't really know what is your real purpose (as in what want to achieve, just I think dangerous changing base values in persistent way).Couldnt agree more, I just didnt use those modifiers and the author doesnt explain well what he wants to do, I was just showing the syntax, but yes if you want that on equipping the sword you better use modav, which basically what it does is to plus the value to the current skill (for example modav 20 with 60 sword skill will result in 80, and if you use -20 it will go back to 60). Link to comment Share on other sites More sharing options...
Recommended Posts