StaticHex

Member
StaticHex submitted a new resource:

Skill Increase Book - Gives a permanent skill increase between 0.1% and 0.5% when used

A book which grants the user a permanent increase in a skill of their choice. The bonus applied is between 0.1% and 0.5%. This would make a good reward item or rare drop. Could also be a nice addition to inscription. Anyway hope everyone enjoys this and feel free to edit as needed.

~ StaticHex

Read more about this resource...
 
StaticHex updated Skill Increase Book with a new update entry:

Implemented check for skill caps

  • Skill book now hides any skills which are maxed out (so players can't increase skills past the server cap)
  • If the bonus applied would push a player's skill over the cap, that skill is simply increased to the cap instead

Special thanks to the member who emailed me and brought this to my attention and I hope everyone who downloaded it continues to enjoy it.

Read the rest of this update entry...
 
I love what you have here!

I added it to the Definscription menu and everything works great! The only thing is that the name shows up "blank" in the crafting menu. here is what I did to try and correct it, but it still shows up blank, but can still be crafted.
Screenshot_2.png

So I have everything working and it is [constructable]. Here is what I did not get this to work inside SkillBook.cs

public override int LabelNumber => 1101453; // SkillBook

public SkillBook()
: base(0xEFA)
{
Weight = 3.0;
Name = "Skill Increase Book";
Hue = 0xA33;


This is how I added it into DefInscription.cs


//SkillBook
AddCraft(typeof(SkillBook), 1044294, 1101453, 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(DreadHornMane), 1032682, 5, 1044253);
AddRes(index, typeof(WoodPulp), 1113136, 10, 1113289);
AddRes(index, typeof(Beeswax), 1025154, 5, "You do not have enough beeswax.");


Not sure why this would not work.
 
Glad you're enjoying the book, I think I found the problem

public override int LabelNumber => 1101453; // SkillBook


//SkillBook
AddCraft(typeof(SkillBook), 1044294, 1101453, 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);

The problem is these 2 lines right here. So the labels used for the other options in the skill book menu aren't just arbitrary numbers, they actually aren't numbers at all. If you look up the documentation for the AddCraft function; the definition looks like this:
C#:
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount)

So what you want is a TextDefinition object not just an integer, because under the hood what's going on is that integer is being used to create a new TextDefinition object. That being said; TextDefinition has a constructor which takes in a string vs. an integer so changing the description in DefInscription.cs to:
C#:
AddCraft(typeof(SkillBook), 1044294 , "Skill Increase Book", 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
should fix your problem. Additionally, you can remove the labelNumber option from skillbook unless you're using it for something else.

I hope this helps and let me know if it doesn't fix the problem

EDIT: Accidentally clipped off one of my code tags the first time
EDIT2: Posted the wrong field edited (not a morning person)
 
Last edited:
Glad you're enjoying the book, I think I found the problem



The problem is these 2 lines right here. So the labels used for the other options in the skill book menu aren't just arbitrary numbers, they actually aren't numbers at all. If you look up the documentation for the AddCraft function; the definition looks like this:
C#:
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount)

So what you want is a TextDefinition object not just an integer, because under the hood what's going on is that integer is being used to create a new TextDefinition object. That being said; TextDefinition has a constructor which takes in a string vs. an integer so changing the description in DefInscription.cs to:
C#:
AddCraft(typeof(SkillBook), 1044294 , "Skill Increase Book", 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
should fix your problem. Additionally, you can remove the labelNumber option from skillbook unless you're using it for something else.

I hope this helps and let me know if it doesn't fix the problem

EDIT: Accidentally clipped off one of my code tags the first time
EDIT2: Posted the wrong field edited (not a morning person)


Still does the same thing. Shows blank on the craft menu gump
 
That is interesting, did you end up removing the label or do you still have that line defined in SkillBook.cs? The reason I ask is I copy and pasted your block of code and swapped out the numeric label for the text I posted above and when I load my server and check the inscription menu I see this:

1597435983268.png

To eliminate any ambiguity on what I did; here is the exact section of my DefInscription.cs line for line (with surrounding entries).

C#:
index = AddCraft(typeof(RunedPrism), 1044294, 1073465, 45.0, 95.0, typeof(BlankScroll), 1044377, 1, 1044378);
AddRes(index, typeof(SpidersSilk), 1044360, 1, 1044253);
AddRes(index, typeof(BlackPearl), 1044353, 1, 1044253);
AddRes(index, typeof(HollowPrism), 1072895, 1, 1044253);
ForceNonExceptional(index);

// SkillBook
AddCraft(typeof(SkillBook), 1044294, "Skill Increase Book", 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(DreadHornMane), 1032682, 5, 1044253);
AddRes(index, typeof(WoodPulp), 1113136, 10, 1113289);
AddRes(index, typeof(Beeswax), 1025154, 5, "You do not have enough beeswax.");

// Runebook
index = AddCraft(typeof(Runebook), 1044294, 1041267, 45.0, 95.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(RecallScroll), 1044445, 1, 1044253);
AddRes(index, typeof(GateTravelScroll), 1044446, 1, 1044253);

So if your code looks the same, something is not as it seems. If you still have that label line in the skill book I would try to comment it out and see if that fixes it and if it does remove it. If you did remove the label is there anything else about the script you changed other than what you posted initially?
 
That is interesting, did you end up removing the label or do you still have that line defined in SkillBook.cs? The reason I ask is I copy and pasted your block of code and swapped out the numeric label for the text I posted above and when I load my server and check the inscription menu I see this:

View attachment 16433

To eliminate any ambiguity on what I did; here is the exact section of my DefInscription.cs line for line (with surrounding entries).

C#:
index = AddCraft(typeof(RunedPrism), 1044294, 1073465, 45.0, 95.0, typeof(BlankScroll), 1044377, 1, 1044378);
AddRes(index, typeof(SpidersSilk), 1044360, 1, 1044253);
AddRes(index, typeof(BlackPearl), 1044353, 1, 1044253);
AddRes(index, typeof(HollowPrism), 1072895, 1, 1044253);
ForceNonExceptional(index);

// SkillBook
AddCraft(typeof(SkillBook), 1044294, "Skill Increase Book", 85.0, 125.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(DreadHornMane), 1032682, 5, 1044253);
AddRes(index, typeof(WoodPulp), 1113136, 10, 1113289);
AddRes(index, typeof(Beeswax), 1025154, 5, "You do not have enough beeswax.");

// Runebook
index = AddCraft(typeof(Runebook), 1044294, 1041267, 45.0, 95.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(RecallScroll), 1044445, 1, 1044253);
AddRes(index, typeof(GateTravelScroll), 1044446, 1, 1044253);

So if your code looks the same, something is not as it seems. If you still have that label line in the skill book I would try to comment it out and see if that fixes it and if it does remove it. If you did remove the label is there anything else about the script you changed other than what you posted initially?


HAHA! I am dumb. I took your fix and added it all to the defcarpentry instead of definscription.cs lol

sorry bro, your fix was correct, just had to get my head out of my ass ;p
This script is flawless and works perfect on the new patch :) Thank you for this amazing piece of art :)
 
