mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 10:29:22 +00:00
Minor code changes
This commit is contained in:
parent
c37d3a6842
commit
a232c2ce13
7 changed files with 675 additions and 666 deletions
10
README.md
10
README.md
|
@ -3,13 +3,13 @@ Merged set of MelonLoader mods for ChilloutVR.
|
||||||
**Table for game build 2023r172p1:**
|
**Table for game build 2023r172p1:**
|
||||||
| Full name | Short name | Latest version | Available in [CVRMA](https://github.com/knah/CVRMelonAssistant) |
|
| Full name | Short name | Latest version | Available in [CVRMA](https://github.com/knah/CVRMelonAssistant) |
|
||||||
|:---------:|:----------:|:--------------:| :----------------------------------------------------------------|
|
|:---------:|:----------:|:--------------:| :----------------------------------------------------------------|
|
||||||
| [Avatar Motion Tweaker](/ml_amt/README.md) | ml_amt | 1.3.3 [:arrow_down:](../../releases/latest/download/ml_amt.dll)| ✔ Yes<br>:hourglass_flowing_sand: Update review |
|
| [Avatar Motion Tweaker](/ml_amt/README.md) | ml_amt | 1.3.3 [:arrow_down:](../../releases/latest/download/ml_amt.dll)| ✔ Yes |
|
||||||
| [Desktop Head Tracking](/ml_dht/README.md)| ml_dht | - | ✔ Yes<br>:warning:Broken |
|
| [Desktop Head Tracking](/ml_dht/README.md)| ml_dht | - | ✔ Yes<br>:warning:Broken |
|
||||||
| [Leap Motion Extension](/ml_lme/README.md)| ml_lme | 1.4.3 [:arrow_down:](../../releases/latest/download/ml_lme.dll)| ✔ Yes<br>:hourglass_flowing_sand: Update review |
|
| [Leap Motion Extension](/ml_lme/README.md)| ml_lme | 1.4.3 [:arrow_down:](../../releases/latest/download/ml_lme.dll)| ✔ Yes |
|
||||||
| [Pickup Arm Movement](/ml_pam/README.md)| ml_pam | 1.0.8 [:arrow_down:](../../releases/latest/download/ml_pam.dll)| ✔ Yes<br>:hourglass_flowing_sand: Update review |
|
| [Pickup Arm Movement](/ml_pam/README.md)| ml_pam | 1.0.8 [:arrow_down:](../../releases/latest/download/ml_pam.dll)| ✔ Yes |
|
||||||
| [Player Movement Copycat](/ml_pmc/README.md)| ml_pmc | 1.0.3 [:arrow_down:](../../releases/latest/download/ml_pmc.dll)| ✔ Yes |
|
| [Player Movement Copycat](/ml_pmc/README.md)| ml_pmc | 1.0.3 [:arrow_down:](../../releases/latest/download/ml_pmc.dll)| ✔ Yes |
|
||||||
| [Player Ragdoll Mod](/ml_prm/README.md)| ml_prm | 1.0.10 [:arrow_down:](../../releases/latest/download/ml_prm.dll)| ✔ Yes<br>:hourglass_flowing_sand: Update review |
|
| [Player Ragdoll Mod](/ml_prm/README.md)| ml_prm | 1.0.11 [:arrow_down:](../../releases/latest/download/ml_prm.dll)| ✔ Yes<br>:hourglass_flowing_sand: Update review |
|
||||||
| [Vive Extended Input](/ml_vei/README.md) | ml_vei | 1.0.0 [:arrow_down:](../../releases/latest/download/ml_vei.dll)| :hourglass_flowing_sand: On review |
|
| [Vive Extended Input](/ml_vei/README.md) | ml_vei | 1.0.0 [:arrow_down:](../../releases/latest/download/ml_vei.dll)| ✔ Yes |
|
||||||
|
|
||||||
**Archived mods:**
|
**Archived mods:**
|
||||||
| Full name | Short name | Notes |
|
| Full name | Short name | Notes |
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.0.10", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.0.11", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||||
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
|
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
|
||||||
[assembly: MelonLoader.MelonPriority(2)]
|
[assembly: MelonLoader.MelonPriority(2)]
|
||||||
[assembly: MelonLoader.MelonOptionalDependencies("BTKUILib")]
|
[assembly: MelonLoader.MelonOptionalDependencies("BTKUILib")]
|
||||||
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||||
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
[assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||||
[assembly: MelonLoader.MelonAdditionalCredits("kafeijao, NotAKidOnSteam")]
|
[assembly: MelonLoader.MelonAdditionalCredits("kafeijao, NotAKidOnSteam")]
|
||||||
|
|
136
ml_prm/README.md
136
ml_prm/README.md
|
@ -1,68 +1,68 @@
|
||||||
# Player Ragdoll Mod
|
# Player Ragdoll Mod
|
||||||
This mod turns player's avatar into ragdoll puppet.
|
This mod turns player's avatar into ragdoll puppet.
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
* Install [latest MelonLoader](https://github.com/LavaGang/MelonLoader)
|
* Install [latest MelonLoader](https://github.com/LavaGang/MelonLoader)
|
||||||
* Get [latest release DLL](../../../releases/latest):
|
* Get [latest release DLL](../../../releases/latest):
|
||||||
* Put `ml_prm.dll` in `Mods` folder of game
|
* Put `ml_prm.dll` in `Mods` folder of game
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
* Press `R` to turn into ragdoll and back.
|
* Press `R` to turn into ragdoll and back.
|
||||||
|
|
||||||
Optional mod's settings page with [BTKUILib](https://github.com/BTK-Development/BTKUILib):
|
Optional mod's settings page with [BTKUILib](https://github.com/BTK-Development/BTKUILib):
|
||||||
* **Switch ragdoll:** turns into ragdoll state and back, made for VR usage primarily.
|
* **Switch ragdoll:** turns into ragdoll state and back, made for VR usage primarily.
|
||||||
* **Use hotkey:** enables/disables ragdoll state switch with `R` key; `true` by default.
|
* **Use hotkey:** enables/disables ragdoll state switch with `R` key; `true` by default.
|
||||||
* **Use gravity:** enables/disables gravity for ragdoll; `true` by default.
|
* **Use gravity:** enables/disables gravity for ragdoll; `true` by default.
|
||||||
* Note: Forcibly enabled in worlds that don't allow flight.
|
* Note: Forcibly enabled in worlds that don't allow flight.
|
||||||
* **Pointers reaction:** enables ragdoll state when player collides with trigger colliders with CVRPointer component of `ragdoll` type (avatars, props and world included); `true` by default.
|
* **Pointers reaction:** enables ragdoll state when player collides with trigger colliders and particle systems with CVRPointer component of `ragdoll` type (avatars, props and world included); `true` by default.
|
||||||
* **Ignore local pointers:** enables/disables ignoring of CVRPointer components of `ragdoll` type on local player's avatar; `true` by default.
|
* **Ignore local pointers:** enables/disables ignoring of CVRPointer components of `ragdoll` type on local player's avatar; `true` by default.
|
||||||
* **Combat reaction:** enables ragdoll state upon death in worlds with combat system; `true` by default.
|
* **Combat reaction:** enables ragdoll state upon death in worlds with combat system; `true` by default.
|
||||||
* **Auto recover:** enables automatic recovering after specific time delay; `false` by default.
|
* **Auto recover:** enables automatic recovering after specific time delay; `false` by default.
|
||||||
* **Slipperiness:** enables/disable low friction of ragdoll; `false` by default.
|
* **Slipperiness:** enables/disable low friction of ragdoll; `false` by default.
|
||||||
* Note: Forcibly disabled in worlds that don't allow flight.
|
* Note: Forcibly disabled in worlds that don't allow flight.
|
||||||
* **Bounciness:** enables/disable bounce force of ragdoll; `false` by default.
|
* **Bounciness:** enables/disable bounce force of ragdoll; `false` by default.
|
||||||
* Note: Forcibly disabled in worlds that don't allow flight.
|
* Note: Forcibly disabled in worlds that don't allow flight.
|
||||||
* **View direction velocity:** apply velocity to camera view direction instead of player movement direction; `false` by default.
|
* **View direction velocity:** apply velocity to camera view direction instead of player movement direction; `false` by default.
|
||||||
* Note: Forcibly disabled in worlds that don't allow flight.
|
* Note: Forcibly disabled in worlds that don't allow flight.
|
||||||
* **Jump recover:** enables recovering from ragdoll state by jumping; `false` by default.
|
* **Jump recover:** enables recovering from ragdoll state by jumping; `false` by default.
|
||||||
* **Velocity multiplier:** velocity force multiplier based on player's movement direction; `2.0` by default.
|
* **Velocity multiplier:** velocity force multiplier based on player's movement direction; `2.0` by default.
|
||||||
* Note: Limited according to world's fly multiplier.
|
* Note: Limited according to world's fly multiplier.
|
||||||
* Note: Forcibly set to `1.0` in worlds that don't allow flight.
|
* Note: Forcibly set to `1.0` in worlds that don't allow flight.
|
||||||
* **Movement drag:** movement resistance; `2.0` by default.
|
* **Movement drag:** movement resistance; `2.0` by default.
|
||||||
* Note: Forcibly set to `1.0` in worlds that don't allow flight.
|
* Note: Forcibly set to `1.0` in worlds that don't allow flight.
|
||||||
* **Angular movement drag:** angular movement resistance; `2.0` by default.
|
* **Angular movement drag:** angular movement resistance; `2.0` by default.
|
||||||
* **Recover delay:** time delay for enabled `Auto recover` in seconds; `3.0` by default.
|
* **Recover delay:** time delay for enabled `Auto recover` in seconds; `3.0` by default.
|
||||||
* **Reset settings:** resets mod settings to default.
|
* **Reset settings:** resets mod settings to default.
|
||||||
|
|
||||||
Optional mod's settings in [UIExpansionKit](https://github.com/ddakebono/ChilloutMods):
|
Optional mod's settings in [UIExpansionKit](https://github.com/ddakebono/ChilloutMods):
|
||||||
* **Hotkey:** system key that is used to switch ragdoll state; `R` by default.
|
* **Hotkey:** system key that is used to switch ragdoll state; `R` by default.
|
||||||
|
|
||||||
Available additional parameters for AAS animator:
|
Available additional parameters for AAS animator:
|
||||||
* **`Ragdolled`:** defines current ragdoll state; boolean.
|
* **`Ragdolled`:** defines current ragdoll state; boolean.
|
||||||
* Note: Can be set as local-only (not synced) if starts with `#` character.
|
* Note: Can be set as local-only (not synced) if starts with `#` character.
|
||||||
|
|
||||||
# Unity Editor Script
|
# Unity Editor Script
|
||||||
You can also trigger the ragdoll via animations on your avatar. To do this you need:
|
You can also trigger the ragdoll via animations on your avatar. To do this you need:
|
||||||
* Download and import the `ml_prm_editor_script.unitypackage` into your unity project
|
* Download and import the `ml_prm_editor_script.unitypackage` into your unity project
|
||||||
* Add the component `Ragdoll Toggle` anywhere inside of your avatar's hierarchy.
|
* Add the component `Ragdoll Toggle` anywhere inside of your avatar's hierarchy.
|
||||||
|
|
||||||
Now you can animate both parameters available:
|
Now you can animate both parameters available:
|
||||||
- **Should Override:** whether the animation should override the toggled state of the ragdoll.
|
- **Should Override:** whether the animation should override the toggled state of the ragdoll.
|
||||||
- **Is On:** whether the ragdoll state is On or Off (only works if `Should Override` is also On).
|
- **Is On:** whether the ragdoll state is On or Off (only works if `Should Override` is also On).
|
||||||
|
|
||||||

|

|
||||||
Note: In order to work the game object needs to be active and the component enabled.
|
Note: In order to work the game object needs to be active and the component enabled.
|
||||||
|
|
||||||
# Mods Integration
|
# Mods Integration
|
||||||
You can use this mod's functions within your mod. To do this you need:
|
You can use this mod's functions within your mod. To do this you need:
|
||||||
* Add mod's dll as reference in your project
|
* Add mod's dll as reference in your project
|
||||||
* Access ragdoll controller with `ml_prm.RagdollController.Instance`
|
* Access ragdoll controller with `ml_prm.RagdollController.Instance`
|
||||||
|
|
||||||
Available methods:
|
Available methods:
|
||||||
* ```bool IsRagdolled()```
|
* ```bool IsRagdolled()```
|
||||||
* ```void SwitchRagdoll()```
|
* ```void SwitchRagdoll()```
|
||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
* If ragdoll state is enabled during emote, remote players see whole emote playing while local player sees ragdolling. It's tied to how game handles remote players, currently can be prevented with (choose one):
|
* If ragdoll state is enabled during emote, remote players see whole emote playing while local player sees ragdolling. It's tied to how game handles remote players, currently can be prevented with (choose one):
|
||||||
* Renaming avatar emote animations to not have default name or containing `Emote` substring.
|
* Renaming avatar emote animations to not have default name or containing `Emote` substring.
|
||||||
* Holding any movement key right after activating ragdoll state.
|
* Holding any movement key right after activating ragdoll state.
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -6,7 +6,7 @@ using UnityEngine;
|
||||||
namespace ml_prm
|
namespace ml_prm
|
||||||
{
|
{
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
public class RagdollTrigger : MonoBehaviour
|
class RagdollTrigger : MonoBehaviour
|
||||||
{
|
{
|
||||||
const string c_ragdollPointerType = "ragdoll";
|
const string c_ragdollPointerType = "ragdoll";
|
||||||
|
|
||||||
|
@ -18,14 +18,13 @@ namespace ml_prm
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
m_collider = this.GetComponent<Collider>();
|
m_collider = this.GetComponent<Collider>();
|
||||||
CVRParticlePointerManager.volumes.Add(new RagdollTriggerVolume() {
|
|
||||||
collider = m_collider,
|
CVRParticlePointerManager.volumes.Add(new RagdollTriggerVolume(m_collider, this));
|
||||||
trigger = this,
|
|
||||||
});
|
|
||||||
CVRParticlePointerManager.UpdateParticleSystems();
|
CVRParticlePointerManager.UpdateParticleSystems();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDestroy() {
|
void OnDestroy()
|
||||||
|
{
|
||||||
CVRParticlePointerManager.RemoveTrigger(m_collider);
|
CVRParticlePointerManager.RemoveTrigger(m_collider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +44,7 @@ namespace ml_prm
|
||||||
{
|
{
|
||||||
if(m_lastParticleSystemTrigger != null)
|
if(m_lastParticleSystemTrigger != null)
|
||||||
{
|
{
|
||||||
if (m_lastParticleSystemTrigger.particleCount == 0)
|
if(m_lastParticleSystemTrigger.particleCount == 0)
|
||||||
m_lastParticleSystemTrigger = null;
|
m_lastParticleSystemTrigger = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -71,8 +70,10 @@ namespace ml_prm
|
||||||
|
|
||||||
public void OnPointerParticleEnter(CVRPointer p_pointer)
|
public void OnPointerParticleEnter(CVRPointer p_pointer)
|
||||||
{
|
{
|
||||||
if (!gameObject.activeInHierarchy) return;
|
if(!this.gameObject.activeInHierarchy)
|
||||||
if ((p_pointer.type == c_ragdollPointerType) && !IsIgnored(p_pointer.transform) && (m_lastParticleSystemTrigger != p_pointer.particleSystem))
|
return;
|
||||||
|
|
||||||
|
if((p_pointer.type == c_ragdollPointerType) && !IsIgnored(p_pointer.transform) && (m_lastParticleSystemTrigger != p_pointer.particleSystem))
|
||||||
{
|
{
|
||||||
m_lastParticleSystemTrigger = p_pointer.particleSystem;
|
m_lastParticleSystemTrigger = p_pointer.particleSystem;
|
||||||
m_triggered = true;
|
m_triggered = true;
|
||||||
|
|
|
@ -2,13 +2,21 @@
|
||||||
using ABI.CCK.Components;
|
using ABI.CCK.Components;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace ml_prm {
|
namespace ml_prm
|
||||||
|
{
|
||||||
public class RagdollTriggerVolume : CVRTriggerVolume
|
class RagdollTriggerVolume : CVRTriggerVolume
|
||||||
{
|
{
|
||||||
|
readonly RagdollTrigger m_trigger = null;
|
||||||
|
|
||||||
public Collider collider { get; set; }
|
public Collider collider { get; set; }
|
||||||
public RagdollTrigger trigger { get; set; }
|
|
||||||
public void TriggerEnter(CVRPointer pointer) => trigger.OnPointerParticleEnter(pointer);
|
internal RagdollTriggerVolume(Collider p_collider, RagdollTrigger p_trigger)
|
||||||
public void TriggerExit(CVRPointer pointer) => trigger.OnPointerParticleExit(pointer);
|
{
|
||||||
|
collider = p_collider;
|
||||||
|
m_trigger = p_trigger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TriggerEnter(CVRPointer pointer) => m_trigger.OnPointerParticleEnter(pointer);
|
||||||
|
public void TriggerExit(CVRPointer pointer) => m_trigger.OnPointerParticleExit(pointer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>netstandard2.1</TargetFramework>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<PackageId>PlayerRagdollMod</PackageId>
|
<PackageId>PlayerRagdollMod</PackageId>
|
||||||
<Version>1.0.10</Version>
|
<Version>1.0.11</Version>
|
||||||
<Authors>SDraw</Authors>
|
<Authors>SDraw</Authors>
|
||||||
<Company>None</Company>
|
<Company>None</Company>
|
||||||
<Product>PlayerRagdollMod</Product>
|
<Product>PlayerRagdollMod</Product>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue