Jump to content

XLib and XSkills


Xandu

Recommended Posts

On 7/23/2024 at 5:18 PM, Tiver said:

temporal stability is enabled.  It happens every single time and while that log includes all the mods, I thought it might be a specific one so I tested out starting up with just one of each, but it crashed the client in every single combination.

I'm all set for now with my own hack of the dll to add the try/catch but I'd prefer to not have to modify every new release.  If you can suggest code that would log details, that wasn't something I was able to easily find for the game's libraries, I could add logging to see what specifically is null and if the error goes away after the client has been connected for a bit.

You could use something like this to log it:

if (TemporalAffected == null)
	entity.Api.Logger.Log(EnumLogType.Error, "TemporalAffected is null!");
if (entity.Stats == null)
	entity.Api.Logger.Log(EnumLogType.Error, "Entity.Stats is null!");

You can also use this newly created repository: https://github.com/Xandu93/VSMods. It might be helpful in your testing.

27 minutes ago, Neuro_Mancer said:

Hey @Xandu as requested I will put bug reports here.

The mod Vies Blocks adds Storage Beds where you can sleep for 9.5 hours.

Sadly, it does give me no well rested effect whatsoever. I thought it would increase the duration, but now I have no duration ^^.

I had an Oak Storage Bed with cloth wool and cloth in the cloth slot. (This was a lot of cloth in one sentence)

You may not know this mod so I link it here: https://mods.vintagestory.at/viesblocks

 

The mod seems to implement their own bed class and bed entity class. So they don't use the base game code and I would need to look at their source code to see how they implemented it.

Link to comment
Share on other sites

@Xandu Okay should I ask the author for the source code or send it to you via discord or something?

 

Also I wanted to ask if it is possible to enable the cat eyes skill at level one but with a smaller benefit, without coding only Json edit.

That means I want to have cat eyes one with values 2 and 2000 at level one available. (and what does the 2000 mean?)

and then cat eyes 2 and 3 (the default ones at level 8 ).

Link to comment
Share on other sites

On 7/24/2024 at 2:09 PM, Xandu said:

You could use something like this to log it:

if (TemporalAffected == null)
	entity.Api.Logger.Log(EnumLogType.Error, "TemporalAffected is null!");
if (entity.Stats == null)
	entity.Api.Logger.Log(EnumLogType.Error, "Entity.Stats is null!");

You can also use this newly created repository: https://github.com/Xandu93/VSMods. It might be helpful in your testing.

The mod seems to implement their own bed class and bed entity class. So they don't use the base game code and I would need to look at their source code to see how they implemented it.

Many thanks for the repository, it was very helpful.  I'm not 100% certain yet but I'm fairly sure this is being caused by graceTimer, it's defaulting to 3 days when unspecified in server config when I bring up a new server and this means Temporal Stability is disabled for those first 3 days but the function doesn't check this.  This explains why established servers I was having no issue, but whenever I recreated the world I'd start seeing it.  If I get some time I'll attempt to add logic to check for this and avoid the issue.

Link to comment
Share on other sites

Hi

I'm still on 1.18.15 playing with quite a big modlist, for over 200 hours everything went fine, then after closing the game earlier today and trying to open it again later, my pc runs out of RAM (32GB) while loading the world endlessly.

The most likely culprit seems to be the long list (about 55million lines) of fatal errors in xskills all similar to this, bloating the size of 2 of the log files to 7.8GB:each

Quote

30.7.2024 23:15:08 [Fatal] System.NullReferenceException: Object reference not set to an instance of an object.
   at XSkills.CookingUtil.GetCookingTimeMultiplier(BlockEntity entity)
   at XSkills.BlockEntityFirepitPatch.maxCookingTimePostfix(BlockEntityFirepit __instance, Single& __result)
   at Vintagestory.GameContent.BlockEntityFirepit.maxCookingTime_Patch1(BlockEntityFirepit this)
   at Vintagestory.GameContent.BlockEntityFirepit.OnBurnTick(Single dt) in C:\Users\Tyron\Documents\vintagestory\game\VSSurvivalMod\BlockEntity\Firepit\BEFirepit.cs:line 278
   at Vintagestory.Common.EventManager.TriggerGameTick(Int64 ellapsedMilliseconds, IWorldAccessor world) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Common\EventManager.cs:line 84
   at Vintagestory.Server.CoreServerEventManager.TriggerGameTick(Int64 ellapsedMilliseconds, IWorldAccessor world) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Server\ServerEventManager.cs:line 122
   at Vintagestory.Server.ServerMain.Process() in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Server\ServerMain.cs:line 819
