Skip to content

Commit acbad35

Browse files
committed
Added manual crouching, and toggle-to-run
1 parent 1316bec commit acbad35

File tree

25 files changed

+324
-117
lines changed

25 files changed

+324
-117
lines changed

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1616
New `Actor` Lua property `JumpHeight` (R) to estimate the jump height of the actor (in metres), based on the actor's jetpack and weight. Actors without a jetpack return 0.
1717
The new function `GetPathFindingFlyingJumpHeight()` can be used to get a jumpHeight that allows flying (i.e infinite jump height). This is also the value that `ACRocket`s and `ACDropships` return for `JumpHeight`.
1818

19-
- Added running.
20-
Players on PC can enable running by holding the shift key. TBD add other platforms
21-
When running, you cannot sharpaim or shoot your weapon.
19+
- Improved Locomotion.
20+
Added the ability to run. When running, you cannot sharpaim whatsoever.
21+
Added the ability to manually crouch. When crouching, your sharpaim distance is sligtly increased.
22+
Players on PC can enable running by holding the shift key, or crouch by holding control. Players using the arrow keys can use right ctrl/shift. Controllers can run by clicking in the left stick, or crouch by holding the left stick down. Prone on controllers is now performed by clicking in the right stick. SNES/d-pad controllers run using the right bumper.
2223
Added new `MovementState` type `RUN` for script.
24+
Added new `Controller` state `WALKCROUCH` for crouching, and `PRONE` for prone. The existing `CROUCH` state has been deprecated, as it referred to PRONE.
2325

2426
- New music system, including a dynamic horizontal sequencing system, under the new music manager `MusicMan`.
2527
`PlayDynamicSong(string songName, string songSectionName, bool playImmediately, bool playTransition, bool smoothFade)` to play a new DynamicSong.

Data/Base.rte/AI/HumanBehaviors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ function HumanBehaviors.ShootTarget(AI, Owner, Abort)
12231223
AI.Ctrl.AnalogAim = SceneMan:ShortestDistance(Owner.Pos, AI.Target.Pos, false).Normalized;
12241224
if AI.lateralMoveState == Actor.LAT_STILL then
12251225
AI.proneState = AHuman.PRONE;
1226-
--AI.Ctrl:SetState(Controller.BODY_CROUCH, true);
1226+
--AI.Ctrl:SetState(Controller.BODY_PRONE, true);
12271227
end
12281228
elseif Owner:EquipFirearm(true) then
12291229
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame, just in case the magazine is replenished by another script

Data/Base.rte/AI/NativeHumanAI.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ function NativeHumanAI:Update(Owner)
361361
local dist = SceneMan:ShortestDistance(Owner.Pos, Leader.Pos, false).Largest;
362362
local radius = (Leader.Height + Owner.Height) * 0.5;
363363
if dist < radius then
364-
local copyControls = {Controller.MOVE_LEFT, Controller.MOVE_RIGHT, Controller.BODY_JUMPSTART, Controller.BODY_JUMP, Controller.BODY_CROUCH};
364+
local copyControls = {Controller.MOVE_LEFT, Controller.MOVE_RIGHT, Controller.BODY_JUMPSTART, Controller.BODY_JUMP, Controller.BODY_PRONE};
365365
for _, control in pairs(copyControls) do
366366
local state = Leader:GetController():IsState(control);
367367
self.Ctrl:SetState(control, state);
@@ -634,7 +634,7 @@ function NativeHumanAI:Update(Owner)
634634
if self.proneState == AHuman.GOPRONE then
635635
self.proneState = AHuman.PRONE;
636636
elseif self.proneState == AHuman.PRONE then
637-
self.Ctrl:SetState(Controller.BODY_CROUCH, true);
637+
self.Ctrl:SetState(Controller.BODY_PRONE, true);
638638
end
639639

640640
if self.lateralMoveState == Actor.LAT_LEFT then

Data/Base.rte/Actors/Shared/Scripts/SelfHeal.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function Update(self)
5252
for state = 1, 15 do
5353
controller:SetState(state, false);
5454
end
55-
controller:SetState(Controller.BODY_CROUCH, true);
55+
controller:SetState(Controller.BODY_PRONE, true);
5656
end
5757
elseif self:NumberValueExists("SelfHeal") then
5858
self.healing = {};

