Tiberian Sun WASD Solution. Topic is solved

Ask gaming related questions
Despot Aspid
Posts: 7
Joined: 05 Jan 2024, 23:41

Tiberian Sun WASD Solution.

08 Jan 2024, 11:52

Good Day!

C&C Tiberian Sun has no keys to scroll map. Only RButton + MouseMove or edge scrolling. It is not comfortable.

Help me please make a script that will [hold down the right mouse button and move the mouse to the left] while button [a] is pressed. I need an example.
I tried the script myself, but it's terrible and moves jerkily.

Code: Select all

Send "{RButton down}"
Sleep(15)
MouseMove -1000, 0, 0, "R"
Send "{RButton up}"
Sleep(15)
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code!]
Despot Aspid
Posts: 7
Joined: 05 Jan 2024, 23:41

Re: Tiberian Sun WASD Solution.

08 Jan 2024, 12:49

This is better but cursor disappears and reappears. It's annoying.

Code: Select all

a::
{
MouseGetPos &xpos, &ypos
	Loop
	{
	MouseMove -1, 0, 100, "R"	
	if (!GetKeyState("a", "P"))
		{
		MouseMove xpos, ypos
		break
		}
	}
}
And I think this problem can't be solved...
Sorry for my English.


[Mod edit: Added [code][/code] tags. Please use them yourself when posting code!]
User avatar
boiler
Posts: 17706
Joined: 21 Dec 2014, 02:44

Re: Tiberian Sun WASD Solution.

08 Jan 2024, 13:02

@Despot Aspid — The moderators have been adding [code][/code] tags to your posts. Please use them yourself when posting code on the forum! Thank you.
User avatar
Noitalommi_2
Posts: 393
Joined: 16 Aug 2023, 10:58

Re: Tiberian Sun WASD Solution.  Topic is solved

08 Jan 2024, 15:12

@Despot Aspid

Hi.

Scrolling is a bit awkward in this game, so I couldn't find a better solution. This script lacks smooth scrolling in all 8 directions, but at least it works in four directions and the scrolling speed is constant.

Code: Select all

#Requires AutoHotkey >=2.0
#SingleInstance

S := Speed := 20
Keys := Map("w", "Up",
			"a", "Left",
			"s", "Down",
			"d", "Right")

For Key, Direction in Keys
	Hotkey Key, ScrollMap.Bind(Direction)
ScrollMap(D, K) {

	BlockInput "MouseMove"
	SendEvent("{RButton down}")
	Loop 2
		Mousemove(D = "Up" || D = "Down" ? 0
				: D = "Left" ? -S : D = "Right" ? S : 0
				, D = "Left" || D = "Right" ? 0
				: D = "Up" ? -S : D = "Down" ? S : 0
				,, "R" )
	KeyWait(K)
		SendEvent("{RButton up}")
	BlockInput "MouseMoveOff"
}

Return to “Gaming Help (v2)”

Who is online

Users browsing this forum: No registered users and 19 guests