30.7.2024 23:15:08 [Fatal] System.NullReferenceException: Object reference not set to an instance of an object.

 

Do you have an idea what is happening here and how to resolve it?

1.18.15 xskills fatal error log folder.png

Link to comment
Share on other sites

  • 2 weeks later...
On 7/25/2024 at 10:27 PM, Neuro_Mancer said:

@Xandu Okay should I ask the author for the source code or send it to you via discord or something?

 

Also I wanted to ask if it is possible to enable the cat eyes skill at level one but with a smaller benefit, without coding only Json edit.

That means I want to have cat eyes one with values 2 and 2000 at level one available. (and what does the 2000 mean?)

and then cat eyes 2 and 3 (the default ones at level 8 ).

I don't know if this will help. I could also use dnspy or something like that but I try to avoid that.

Yes, you can do this. Just change the cateyes config entry. You can set the "minLevel" value to 1 and change the 6 to something like 2 or just add the 2.  The 2000 is the adaptation time in milliseconds. If you add new values you also have to adjust the "maxTier" value. So it would look like something like this: 
 

{
      "name": "cateyes",
      "id": 17,
      "maxTier": 3,
      "minLevel": 1,
      "enabled": true,
      "values": [
        2,
        2000
        6,
        2000,
        8,
        2000
      ]
    }

If you want the higher tiers only be available at level 8 you also have to look at requirements in assets/xskills/skills folder.

 

On 7/29/2024 at 4:27 PM, Tiver said:

Many thanks for the repository, it was very helpful.  I'm not 100% certain yet but I'm fairly sure this is being caused by graceTimer, it's defaulting to 3 days when unspecified in server config when I bring up a new server and this means Temporal Stability is disabled for those first 3 days but the function doesn't check this.  This explains why established servers I was having no issue, but whenever I recreated the world I'd start seeing it.  If I get some time I'll attempt to add logic to check for this and avoid the issue.

I could not reproduce this issue even with the grace timer in a new world. But I added some checks that hopefully fix this issue.

On 7/31/2024 at 11:36 PM, Hal13 said:

okay after using repair mode the world loads again without the issue.

I am happy that you could fix the issue. I can not provide support for older mod versions. But it looked like a broken firepit entity. So if this happen again try to destroy your fire pits and build new ones.

Link to comment
Share on other sites

Hi there! 

Recent Vintnarian and I am really enjoying this mod, using it with a few friends and I enjoy that it's already making us all specialise in our own niches and causing further cooperation. 

However, as the dedicated "forester" of the group, I realised I was not getting EXP as much as my other teammates, it turns out that some of the modded trees/biomes that we're in, the fully grown logs don't give any EXP. 

The mods in question are from Tentharchitech, primarily his Floral Zone regions, I was wondering if it was as simple as adding item codes to part of the forestry jsons or if this required a little more work? Any help would be deeply appreciated. Thank you!

https://mods.vintagestory.at/floralzonesneozeylandicregion

Link to comment
Share on other sites

On 5/11/2024 at 2:41 PM, Kinross07 said:

Apologies if this has been addressed elsewhere, but I tried using the "Search in topic" and couldn't find anything. I've started a new world and have found a couple of the XP books, but I can't for the life of me work out how to use them (I've tried every interactable key I can think of and looked in the O menu in case there's something there). I admit I'm still relatively new to the game, but if anyone can help it would be greatly appreciated to free up these inventory slots :P

 

Edit literally 20 seconds later - Accidentally ate a book and now I feel very dumb, despite the exp it granted.

Literally just had exact same experience. Maybe we can add a tooltip to hold right mouse to use book. 

Link to comment
Share on other sites