HAHA! I am dumb. I took your fix and added it all to the defcarpentry instead of definscription.cs lol

sorry bro, your fix was correct, just had to get my head out of my ass ;p
This script is flawless and works perfect on the new patch :) Thank you for this amazing piece of art :)

Haha that totally sounds like something I would do, glad you got it working and really glad you're enjoying it :)
 
I open the book but it is empty does not let me pick anything did i do something wrong?
I am new to this so trying to learn.
 
I open the book but it is empty does not let me pick anything did i do something wrong?
I am new to this so trying to learn.

Well, the first things that I'd need to know is
1. Server Software (RunUO or ServUO). Note that this script is for ServUO so if you're using RunUO I don't think it will work.
2. What version of ServUO you're running
3. What Ultima Online client you're using
4. Do any error/warning messages (these should be red and yellow) pop up when you start your server and do any mention the skill book script?

Let's start with answering these questions and we can work from there
 
ServUO
Publish 54
Classic OSI newest patch
No errors nothing script works just fine but when i open the book its completely blank.
 
ServUO
Publish 54
Classic OSI newest patch
No errors nothing script works just fine but when i open the book its completely blank.

Ok great, thanks so much for providing info. I think I know what's going on here but I want to confirm before I post an updated version of the script so one last question.

Did you use any commands or items to set all your skills to the maximum? I.e. are all your skills capped out?
 
Not maximum only gm level 100.0 but even with having them able to go to 120 with a powerscroll it is completely invisible if i lower the skills below 100 i can see the book... But at 100 everything is disappeared.

