Current code dosnt fix jumping, and running. [resolved]

Locked
User avatar
Midknightprince
Posts: 1324
Joined: Fri Aug 11, 2017 6:51 am
Location: San Antonio TX
Contact:

Current code dosnt fix jumping, and running. [resolved]

Post by Midknightprince »

Jumping raises a random miscellaneous skill.
Running still does not go up.
Check out my YouTube Channel!

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Current code dosnt fix jumping, and running.

Post by Interkarma »

Allofich, more information on this for you.

It seems there's a namespace issue in PlayerEntity on line 162.

Code: Select all

TallySkill((short)Skills.Jumping, 1);
We want to be sending the value of the DFCareer.Skills enum, but instead the above TallySkill() is sending the current skill value from DaggerfallSkills class (DaggerfallEntity also has a property called Skills containing the same member names). This is why jumping raises a random value and throws an exception once array overflows.

This ties into my exception with a skillId of 50 in the other bug thread. My current jumping skill is 50. :)

My recommendation is to change TallySkill() to accept DFCareer.Skills in first param rather than an int. This ensures the param passed remains typesafe. You can then just cast it back to an int inside TallySkills() for purposes of accessing array.

I've sent a commit with this change now. I tried to touch as little as possible just to overcome this issue. This seems to have fixed issue with skill increments and my index out of range exception.

Please let me know if I've done anything wrong here. :)

User avatar
Midknightprince
Posts: 1324
Joined: Fri Aug 11, 2017 6:51 am
Location: San Antonio TX
Contact:

Re: Current code dosnt fix jumping, and running.

Post by Midknightprince »

Yep, fixed on my end.
Thanks :D
Check out my YouTube Channel!

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Current code dosnt fix jumping, and running.

Post by R.D. »

Thanks for checking that Interkarma. Coincidentally, the character I tested jumping with had a jumping skill of 3%, which matches the skillID of 3, so I mistakenly thought it was working.

Also, Midknightprince, sorry, I didn't notice you also mentioned running wasn't being tallied. That actually isn't implemented yet, because I'm not 100% sure how classic tallies it. I have a general idea, though, and I think I can probably approximate it, which I'll try to do before too long.

User avatar
Midknightprince
Posts: 1324
Joined: Fri Aug 11, 2017 6:51 am
Location: San Antonio TX
Contact:

Re: Current code dosnt fix jumping, and running.

Post by Midknightprince »

@R.D.
Np, glad I could help, and thank's for elaborating on that.
Keep up the great work :D
Check out my YouTube Channel!

Locked