Kasdar Posted May 16, 2011 Share Posted May 16, 2011 (edited) Ok I figured out my problem, however if anyone can tell me how to get a perk script to recognise and change variables I would be interested in knowing how. Edited May 16, 2011 by Kasdar Link to comment Share on other sites More sharing options...
davidlallen Posted May 16, 2011 Share Posted May 16, 2011 You have to give us a little more information. Perk scripts are not any different from other scripts; you can access variables the same way. What specific script did you write, and what specific problem do you have? Link to comment Share on other sites More sharing options...
Kasdar Posted May 16, 2011 Author Share Posted May 16, 2011 Short Rand100 Short UnlockChance If Player.GetItemCount Lockpick ==0 ShowMessage KasdarsNoLockpickMsg EndIf If Player.GetItemCount Lockpick >= 1 Set Rand100 to (1 + GetRandomPercent) Set UnlockChance to (50 - (LockLevel) + (Player.GetAV Lockpick) + (2 * (Player.GetAV Luck))) If UnlockChance > 95 Set UnlockChance to 95 Endif If UnlockChance >= Rand100 unlock activate player Else Player.RemoveItem Lockpick 1 ShowMessage KasdarsLockpickMsg EndIf EndIf This is the code that doesnt work. it always succeeds I even attepted to replace my formula and set UnlockChance to 0 to force a failure but it still succeeded/ thats when I went with the next code, eliminating the varriables.I manually set the lock level for each difficulty. If Player.GetItemCount Lockpick ==0 ShowMessage KasdarsNoLockpickMsg EndIf If Player.GetItemCount Lockpick >= 1 If (50 -(LockLevel) + (Player.GetAV Lockpick) + (2 * (Player.GetAV Luck))) >= (1+ GetRandomPercent) unlock activate player Else Player.RemoveItem Lockpick 1 ShowMessage KasdarsLockpickMsg EndIf EndIf This is the only way I could get it to work. Link to comment Share on other sites More sharing options...
rickerhk Posted May 16, 2011 Share Posted May 16, 2011 You have to define the variables in a quest script. You can't define variables in a result script. So just create a dummy quest with a script on it and reference the variables that way. The quest doesn't even need to be running. Link to comment Share on other sites More sharing options...
Recommended Posts