Export strafe key yaw override to zscript?

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Export strafe key yaw override to zscript?

Re: Export strafe key yaw override to zscript?

by Caligari87 » Sat Mar 24, 2018 8:57 am

I'm not targeting keyboard-only Doom players with this. I'm targeting modern control schemes that expect the presence of a mouse.

Feel free to move this to closed. I'll figure something else out.

8-)

Re: Export strafe key yaw override to zscript?

by Graf Zahl » Sat Mar 24, 2018 8:54 am

Caligari87 wrote:My reasoning:
  • No one uses the strafe key for modern gameplay anymore. Why not give it a potential use for things beyond keyboard-only Doom.

That's a pretty bold assumption. Have you used all of GZDoom's users?

Re: Export strafe key yaw override to zscript?

by Caligari87 » Sat Mar 24, 2018 8:53 am

My reasoning:
  • No one uses the strafe key for modern gameplay anymore. It's not "hijacking" if the mod is intended to be played with a mouse.
  • I didn't expect the strafe key to be hardcoded in such an archaic and non-intuitive manner. Why not give it a potential use for things beyond keyboard-only Doom.
  • Custom keybinds are 3rd-world citizens compared to the built-in keybinds accessible from GetPlayerInput or cmd.
  • BT_USER keybinds are useless until keybindings are saved per-mod.
  • I hate lean keys and wanted something closer to Arma's "stance adjust" modifier key.
That said, this seems to be clearly a [No] so I'll either skip the feature or find another way to make it work.

8-)

Re: Export strafe key yaw override to zscript?

by Graf Zahl » Sat Mar 24, 2018 1:23 am

Indeed. Hijacking Strafe for this does not sound right.

Re: Export strafe key yaw override to zscript?

by Nash » Sat Mar 24, 2018 12:52 am

Hmm sounds complicated. In most games with leaning, they just have separate key binds for leaning left and right, without messing with the move left/right keys...

Re: Export strafe key yaw override to zscript?

by Caligari87 » Fri Mar 23, 2018 2:54 pm

I'm designing a new movement system for the mod I'm working on. In short, the player actor is just the head; the legs and torso are separate actors. Locomotion is acheived by imparting velocity to the legs, and the torso+head follows on a spring. I want idea to implement leaning (since the player's full-body hitbox is no longer relevant). To do this, I wanted to use the Strafe key as a toggle, to impart velocity to the player's head and torso instead of the legs.

Code: Select all

void UpdateMove() {
	let player = self.player;
	UserCmd cmd = player.cmd;
	if (player.onground) {
		legs.vel.xy *= 0.75; //Decelerate
		if(cmd.buttons & BT_STRAFE) {
			vel.xy += rotateVector((moveVec.x, 0), angle - 90) * 5 / player.crouchfactor; //Move head
			torso.vel.xy += rotateVector((moveVec.x, 0), angle - 90) * 5 / player.crouchfactor; //Move torso
			legs.vel.xy += rotateVector((0, moveVec.y), angle - 90); //allow moving forward/back
		}
		else {
			legs.vel.xy += rotateVector(moveVec, angle - 90); //Move legs
		}
	}
}
This works perfectly (video demo), except for a small detail: The player's mouse yaw gets pushed into sidemove, meaning the player can no longer freelook and the leaning gets overriden by any mouse yaw behavior. I can take a video demo of this later if desired.

My suggestion is that the conversion/override should be exported to PlayerPawn, so this behavior can be overridden.

8-)

Re: Export strafe key yaw override to zscript?

by Graf Zahl » Fri Mar 23, 2018 2:39 pm

Caligari87 wrote:I can't override it in the player virtuals it to use the strafe key for anything else.
You shouldn't, actually. In this case you have to present your use case.

Re: Export strafe key yaw override to zscript?

by Gez » Fri Mar 23, 2018 2:35 pm

The entire point of the strafe key is to convert turning into sideway move.

Re: Export strafe key yaw override to zscript?

by Caligari87 » Fri Mar 23, 2018 11:52 am

To add a little more detail, I found this in g_game.cpp

Code: Select all

if (strafe || lookstrafe)
    side += (int)((float)mousex * m_side);
What effects would it have if that was changed to just "if (lookstrafe)" ? Mess with expected controller input or something? It seems to me that if lookstrafe is off, it shouldn't override the mouse movement.

8-)

Export strafe key yaw override to zscript?

by Caligari87 » Wed Mar 21, 2018 8:39 pm

I'm running GZDoom 3.2.5 on Linux.

I've noticed that the [strafe] key is hardcoded to override sidemove / mouse yaw. Is this intentional? Because it seems counterintuitive, and since it's hardcoded I can't override it in the player virtuals it to use the strafe key for anything else.

8-)

Top