thank you for your reply didn't know if maybe i was just doing something wrong?
 
StaticHex updated Skill Increase Book with a new update entry:

v1.03 Changelog

  • Removed the ability to open the book if you don't have any skills you can increase (before would just display an empty book which was confusing)
  • Added a capBonus variable to the script which can be used to allow the user to increase skills past the cap (more specifically, allows the user to change this in a single place vs. having to hunt down every instance of cap in the entire script).

Read the rest of this update entry...
Post automatically merged:

Not maximum only gm level 100.0 but even with having them able to go to 120 with a powerscroll it is completely invisible if i lower the skills below 100 i can see the book... But at 100 everything is disappeared.

thank you for your reply didn't know if maybe i was just doing something wrong?

Ok I was correct in what I thought the problem was. So, this isn't a bug and you aren't doing anything wrong. So the skill max is 120 but that's different than the skill cap which is the natural number a skill stops increasing at (minus things like scroll bonuses and such). That is the number I'm using to stop increasing skills at.

Additionally, I made the script automatically filter out skills which are already at/above the detected cap; because why display skills you can't increase anyway? That's a waste of everyone's time.

Now, here's where I messed up. I didn't put a check in to see if the user had GM'd all skills i.e. I never checked for the case where there are no skills to be able to increase. This is very confusing. Additionally, it occurred to me that users may want to allow their users to increase their skills past the cap (to account for things like power scrolls or whatever else).

So, I just pushed a new release which has the changes mentioned above. Give that a try and see if that doesn't fix your problems. (Note: to get it to show skills you'll need to set the variable "capBonus" to something other than 0, but once you do that you should see skills. It should also not let you open the book anymore if there are no skills you increase. Anyway, hope this fixes your issue and let me know if it doesn't and/or you find anything else.
 
Last edited:
StaticHex updated Skill Increase Book with a new update entry:

v1.03 Changelog
Read the rest of this update entry...

Post automatically merged:



Ok I was correct in what I thought the problem was. So, this isn't a bug and you aren't doing anything wrong. So the skill max is 120 but that's different than the skill cap which is the natural number a skill stops increasing at (minus things like scroll bonuses and such). That is the number I'm using to stop increasing skills at.

Additionally, I made the script automatically filter out skills which are already at/above the detected cap; because why display skills you can't increase anyway? That's a waste of everyone's time.

Now, here's where I messed up. I didn't put a check in to see if the user had GM'd all skills i.e. I never checked for the case where there are no skills to be able to increase. This is very confusing. Additionally, it occurred to me that users may want to allow their users to increase their skills past the cap (to account for things like power scrolls or whatever else).

So, I just pushed a new release which has the changes mentioned above. Give that a try and see if that doesn't fix your problems. (Note: to get it to show skills you'll need to set the variable "capBonus" to something other than 0, but once you do that you should see skills. It should also not let you open the book anymore if there are no skills you increase. Anyway, hope this fixes your issue and let me know if it doesn't and/or you find anything else.

So far from my testing i seem to found a bug with having 120 mining an my skill being at 100 i open the book and then close out of it per say accidentally then go to reopen it opens up as a blank book.. it seems to do it with all skills not just mining i just used that as an example.

Other then that i have not ran into any problems.
 
So far from my testing i seem to found a bug with having 120 mining an my skill being at 100 i open the book and then close out of it per say accidentally then go to reopen it opens up as a blank book.. it seems to do it with all skills not just mining i just used that as an example.

Other then that i have not ran into any problems.

Sorry, trying to understand. You have 120 in mining and your skill cap is 100, You open the book, (skills are all there at this point), then close the book without picking a skill and when you reopen it, it's empty? Is this correct? Also what are you setting capBonus to?

I tried opening the book, closing it by right clicking, and then opening it again but I don't see the behavior you're talking about. Let me know if I missed anything above or if there's something you did that you notice I didn't do.
 
yes that is exactly what is happening.

Here is a giff of what is happening.


Per say if i am a player i open the book to see what it is then close it drop it in per say a chest this is just an example it brakes the book gump until the shards restart... Then you can repeat the same bug.
 
yes that is exactly what is happening.

Here is a giff of what is happening.


Per say if i am a player i open the book to see what it is then close it drop it in per say a chest this is just an example it brakes the book gump until the shards restart... Then you can repeat the same bug.

