This commit is contained in:
2026-03-07 19:59:03 +01:00
commit 53ffc8b5ba
17 changed files with 285 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
SCR_AvailableActionsDisplay {
m_aActions {
SCR_AvailableActionContext "{68CF05AC5427260F}" {
m_iTimeForHide 5000
m_iTimeToShow 5000
m_aConditions {
SCR_ORCondition "{68CF05AD7A4D2446}" {
m_aConditions {
SCR_CharacterSprintingCondition "{68CF05AD4CFC6A7D}" {
}
}
}
}
m_sTag "SCR_Autorun"
m_sAction "SCR_Autorun"
m_sName "Autorun"
}
}
}

View File

@@ -0,0 +1,17 @@
MetaFileClass {
Name "{80CC0413DDBDFCB9}Configs/ControlHints/AvailableActions.conf"
Configurations {
CONFResourceClass PC {
}
CONFResourceClass XBOX_ONE : PC {
}
CONFResourceClass XBOX_SERIES : PC {
}
CONFResourceClass PS4 : PC {
}
CONFResourceClass PS5 : PC {
}
CONFResourceClass HEADLESS : PC {
}
}
}

View File

@@ -0,0 +1,37 @@
ActionManager {
Actions {
Action SCR_Autorun {
InputSource InputSourceSum "{68CF05B2CDF32CE3}" {
Sources {
InputSourceValue "{68CF05B2D647AF8F}" {
FilterPreset "pressed"
Input "keyboard:KC_RCONTROL"
Filter InputFilterPressed "{68CF05B2DB8E153F}" {
}
}
InputSourceCombo "{68CF05B386B56BF6}" {
Sources {
InputSourceValue "{68CF05B028ABF55C}" {
Input "gamepad0:shoulder_right"
Filter InputFilterHold "{68CF05B008688BFF}" {
}
}
InputSourceValue "{68CF05B03B9367DA}" {
Input "gamepad0:x"
Filter InputFilterClick "{68CF05B01E6FB93B}" {
}
}
}
}
}
}
}
}
Contexts {
ActionContext CharacterMovementContext {
ActionRefs +{
"SCR_Autorun"
}
}
}
}

View File

@@ -0,0 +1,17 @@
MetaFileClass {
Name "{795184CF9AD764DB}Configs/System/chimeraInputCommon.conf"
Configurations {
CONFResourceClass PC {
}
CONFResourceClass XBOX_ONE : PC {
}
CONFResourceClass XBOX_SERIES : PC {
}
CONFResourceClass PS4 : PC {
}
CONFResourceClass PS5 : PC {
}
CONFResourceClass HEADLESS : PC {
}
}
}

View File

@@ -0,0 +1,15 @@
SCR_KeyBindingMenuConfig {
m_KeyBindingCategories {
SCR_KeyBindingCategory "{68CF05B05A034F4A}" {
m_sName "GTG"
m_sDisplayName "GTG"
m_KeyBindingEntries {
SCR_KeyBindingEntry "{68CF05B0B1F4D2F4}" {
m_sActionName "SCR_Autorun"
m_sDisplayName "Autorun"
m_sPreset "pressed"
}
}
}
}
}

View File

@@ -0,0 +1,17 @@
MetaFileClass {
Name "{4EE7794C9A3F11EF}Configs/System/keyBindingMenu.conf"
Configurations {
CONFResourceClass PC {
}
CONFResourceClass XBOX_ONE : PC {
}
CONFResourceClass XBOX_SERIES : PC {
}
CONFResourceClass PS4 : PC {
}
CONFResourceClass PS5 : PC {
}
CONFResourceClass HEADLESS : PC {
}
}
}

View File

@@ -0,0 +1,7 @@
SCR_ChimeraCharacter {
ID "520EC961A090B1EE"
components {
SCR_AutorunComponent "{68CF05AF20419949}" {
}
}
}

View File

@@ -0,0 +1,17 @@
MetaFileClass {
Name "{37578B1666981FCE}Prefabs/Characters/Core/Character_Base.et"
Configurations {
EntityTemplateResourceClass PC {
}
EntityTemplateResourceClass XBOX_ONE : PC {
}
EntityTemplateResourceClass XBOX_SERIES : PC {
}
EntityTemplateResourceClass PS4 : PC {
}
EntityTemplateResourceClass PS5 : PC {
}
EntityTemplateResourceClass HEADLESS : PC {
}
}
}

17
Scripts.meta Normal file
View File

@@ -0,0 +1,17 @@
MetaFileClass {
Name "{5BE22D4A02273A1F}Scripts"
Configurations {
FolderResourceClass PC {
}
FolderResourceClass XBOX_ONE : PC {
}
FolderResourceClass XBOX_SERIES : PC {
}
FolderResourceClass PS4 : PC {
}
FolderResourceClass PS5 : PC {
}
FolderResourceClass HEADLESS : PC {
}
}
}