Data/Base.rte/Devices/Tools/Constructor/Constructor.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ function Update(self)
434434
cursorMovement = cursorMovement + Vector(0, -1);
435435
end
436436

437-
if ctrl:IsState(Controller.HOLD_DOWN) or ctrl:IsState(Controller.BODY_CROUCH) then
437+
if ctrl:IsState(Controller.HOLD_DOWN) or ctrl:IsState(Controller.BODY_PRONE) then
438438
cursorMovement = cursorMovement + Vector(0, 1);
439439
end
440440

Data/Base.rte/Devices/Tools/GrappleGun/Grapple.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function Update(self)
275275
end
276276

277277
-- Hold crouch to control rope manually
278-
if controller:IsState(Controller.BODY_CROUCH) then
278+
if controller:IsState(Controller.BODY_PRONE) then
279279
if self.climb == 1 or self.climb == 2 then
280280
if self.climbTimer:IsPastSimMS(self.climbDelay) then
281281
self.climbTimer:Reset();
@@ -433,10 +433,10 @@ function Update(self)
433433
end
434434

435435
-- Double tapping crouch retrieves the hook
436-
if controller and controller:IsState(Controller.BODY_CROUCH) then
436+
if controller and controller:IsState(Controller.BODY_PRONE) then
437437
self.pieSelection = 0;
438438
if self.canTap == true then
439-
controller:SetState(Controller.BODY_CROUCH, false);
439+
controller:SetState(Controller.BODY_PRONE, false);
440440
self.climb = 0;
441441
if self.parentGun ~= nil and self.parentGun.ID ~= rte.NoMOID then
442442
self.parentGun:RemoveNumberValue("GrappleMode");

Data/Base.rte/Devices/Tools/GrappleGun/GrappleGun.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ function Update(self)
3737
if self.Magazine.Scale == 1 then
3838
self.StanceOffset = Vector(ToMOSprite(self:GetParent()):GetSpriteWidth(), 1);
3939
self.SharpStanceOffset = Vector(ToMOSprite(self:GetParent()):GetSpriteWidth(), 1);
40-
if controller and controller:IsState(Controller.BODY_CROUCH) then
40+
if controller and controller:IsState(Controller.BODY_PRONE) then
4141
if self.canTap then
42-
controller:SetState(Controller.BODY_CROUCH, false);
42+
controller:SetState(Controller.BODY_PRONE, false);
4343
self.tapTimerJump:Reset();
4444
self.didTap = true;
4545
self.canTap = false;

Data/Base.rte/GUIs/SettingsGUI.ini

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,6 +2462,66 @@ Anchor = Left, Top
24622462
ToolTip = None
24632463
Text = [InputKey]
24642464

2465+
[LabelInputName29]
2466+
ControlType = LABEL
2467+
Parent = CollectionBoxScrollingMappingBox
2468+
X = 215
2469+
Y = 355
2470+
Width = 110
2471+
Height = 20
2472+
Visible = True
2473+
Enabled = True
2474+
Name = LabelInputName29
2475+
Anchor = Left, Top
2476+
ToolTip = None
2477+
Text = InputName
2478+
HAlignment = right
2479+
VAlignment = middle
2480+
2481+
[ButtonInputKey29]
2482+
ControlType = BUTTON
2483+
Parent = CollectionBoxScrollingMappingBox
2484+
X = 330
2485+
Y = 355
2486+
Width = 95
2487+
Height = 20
2488+
Visible = True
2489+
Enabled = True
2490+
Name = ButtonInputKey29
2491+
Anchor = Left, Top
2492+
ToolTip = None
2493+
Text = [InputKey]
2494+
2495+
[LabelInputName30]
2496+
ControlType = LABEL
2497+
Parent = CollectionBoxScrollingMappingBox
2498+
X = 215
2499+
Y = 380
2500+
Width = 110
2501+
Height = 20
2502+
Visible = True
2503+
Enabled = True
2504+
Name = LabelInputName30
2505+
Anchor = Left, Top
2506+
ToolTip = None
2507+
Text = InputName
2508+
HAlignment = right
2509+
VAlignment = middle
2510+
2511+
[ButtonInputKey30]
2512+
ControlType = BUTTON
2513+
Parent = CollectionBoxScrollingMappingBox
2514+
X = 330
2515+
Y = 380
2516+
Width = 95
2517+
Height = 20
2518+
Visible = True
2519+
Enabled = True
2520+
Name = ButtonInputKey30
2521+
Anchor = Left, Top
2522+
ToolTip = None
2523+
Text = [InputKey]
2524+
24652525
[CollectionBoxInputCapture]
24662526
ControlType = COLLECTIONBOX
24672527
Parent = root