Really like this mod and it seems very well balanced.

One idea, maybe some perks either for combat or a new tree based on armour usage that could reduce the penalties associated with armour usage as you get more used to wearing it?

 

Link to comment
Share on other sites

hey, we noticed a material duplication with smelter skill, when used with A Culinary Artillery, and i was told that i should post it here. The cauldrons from ACA can be broken down into 5 ingots, and someone on our server mentioned only needing 3 ingots worth of copper to make one. there is also a bug with the maths it seems regarding the smelter skill.

"Tree_Sentinel: I just hit metalworking 25 and grabbed smelter 6/9 and I'm using 300 units of copper to pour cauldrons now"

"Tree_Sentinel: Level 6 says uses 35% less metal to fill a mold"
"Tree_Sentinel: Normal is 600."

"Tree_Sentinel: It should be 390"

 it's not a huge deal, but, wanted to notify regardless. we can manually remove the scrapping recipe on our end.

Link to comment
Share on other sites

9.9.2024 22:54:18 [Error] Exception thrown during OnTesselation() of block entity XSkills.XSkillsBlockEntitySapling@2047936/114/2047832. Block will probably not be rendered as intended.
9.9.2024 22:54:18 [Error] Exception: Object reference not set to an instance of an object.
at Vintagestory.Client.NoObf.ShapeTesselator.TesselateShape(Shape shapeBase, MeshData& modeldata, Vec3f wholeMeshRotation, Vec3f wholeMeshOffset, Single wholeMeshScale, TesselationMetaData meta) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 302
at Vintagestory.Client.NoObf.ShapeTesselator.TesselateShape(CollectibleObject collObj, Shape shape, MeshData& modeldata, Vec3f rotation, Nullable`1 quantityElements, String[] selectiveElements) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 193
at Vintagestory.GameContent.BlockEntitySapling.<>c__DisplayClass5_0.<get_dirtMoundMesh>b__0() in VSSurvivalMod\BlockEntity\BESapling.cs:line 39
at Vintagestory.GameContent.BlockEntitySapling.get_dirtMoundMesh() in VSSurvivalMod\BlockEntity\BESapling.cs:line 32
at Vintagestory.GameContent.BlockEntitySapling.OnTesselation(ITerrainMeshPool mesher, ITesselatorAPI tessThreadTesselator) in VSSurvivalMod\BlockEntity\BESapling.cs:line 243
at Vintagestory.Client.NoObf.JsonTesselator.Tesselate(TCTCache vars) in VintagestoryLib\Client\Render\Tesselation\ChunkTesselator\JsonTesselator.cs:line 152

 

what could cause this? getting quite a few of those in the "client-main"

Link to comment
Share on other sites

On 8/21/2024 at 8:46 AM, Pied Piper said:

Hi there! 

Recent Vintnarian and I am really enjoying this mod, using it with a few friends and I enjoy that it's already making us all specialise in our own niches and causing further cooperation. 

However, as the dedicated "forester" of the group, I realised I was not getting EXP as much as my other teammates, it turns out that some of the modded trees/biomes that we're in, the fully grown logs don't give any EXP. 

The mods in question are from Tentharchitech, primarily his Floral Zone regions, I was wondering if it was as simple as adding item codes to part of the forestry jsons or if this required a little more work? Any help would be deeply appreciated. Thank you!

https://mods.vintagestory.at/floralzonesneozeylandicregion

Hi, I don't know if I have already said it. But the next update will add compatibility with these mods.

 

On 8/23/2024 at 2:36 AM, Nol said:

i want to make a book seller how do i make custom books from your mod

 

Hi. You make a normal trader and your item stack should look something like this:
 

{
        "code": "xlib:skillbook-normal-darkgreen",
        "type": "item",
        "stacksize": 1,
        "stock": {
            "avg": 1,
            "var": 0
        },
        "price": {
            "avg": 20,
            "var": 0
        },
        "attributes": {
          "skill": "farming",
          "experience": 200.0
        }
},

If you delete the experience part the experience will be randomized in a specific range.

At the moment it will be randomized every time but this will be fixed with the next update.

On 8/25/2024 at 10:52 PM, Richard Quist said:

Literally just had exact same experience. Maybe we can add a tooltip to hold right mouse to use book. 

Holding right click is the default key for using items. It is the same for food. So I assumed it is not necessary.

On 8/26/2024 at 6:30 AM, Zxerre said:

I don't know how difficult it would be to implement, but a skill for aoe like 3x3 or vein mine or at least faster digging through charcoal pits would be really nice.

Something like this is on my to-do list.

On 9/1/2024 at 9:53 AM, Tacgnol said:

Really like this mod and it seems very well balanced.

One idea, maybe some perks either for combat or a new tree based on armour usage that could reduce the penalties associated with armour usage as you get more used to wearing it?

 

Something like this could be part of the combat skill but it is not so easy to implement.

On 9/3/2024 at 1:43 PM, Hexis said:

hey, we noticed a material duplication with smelter skill, when used with A Culinary Artillery, and i was told that i should post it here. The cauldrons from ACA can be broken down into 5 ingots, and someone on our server mentioned only needing 3 ingots worth of copper to make one. there is also a bug with the maths it seems regarding the smelter skill.

"Tree_Sentinel: I just hit metalworking 25 and grabbed smelter 6/9 and I'm using 300 units of copper to pour cauldrons now"

"Tree_Sentinel: Level 6 says uses 35% less metal to fill a mold"
"Tree_Sentinel: Normal is 600."

"Tree_Sentinel: It should be 390"

 it's not a huge deal, but, wanted to notify regardless. we can manually remove the scrapping recipe on our end.

It seems like you are using custom values for your smelter ability. This can cause issues when you can recycle items since it is balanced for the default values. The math for the smelter ability is a little bit special and does not work correctly for every value. This has technical reasons. The ability does not really reduce the amount of units you need but gives you extra units. The percentage value should be an integer divisor of 100.

On 9/10/2024 at 7:53 PM, NukoSan said:

9.9.2024 22:54:18 [Error] Exception thrown during OnTesselation() of block entity XSkills.XSkillsBlockEntitySapling@2047936/114/2047832. Block will probably not be rendered as intended.
9.9.2024 22:54:18 [Error] Exception: Object reference not set to an instance of an object.
at Vintagestory.Client.NoObf.ShapeTesselator.TesselateShape(Shape shapeBase, MeshData& modeldata, Vec3f wholeMeshRotation, Vec3f wholeMeshOffset, Single wholeMeshScale, TesselationMetaData meta) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 302
at Vintagestory.Client.NoObf.ShapeTesselator.TesselateShape(CollectibleObject collObj, Shape shape, MeshData& modeldata, Vec3f rotation, Nullable`1 quantityElements, String[] selectiveElements) in VintagestoryLib\Client\Render\Tesselation\ShapeTesselator.cs:line 193
at Vintagestory.GameContent.BlockEntitySapling.<>c__DisplayClass5_0.<get_dirtMoundMesh>b__0() in VSSurvivalMod\BlockEntity\BESapling.cs:line 39
at Vintagestory.GameContent.BlockEntitySapling.get_dirtMoundMesh() in VSSurvivalMod\BlockEntity\BESapling.cs:line 32
at Vintagestory.GameContent.BlockEntitySapling.OnTesselation(ITerrainMeshPool mesher, ITesselatorAPI tessThreadTesselator) in VSSurvivalMod\BlockEntity\BESapling.cs:line 243
at Vintagestory.Client.NoObf.JsonTesselator.Tesselate(TCTCache vars) in VintagestoryLib\Client\Render\Tesselation\ChunkTesselator\JsonTesselator.cs:line 152

 

