Player movement with WASD
RazielLewach
Member Posts: 20
Gather, crazy players that wanted, wants or will want to move your character with WASD keys! Gather and enjoy the pleasure!
Jokes aside (?) I wanted to play moving my char with WASD from the start. Now, after 80h, random reading topics, I saw someone say the same. And I tried now that I have more knowledge and... IT's POSSIBLE. Maybe. We need to try.
Someone managed to make this? Someone can bring some insight? Here my stuff.
With Near Infinity, create an script (BCS), attach the script to an item effect with the option AI SCRIPT (82), select the SCRIPT.BCS as resource, 100% probability, self, permanent... ENJOY!!!
The code.
IF HotKey(W) HotKey(D) THEN RESPONSE #100 MoveToOffset([1.-1]) END
IF HotKey(W) HotKey(A) THEN RESPONSE #100 MoveToOffset([-1.-1]) END
IF HotKey(S) HotKey(D) THEN RESPONSE #100 MoveToOffset([1.1]) END
IF HotKey(S) HotKey(A) THEN RESPONSE #100 MoveToOffset([-1.1]) END
IF HotKey(W) !HotKey(D) !HotKey(A) THEN RESPONSE #100 MoveToOffset([0.-1]) END
IF HotKey(S) !HotKey(D) !HotKey(A) THEN RESPONSE #100 MoveToOffset([0.1]) END
IF HotKey(D) !HotKey(W) !HotKey(S) THEN RESPONSE #100 MoveToOffset([1.0]) END
IF HotKey(A) !HotKey(W) !HotKey(S) THEN RESPONSE #100 MoveToOffset([-1.0]) END
With this, I tested and I could move my character with WASD.
The problem? It only triggered each second. So it moved 1 position, waited 1 second, moved, waited... With the key pressed, it only moved every 1 second. I put "Instant-Permanent" at the settings and Absolute Duration. Did not work. Anyone interested in achieving this can bring some insight? I won't be able to continue this until tomorrow.
Also, auto-centered camera would be necessary. More coding here.
THIS IS POSSIBLE! This have to be possible.
If you question. I play multiplayer, mi partner moves 5 chars, and I move my char, so this helps me a lot. We like to play this way, don't judge. This could also work moving an entire party? Who knows. For soloplay, or multiplayer where u move 1 char, works.
Jokes aside (?) I wanted to play moving my char with WASD from the start. Now, after 80h, random reading topics, I saw someone say the same. And I tried now that I have more knowledge and... IT's POSSIBLE. Maybe. We need to try.
Someone managed to make this? Someone can bring some insight? Here my stuff.
With Near Infinity, create an script (BCS), attach the script to an item effect with the option AI SCRIPT (82), select the SCRIPT.BCS as resource, 100% probability, self, permanent... ENJOY!!!
The code.
IF HotKey(W) HotKey(D) THEN RESPONSE #100 MoveToOffset([1.-1]) END
IF HotKey(W) HotKey(A) THEN RESPONSE #100 MoveToOffset([-1.-1]) END
IF HotKey(S) HotKey(D) THEN RESPONSE #100 MoveToOffset([1.1]) END
IF HotKey(S) HotKey(A) THEN RESPONSE #100 MoveToOffset([-1.1]) END
IF HotKey(W) !HotKey(D) !HotKey(A) THEN RESPONSE #100 MoveToOffset([0.-1]) END
IF HotKey(S) !HotKey(D) !HotKey(A) THEN RESPONSE #100 MoveToOffset([0.1]) END
IF HotKey(D) !HotKey(W) !HotKey(S) THEN RESPONSE #100 MoveToOffset([1.0]) END
IF HotKey(A) !HotKey(W) !HotKey(S) THEN RESPONSE #100 MoveToOffset([-1.0]) END
With this, I tested and I could move my character with WASD.
The problem? It only triggered each second. So it moved 1 position, waited 1 second, moved, waited... With the key pressed, it only moved every 1 second. I put "Instant-Permanent" at the settings and Absolute Duration. Did not work. Anyone interested in achieving this can bring some insight? I won't be able to continue this until tomorrow.
Also, auto-centered camera would be necessary. More coding here.
THIS IS POSSIBLE! This have to be possible.
If you question. I play multiplayer, mi partner moves 5 chars, and I move my char, so this helps me a lot. We like to play this way, don't judge. This could also work moving an entire party? Who knows. For soloplay, or multiplayer where u move 1 char, works.
5
Comments
I experimented with a better way of moving with WASD. Try this code:
I thought that too but... At practice doesn't work xD
I'm surrending for this. If you cannot avoid the 1 second delay, and timers cannot avoid the delay (minimum 1 second), then you cannot have a fluid movement. At least I'll try to make an auto-moving centered camera with this, but it's sad T_T
EDIT: Auto centered camera failed. Stops the movement...
I added some throttling so that the character isn't staggered by a constant key press.
It could be further improved by moving the mouse pointer back to its original position after pressing the WASD key.
As for the auto-centered camera, it was achieved as a part of Diablofication mod by marchitek.