Skip to content

Commit

Permalink
Update for smol characters
Browse files Browse the repository at this point in the history
Fixed bug when some animations had incorrect position, for instance if small character does a dive, it visually falls under the ground

Settings were reworked so we don't parse them every time we use them

Added global mod settings

Added console commands to reload character settings and global settings

Done an attempt to make VRM sharing work. We can't use ZDO since it just dies if the data size is too big. So were used RPCs, but they don't trigger. If we resolve that issue, we may finally make VRM sharing work

Refactored ValheimVRM.cs, player awake patch was splitted into some separate functions for registering and attaching VRM to player. Also was reworked the way we store VRM (better suited for sharing)

Next parameters may be modified via settings now:
* Character collision size
* Equipment scale
* Interaction distance scale
* Attack distance scale
* Melee damage scale
* Ranged damage scale
* Swim depth scale
* Swim speed scale
* Base health amount scale
* Health amount gained from food scale
* Base stamina amount scale
* Stamina amount gained from scale
* Weight limit scale
* Movement speed scale
* Jump force scale

Next animations now can be modified by adding offsets:
* Sitting on chair
* Sitting on throne
* Sitting on ship
* Holding mastt
* Holding dragon
* Sitting on a ground
* Sleeping

And some other little stuff I can't recall already
  • Loading branch information
Dragon committed Jun 2, 2022
1 parent 91f5e36 commit 8866035
Show file tree
Hide file tree
Showing 11 changed files with 1,365 additions and 380 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Mod to replace Valheim player with VRM model.

![VRM](https://github.com/yoship1639/ValheimVRM/raw/main/img/img000.png)

## 導入方法
## 導入方法 / Installation method

[https://yoship1639.github.io/ValheimVRM/](https://yoship1639.github.io/ValheimVRM/)
[https://yoship1639.github.io/ValheimVRM/](https://yoship1639.github.io/ValheimVRM/)

### [キャラクター設定例 / Character settings example](settings_Example.txt)

### [グローバル設定の例 / Global settings example](global_settings.txt)

### [小さな文字の設定例 / Small character settings example](settings_Example_Smol_Character.txt)
30 changes: 30 additions & 0 deletions ValheimVRM/Commands.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace ValheimVRM
{
public static class Commands
{
public static readonly Console.ConsoleCommand ReloadSettings = new Console.ConsoleCommand(
"reload_settings",
"reload VRM settings for your character",
args =>
{
Settings.AddSettingsFromFile(VRMModels.PlayerToName[Player.m_localPlayer]);

args.Context.AddString("Settings for " + VRMModels.PlayerToName[Player.m_localPlayer] + " were reloaded");
});

public static readonly Console.ConsoleCommand ReloadGlobalSettings = new Console.ConsoleCommand(
"reload_global_settings",
"reload global VRM settings",
args =>
{
Settings.ReloadGlobalSettings();

args.Context.AddString("Global settings were reloaded");
});

public static int Trigger()
{
return 1;
}
}
}
11 changes: 9 additions & 2 deletions ValheimVRM/MainPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BepInEx;
using System.Globalization;
using BepInEx;
using HarmonyLib;
using System.Reflection;

Expand All @@ -10,10 +11,16 @@ public class MainPlugin : BaseUnityPlugin
{
public const string PluginGuid = "com.yoship1639.plugins.valheimvrm";
public const string PluginName = "ValheimVRM";
public const string PluginVersion = "1.1.2.0";
public const string PluginVersion = "1.1.3.0";

void Awake()
{
// avoid float parsing error on computers with different cultures
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;

// we have some global settings to load
Settings.ReloadGlobalSettings();

// Harmonyパッチ作成
var harmony = new Harmony("com.yoship1639.plugins.valheimvrm.patch");

Expand Down
Loading

0 comments on commit 8866035

Please sign in to comment.