1.0.2
This commit is contained in:
@@ -6,12 +6,24 @@ class SCR_AutorunComponentClass: ScriptComponentClass
|
|||||||
class SCR_AutorunComponent: ScriptComponent
|
class SCR_AutorunComponent: ScriptComponent
|
||||||
{
|
{
|
||||||
protected bool m_bIsAutorunEnabled = false;
|
protected bool m_bIsAutorunEnabled = false;
|
||||||
|
protected bool m_bWaitForKeyRelease = false; // Neu: Die Sicherung
|
||||||
|
|
||||||
protected SCR_CharacterControllerComponent m_CharacterController;
|
protected SCR_CharacterControllerComponent m_CharacterController;
|
||||||
protected InputManager m_InputManager;
|
protected InputManager m_InputManager;
|
||||||
|
|
||||||
protected void OnAutorunPressed()
|
protected void OnAutorunPressed()
|
||||||
{
|
{
|
||||||
m_bIsAutorunEnabled = !m_bIsAutorunEnabled;
|
m_bIsAutorunEnabled = !m_bIsAutorunEnabled;
|
||||||
|
|
||||||
|
// Wenn Autorun AN geht und der Spieler hält W bereits gedrückt...
|
||||||
|
if (m_bIsAutorunEnabled && m_InputManager.GetActionValue("CharacterForward") > 0.5)
|
||||||
|
{
|
||||||
|
m_bWaitForKeyRelease = true; // ...Sicherung aktivieren!
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_bWaitForKeyRelease = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnLifeStateChangedCallback()
|
protected void OnLifeStateChangedCallback()
|
||||||
@@ -29,11 +41,21 @@ class SCR_AutorunComponent: ScriptComponent
|
|||||||
if (!m_bIsAutorunEnabled)
|
if (!m_bIsAutorunEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Autorun abbrechen, wenn: Kontext inaktiv, Karte offen oder Spieler bewegt sich manuell (W/S/A/D)
|
float forwardInput = m_InputManager.GetActionValue("CharacterForward");
|
||||||
|
float rightInput = m_InputManager.GetActionValue("CharacterRight");
|
||||||
|
|
||||||
|
// Wenn die Sicherung an ist und der Spieler W loslässt (Wert unter 0.5) -> Sicherung raus
|
||||||
|
if (m_bWaitForKeyRelease && forwardInput < 0.5)
|
||||||
|
{
|
||||||
|
m_bWaitForKeyRelease = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Autorun abbrechen, wenn: Kontext inaktiv, Karte offen, A/D gedrückt,
|
||||||
|
// oder W/S gedrückt (ABER W bricht nur ab, wenn die Sicherung draußen ist!)
|
||||||
if (!m_InputManager.IsContextActive("CharacterMovementContext") ||
|
if (!m_InputManager.IsContextActive("CharacterMovementContext") ||
|
||||||
am.GetActionTriggered("GadgetMap") ||
|
am.GetActionTriggered("GadgetMap") ||
|
||||||
Math.AbsFloat(m_InputManager.GetActionValue("CharacterForward")) >= 0.75 ||
|
Math.AbsFloat(rightInput) >= 0.75 ||
|
||||||
Math.AbsFloat(m_InputManager.GetActionValue("CharacterRight")) >= 0.75)
|
(!m_bWaitForKeyRelease && Math.AbsFloat(forwardInput) >= 0.75))
|
||||||
{
|
{
|
||||||
m_bIsAutorunEnabled = false;
|
m_bIsAutorunEnabled = false;
|
||||||
return;
|
return;
|
||||||
@@ -55,10 +77,7 @@ class SCR_AutorunComponent: ScriptComponent
|
|||||||
|
|
||||||
m_InputManager = GetGame().GetInputManager();
|
m_InputManager = GetGame().GetInputManager();
|
||||||
|
|
||||||
// Events abonnieren
|
|
||||||
m_CharacterController.m_OnPrepareControls.Insert(OnPrepareControlsCallback);
|
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);
|
m_InputManager.AddActionListener("SCR_Autorun", EActionTrigger.DOWN, OnAutorunPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
16
addon.gproj
16
addon.gproj
@@ -1,8 +1,22 @@
|
|||||||
GameProject {
|
GameProject {
|
||||||
ID "Autorun"
|
ID "GTG-Autorun"
|
||||||
GUID "68CB13E78DD0129D"
|
GUID "68CB13E78DD0129D"
|
||||||
TITLE "Autorun"
|
TITLE "Autorun"
|
||||||
Dependencies {
|
Dependencies {
|
||||||
"58D0FB3206B6F859"
|
"58D0FB3206B6F859"
|
||||||
}
|
}
|
||||||
|
Configurations {
|
||||||
|
GameProjectConfig PC {
|
||||||
|
}
|
||||||
|
GameProjectConfig XBOX_ONE {
|
||||||
|
}
|
||||||
|
GameProjectConfig XBOX_SERIES {
|
||||||
|
}
|
||||||
|
GameProjectConfig PS4 {
|
||||||
|
}
|
||||||
|
GameProjectConfig PS5 {
|
||||||
|
}
|
||||||
|
GameProjectConfig HEADLESS {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
BIN
thumbnail.png
Normal file
BIN
thumbnail.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
Binary file not shown.
@@ -1,17 +0,0 @@
|
|||||||
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 {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user