Data/Base.rte/GUIs/SettingsPauseGUI.ini

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,6 +2463,66 @@ Anchor = Left, Top
24632463
ToolTip = None
24642464
Text = [InputKey]
24652465

2466+
[LabelInputName29]
2467+
ControlType = LABEL
2468+
Parent = CollectionBoxScrollingMappingBox
2469+
X = 215
2470+
Y = 355
2471+
Width = 110
2472+
Height = 20
2473+
Visible = True
2474+
Enabled = True
2475+
Name = LabelInputName29
2476+
Anchor = Left, Top
2477+
ToolTip = None
2478+
Text = InputName
2479+
HAlignment = right
2480+
VAlignment = middle
2481+
2482+
[ButtonInputKey29]
2483+
ControlType = BUTTON
2484+
Parent = CollectionBoxScrollingMappingBox
2485+
X = 330
2486+
Y = 355
2487+
Width = 95
2488+
Height = 20
2489+
Visible = True
2490+
Enabled = True
2491+
Name = ButtonInputKey29
2492+
Anchor = Left, Top
2493+
ToolTip = None
2494+
Text = [InputKey]
2495+
2496+
[LabelInputName30]
2497+
ControlType = LABEL
2498+
Parent = CollectionBoxScrollingMappingBox
2499+
X = 215
2500+
Y = 380
2501+
Width = 110
2502+
Height = 20
2503+
Visible = True
2504+
Enabled = True
2505+
Name = LabelInputName30
2506+
Anchor = Left, Top
2507+
ToolTip = None
2508+
Text = InputName
2509+
HAlignment = right
2510+
VAlignment = middle
2511+
2512+
[ButtonInputKey30]
2513+
ControlType = BUTTON
2514+
Parent = CollectionBoxScrollingMappingBox
2515+
X = 330
2516+
Y = 380
2517+
Width = 95
2518+
Height = 20
2519+
Visible = True
2520+
Enabled = True
2521+
Name = ButtonInputKey30
2522+
Anchor = Left, Top
2523+
ToolTip = None
2524+
Text = [InputKey]
2525+
24662526
[CollectionBoxInputCapture]
24672527
ControlType = COLLECTIONBOX
24682528
Parent = root

Data/Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Automovers/Controller/Controller.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,7 @@ automoverActorFunctions.updateFrozenActor = function(self, actorData)
16581658
actor.Vel[axis] = gravityAdjustment[axis];
16591659
if IsAHuman(actor) then
16601660
ToAHuman(actor).ProneState = AHuman.NOTPRONE;
1661-
actor:GetController():SetState(Controller.BODY_CROUCH, false);
1661+
actor:GetController():SetState(Controller.BODY_PRONE, false);
16621662
end
16631663
end
16641664
end
@@ -1706,7 +1706,7 @@ automoverActorFunctions.updateMovingActor = function(self, actorData, anyCenteri
17061706
verticalRotationAdjustment = direction == Directions.Down and -actor.FlipFactor or 1;
17071707
ToAHuman(actor).ProneState = movementTable.aHumanProneState;
17081708
end
1709-
actorController:SetState(Controller.BODY_CROUCH, movementTable.aHumanCrouchState);
1709+
actorController:SetState(Controller.BODY_PRONE, movementTable.aHumanCrouchState);
17101710
end
17111711
if actor.RotAngle > rotAngleGoal + self.movementAcceleration then
17121712
actor.RotAngle = actor.RotAngle - (self.movementAcceleration * 0.25 * verticalRotationAdjustment);

0 commit comments

Comments
 (0)