17
Scripts/Game.meta Normal file
View File

@@ -0,0 +1,17 @@
MetaFileClass {
Name "{B92491157EA3E4AD}Scripts/Game"
Configurations {
FolderResourceClass PC {
}
FolderResourceClass XBOX_ONE : PC {
}
FolderResourceClass XBOX_SERIES : PC {
}
FolderResourceClass PS4 : PC {
}
FolderResourceClass PS5 : PC {
}
FolderResourceClass HEADLESS : PC {
}
}
}

View File

@@ -0,0 +1,64 @@
[ComponentEditorProps(category: "GameScripted/Character", description: "Erlaubt automatisches Laufen/Rennen")]
class SCR_AutorunComponentClass: ScriptComponentClass
{
}
class SCR_AutorunComponent: ScriptComponent
{
protected bool m_bIsAutorunEnabled = false;
protected SCR_CharacterControllerComponent m_CharacterController;
protected InputManager m_InputManager;
protected void OnAutorunPressed()
{
m_bIsAutorunEnabled = !m_bIsAutorunEnabled;
}
protected void OnLifeStateChangedCallback()
{
m_bIsAutorunEnabled = false;
}
protected void OnControlledByPlayerCallback(IEntity owner, bool controlled)
{
m_bIsAutorunEnabled = false;
}
protected void OnPrepareControlsCallback(IEntity owner, ActionManager am, float dt, bool player)
{
if (!m_bIsAutorunEnabled)
return;
// Autorun abbrechen, wenn: Kontext inaktiv, Karte offen oder Spieler bewegt sich manuell (W/S/A/D)
if (!m_InputManager.IsContextActive("CharacterMovementContext") ||
am.GetActionTriggered("GadgetMap") ||
Math.AbsFloat(m_InputManager.GetActionValue("CharacterForward")) >= 0.75 ||
Math.AbsFloat(m_InputManager.GetActionValue("CharacterRight")) >= 0.75)
{
m_bIsAutorunEnabled = false;
return;
}
// Bewegungswerte zwingen (Laufen + Rennen)
m_InputManager.SetActionValue("CharacterForward", 1.0);
m_InputManager.SetActionValue("CharacterSprint", 1.0);
}
override void OnPostInit(IEntity owner)
{
m_CharacterController = SCR_CharacterControllerComponent.Cast(owner.FindComponent(SCR_CharacterControllerComponent));
if (!m_CharacterController)
{
Print("[SCR_Autorun] Kein SCR_CharacterControllerComponent gefunden! Mod funktioniert nicht.", LogLevel.WARNING);
return;
}
m_InputManager = GetGame().GetInputManager();
// Events abonnieren
m_CharacterController.m_OnPrepareControls.Insert(OnPrepareControlsCallback);
// Action Listener (Der Name "SCR_Autorun" muss mit der Input-Config übereinstimmen!)
m_InputManager.AddActionListener("SCR_Autorun", EActionTrigger.DOWN, OnAutorunPressed);
}
}

View File

@@ -0,0 +1,14 @@
void OnPrepareControls(IEntity owner, ActionManager am, float dt, bool player);
typedef func OnPrepareControls;
typedef ScriptInvokerBase<OnPrepareControls> OnPrepareControlsInvoker;
modded class SCR_CharacterControllerComponent
{
ref OnPrepareControlsInvoker m_OnPrepareControls = new OnPrepareControlsInvoker();
protected override void OnPrepareControls(IEntity owner, ActionManager am, float dt, bool player)
{
super.OnPrepareControls(owner, am, dt, player);
m_OnPrepareControls.Invoke(owner, am, dt, player);
}
}

2
UserMaps.desc Normal file
View File

@@ -0,0 +1,2 @@
UserMapDescClass {
}

8
addon.gproj Normal file
View File

@@ -0,0 +1,8 @@
GameProject {
ID "Autorun"
GUID "68CB13E78DD0129D"
TITLE "Autorun"
Dependencies {
"58D0FB3206B6F859"
}
}

BIN
resourceDatabase.rdb Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,17 @@
MetaFileClass {
Name "{BEF094A5F7F3211C}worlds/GameMaster/GM_Eden.ent"
Configurations {
ENTResourceClass PC {
}
ENTResourceClass XBOX_ONE : PC {
}
ENTResourceClass XBOX_SERIES : PC {
}
ENTResourceClass PS4 : PC {
}
ENTResourceClass PS5 : PC {
}
ENTResourceClass HEADLESS : PC {
}
}
}