Jump to content

[Help] Script not acting as intended?


Anahuyu

Recommended Posts

On a bow, I add an ability to the player (thus able to use functions\events on the player).

The damage set on the bow is 7.
When the bow is fired by the player, the ability's script does some stuff, and compares it, adjusting the bow's damge afterwards.

 

Using weaponproperty.SetBaseDamage(7 * valueproperty as Int) seems to work for the first three increases.

 

if valueproperty is 2, displayed damage is 15

if valueproperty is 3, displayed damage is 23

 

After I have confirmed this is accurate, I set the value to 250 and then fire the bow until it passes the check to update the damage.

 

 

It should be around 1750 (7 * 250) but instead is just 194…

 

Am I missing something here? Is there something I can do to fix it?

-----------------------------------------------------------------

Also, in order to get SetBaseDamage() to do anything, I had to copy the SKSE script sources from Data\scripts\source to Data\source\scripts

-----------------------------------------------------------------

Update:

SkyUI only shows the leftmost three digits, looking at the bottom status bar reveals that I am doing 1889 and upwards based on my archery skill.

(I had reached level 2 in archery when I got checked and saw 194 on my weapon stat box.)

Edited by Anahuyu
Link to comment
Share on other sites

Regarding the moving of source scripts. When SSE came out for some reason Bethesda changed the default location for the source scripts. Some authors opted to adapt, other authors opted to change the entry in the INI file for the source scripts and re-arrange all the files to match original Skyrim locations. SKSE team did the later. It is no harm to actual game play, just confusing when wanting to work with script source files.

 

As far as the rest, I have no idea what could be going on. 7 * 2 = 14 not 15 so even at the beginning it appears to be screwed up in some way. Unless it is doing the math as ((7 * valueproperty) as Int). If that is how it is interpreting it, try doing it as (7 * (valueproperty as int)). If that changes the calculation, it may shed some light.

Link to comment
Share on other sites

As far as the rest, I have no idea what could be going on. 7 * 2 = 14 not 15 so even at the beginning it appears to be screwed up in some way. Unless it is doing the math as ((7 * valueproperty) as Int). If that is how it is interpreting it, try doing it as (7 * (valueproperty as int)). If that changes the calculation, it may shed some light.

Take into account that you can start with 15-35 skill points in Archery, and that even though the base damage is 7 in the CK, the displayed damage before even firing the bow once shows up as 8.

(7 * (valueproperty as int)) and ((7 * (valueproperty as int)) as int) both suffer the same, or similar bug\odd behaviour.

 

So… I'm kinda confused…

 

Pre-Post Edit:

It actually looks like an issue with SkyUI.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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