what could cause this? getting quite a few of those in the "client-main"

Do you have mods that add new types of saplings/trees? You can try to delete the cache folder. This fixes some issues sometimes.

Link to comment
Share on other sites

1 hour ago, NukoSan said:

In the new world with the same mods - no problem 🙂 so must be something connected to the original world, different topic - will the Xskill cage work with any modded animals?

It would be interesting whether it happens with the old world and without xskills. It only works with some modded animals and with base game ones.  But you can make it work with other modded animals with some JSON-patching.

Link to comment
Share on other sites

1 hour ago, NukoSan said:

fancy giving us a crash course?

You have to make a simple mod or edit an existing one for this. Go to the assets/domain/patches folder or create it inside of the mod. Create a file within this folder with your patches. The name of the file does not matter. You can look at the "husbandry" file in the corresponding folder of the xskills mod to see how a patch should look like.

Link to comment
Share on other sites

1.20 pre2

 

Placing player at 125930,88053896677 146,79102391621115 130171,14587208236
21.9.2024 17:27:49 [Error] Exception: Field not found: 'Vintagestory.Common.InventoryPlayerBackPacks.backPackContents'.
   at XSkills.XSkillInventoryBackpack.get_Item(Int32 slotId)
   at Vintagestory.GameContent.EntityBehaviorPlayerInventory.OnTesselation(Shape& entityShape, String shapePathForLogging, Boolean& shapeIsCloned, String[]& willDeleteElements) in VSEssentials\Entity\Behavior\EntityBehaviorPlayerInventory.cs:line 78
   at Vintagestory.API.Common.Entities.Entity.OnTesselation(Shape& entityShape, String shapePathForLogging) in VintagestoryApi\Common\Entity\Entity.cs:line 1148
   at Vintagestory.API.Common.EntityPlayer.OnTesselation(Shape& entityShape, String shapePathForLogging) in VintagestoryApi\Common\Entity\EntityPlayer.cs:line 417
   at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 880
   at Vintagestory.API.Common.EntityAgent.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\EntityAgent.cs:line 567
   at Vintagestory.API.Common.EntityPlayer.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\EntityPlayer.cs:line 674
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 292
   at Vintagestory.Server.ServerSystemEntitySimulation.OnServerTick(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 163
   at Vintagestory.Server.ServerMain.Process() in VintagestoryLib\Server\ServerMain.cs:line 830
21.9.2024 17:27:50 [Error] Exception: Field not found: 'Vintagestory.Common.InventoryPlayerBackPacks.backPackContents'.
   at XSkills.XSkillInventoryBackpack.get_Item(Int32 slotId)
   at Vintagestory.API.Common.InventoryBase.GetEnumerator()+MoveNext() in VintagestoryApi\Common\Inventory\InventoryBase.cs:line 879
   at Vintagestory.API.Common.InventoryBase.ResolveBlocksOrItems() in VintagestoryApi\Common\Inventory\InventoryBase.cs:line 278
   at Vintagestory.API.Common.InventoryBase.AfterBlocksLoaded(IWorldAccessor world) in VintagestoryApi\Common\Inventory\InventoryBase.cs:line 270
   at Vintagestory.Common.InventoryPlayerBackPacks.AfterBlocksLoaded(IWorldAccessor world) in VintagestoryLib\Common\GameContent\Inventory\InventoryPlayerBackPacks.cs:line 42
   at Vintagestory.Server.ServerSystemInventory.OnPlayerJoin(ServerPlayer player) in VintagestoryLib\Server\Systems\Inventory.cs:line 198
   at Vintagestory.Server.ServerMain.HandleRequestJoin(Packet_Client packet, ConnectedClient client) in VintagestoryLib\Server\ServerGeneralPacketHandler.cs:line 61
   at Vintagestory.Server.ServerMain.HandleClientPacket(ConnectedClient client, Byte[] data) in VintagestoryLib\Server\ServerMainNetworking.cs:line 159
   at Vintagestory.Server.ServerMain.ProcessNetMessage(NetIncomingMessage msg, NetServer mainSocket) in VintagestoryLib\Server\ServerMainNetworking.cs:line 115

 

Link to comment
Share on other sites

Hello, I am on a server that has changed the default hunger rate value (50% from the 100%) I have notice that skills that change this value act strange. Nudist skill for example seems to revert the default back to 100% then reduce the value down based on the level of the skill (90%-80%). The ui will always display the default value as 100% unless changed by other factors like equipment, conditions, and skills. One person on the server has a hunger rate of 120% and their satiety drains slower than mine at 80%.

Is this something we can fix via configs?

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.