Ah, thanks for that gif that was wonderful. So I was able to find the problem, it wasn't actually just when closing the book it was that any time the gump was reloaded it would clip off 2 entries so before long you end up with an empty book.

The problem was in the GetSkills function. I was using num_skills to get all the "valid skills" (skills less than the cap + the bonus) but I forgot that I update that number and so it progressively grabs fewer and fewer skills. I changed it to just loop over the server defined list of skills instead and everything appears to be working now. Will update the version shortly; good catch and let me know if you find anything else :)
 
Ah, thanks for that gif that was wonderful. So I was able to find the problem, it wasn't actually just when closing the book it was that any time the gump was reloaded it would clip off 2 entries so before long you end up with an empty book.

The problem was in the GetSkills function. I was using num_skills to get all the "valid skills" (skills less than the cap + the bonus) but I forgot that I update that number and so it progressively grabs fewer and fewer skills. I changed it to just loop over the server defined list of skills instead and everything appears to be working now. Will update the version shortly; good catch and let me know if you find anything else :)

your welcome i try i am new to most of this but trying to learn as much as i can by testing things looking at changes in scripts reading them to see how they all function etc.

This has a steep learning curve but i am willing to give it a shot and learn as much as i can from this experience as i am having fun every step of the way!
Thank you for your time and quick fixes if i find anything else i will be sure to let you and post here.
 
Would there be a way to remove some skills like chivalry?
I think you can already do that using the in game skills gump I know at least you used to by opening it up and clicking the up arrow next to the skill name 2x so that it is a down arrow
Post automatically merged:

Ok now the only problem is it will let you increase all skills even if you didn't use a power scroll up to 120!

That is correct. This script doesn't really do anything with power scrolls currently and just goes off the base skill cap and allows you to set an optional limit past the skill cap. I'll play around with power scrolls this weekend although looking at the script it's interesting that it's not picking up skills increased with power scrolls as it does look like they increase the skill cap vs. setting a separate value like I initially thought. In any case; will keep you posted.
 
Last edited:
I think you can already do that using the in game skills gump I know at least you used to by opening it up and clicking the up arrow next to the skill name 2x so that it is a down arrow
Post automatically merged:



That is correct. This script doesn't really do anything with power scrolls currently and just goes off the base skill cap and allows you to set an optional limit past the skill cap. I'll play around with power scrolls this weekend although looking at the script it's interesting that it's not picking up skills increased with power scrolls as it does look like they increase the skill cap vs. setting a separate value like I initially thought. In any case; will keep you posted.

Well I meant so players wouldnt waste it on unused skills :p (Server that doesnt use chivalry but thats in this era)
 
Well I meant so players wouldnt waste it on unused skills :p (Server that doesnt use chivalry but thats in this era)

Ah ok sorry about that I misread. So far as skills, the book pulls it's skills from Scripts/Commands/Skills.cs directly so as long as you remove Chivalry from the SkillName enum in that file it should prevent the script from grabbing it.

I could certainly add a skill blacklist; however if a skill isn't going to be used it seems like it would just be better to remove it from the skill list in general.

I am open to suggestion though, any thoughts on the above?
Post automatically merged:

Also @Dallas you might want to set the capBonus to 0 and see if the fix I implemented yesterday fixed the power scroll issue. I just tested a power scroll and my carpentry is showing up even though it's at 100. It could be that the other bug I fixed regarding it grabbing the wrong number of skills was removing Carpentry. Let me know if still doesn't work.
Post automatically merged:

your welcome i try i am new to most of this but trying to learn as much as i can by testing things looking at changes in scripts reading them to see how they all function etc.

This has a steep learning curve but i am willing to give it a shot and learn as much as i can from this experience as i am having fun every step of the way!
Thank you for your time and quick fixes if i find anything else i will be sure to let you and post here.

Yeah, one of the hardest things about programming is trying to learn how to use code you didn't write. There's a command to generate documentation which if you haven't run it already can be really useful.
 
Last edited:
Ah ok sorry about that I misread. So far as skills, the book pulls it's skills from Scripts/Commands/Skills.cs directly so as long as you remove Chivalry from the SkillName enum in that file it should prevent the script from grabbing it.

I could certainly add a skill blacklist; however if a skill isn't going to be used it seems like it would just be better to remove it from the skill list in general.

I am open to suggestion though, any thoughts on the above?
Post automatically merged:

Also @Dallas you might want to set the capBonus to 0 and see if the fix I implemented yesterday fixed the power scroll issue. I just tested a power scroll and my carpentry is showing up even though it's at 100. It could be that the other bug I fixed regarding it grabbing the wrong number of skills was removing Carpentry. Let me know if still doesn't work.
Post automatically merged:



Yeah, one of the hardest things about programming is trying to learn how to use code you didn't write. There's a command to generate documentation which if you haven't run it already can be really useful.

Not sure if i am understanding you correctly before you made the change it would not pop up any skill but mining as i had it able to increase to 120 after using a powerscroll.

Now it does not matter the skill if you didn't use a powerscroll you can keep increasing your skills all of them to be 120 so in other words it pretty much kills off the purpose of powerscrolls i hope what i am saying makes sinces.
 
Not sure if i am understanding you correctly before you made the change it would not pop up any skill but mining as i had it able to increase to 120 after using a powerscroll.

Now it does not matter the skill if you didn't use a powerscroll you can keep increasing your skills all of them to be 120 so in other words it pretty much kills off the purpose of powerscrolls i hope what i am saying makes sinces.

The reply you quoted was actually directed at another user. I'm assuming you meant the other one where I mentioned your name. Or possibly the one where I was talking about the capBonus variable.

So the cap bonus does absolutely nothing with power scrolls at all. All the cap bonus variable does is allow you to increment your skill X points past the cap and impacts all skills.

What I was saying in the post which mentioned your name was that the original problem with power scrolls may have been fixed when I fixed the bug the other day. To verify this; you would need to set capBonus to 0.0 and then reload the server to check if you're able to see mining (pending mining is still < 120)
 
The reply you quoted was actually directed at another user. I'm assuming you meant the other one where I mentioned your name. Or possibly the one where I was talking about the capBonus variable.

So the cap bonus does absolutely nothing with power scrolls at all. All the cap bonus variable does is allow you to increment your skill X points past the cap and impacts all skills.

What I was saying in the post which mentioned your name was that the original problem with power scrolls may have been fixed when I fixed the bug the other day. To verify this; you would need to set capBonus to 0.0 and then reload the server to check if you're able to see mining (pending mining is still < 120)

maybe this will be more helpful...
 
I think we may be talking past each other.

From what I understand, your concern is that adjusting the variable capBonus allows you to adjust ANY skill past the skill cap. Not just the ones power scrolls have raised.

This is the correct behavior for that variable. That is what it is supposed to do. This is not a bug.

When you use a power scroll, it adjusts the cap for that particular skill and so you don't need to set the capBonus variable. Set capBonus to 0.0 and the problem in the gif above should go away.
 
I think we may be talking past each other.

From what I understand, your concern is that adjusting the variable capBonus allows you to adjust ANY skill past the skill cap. Not just the ones power scrolls have raised.

This is the correct behavior for that variable. That is what it is supposed to do. This is not a bug.

When you use a power scroll, it adjusts the cap for that particular skill and so you don't need to set the capBonus variable. Set capBonus to 0.0 and the problem in the gif above should go away.

I am sorry if that is the case just trying to understand code a little better all around...
So i went ahead and changed this around.

public static readonly float capBonus = 0.0f;

Should do the trick will test it and let you know!
 
I am sorry if that is the case just trying to understand code a little better all around...
So i went ahead and changed this around.

public static readonly float capBonus = 0.0f;

Should do the trick will test it and let you know!

Also no worries, and just to clarify I'm not mad or annoyed at you or anything; I apologize if I came off that way. Usually at work when we have these kinds of problems we usually just call each other just because sometimes it can be so hard to get on the same page with one another over email or even on microsoft teams; that's what I meant with the talking past each other. In any case please let me know the result of that test.

EDIT: Added a bit more clarification
 
Also no worries, and just to clarify I'm not mad or annoyed at you or anything; I apologize if I came off that way. Usually at work when we have these kinds of problems we usually just call each other just because sometimes it can be so hard to get on the same page with one another over email or even on microsoft teams; that's what I meant with the talking past each other. In any case please let me know the result of that test.

EDIT: Added a bit more clarification

Oh no i just wanted to make sure i didn't offend you haha, all is good!
But yes will get to testing this if you have discord you can add me.
sirfrak#4947
 

Active Shards

Donations

Total amount
$80.00
Goal
$1,000.00
Back