Walking or Running

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Walking or Running

Post by Fippy » Mon Aug 23, 2004 2:51 pm

Ok before I go off and write a routine to tell me if I am walking or running by checking which ${Me.Animation} is being played can anybody think of a better way of doing it ?.
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

Me.Name
a lesser mummy
a lesser mummy
Posts: 56
Joined: Thu Mar 11, 2004 11:49 pm
Location: ${Me.Bound}

Post by Me.Name » Mon Aug 23, 2004 3:27 pm

${Me.Speed} returns a float. I guess you'd need to find the values for your character run and walk speed in-game first. Might be a pain if you need to account for other speed effects though (SoW, low HP, etc.).

Just a thought.

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Mon Aug 23, 2004 4:16 pm

The Action window contains a toggle button Walk/Run. It is possible to read such a button, though I don't know the name of the window, nor do I know that there is support for that window as it would rarely need to be used.. That would allow you to figure out via a macro which you are doing.

It's something to look into anyway.

You could always do a check vs current speed.
To find out walk speed /echo ${Int[${Me.Speed}]} while in walk mode.
Run mode unless low on HP or over burdoned will be => 100.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

Sparr
a hill giant
a hill giant
Posts: 159
Joined: Mon Jun 24, 2002 5:41 am

Post by Sparr » Mon Aug 23, 2004 4:48 pm

walk and run are seperate buttons that overlap, when you click them their stacking order changes. stacking is NOT accessible via MQ2Data, although you could easily add it since its in the struct as CSIDLWND->ZLayer i think.
[img]http://www.trifocus.net/~sparr/sparr_rotate_sig_16.gif[/img]

Sparr
a hill giant
a hill giant
Posts: 159
Joined: Mon Jun 24, 2002 5:41 am

Post by Sparr » Mon Aug 23, 2004 4:51 pm

also, walk/run doesnt affect your animation. the animation is purely speed based. if you have sow and are running but are super encumbered and moving slow youll show the walk animation.
[img]http://www.trifocus.net/~sparr/sparr_rotate_sig_16.gif[/img]

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Mon Aug 23, 2004 5:10 pm

Hmm are you sure? Walking looks like a lot different from running to me. :?

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Mon Aug 23, 2004 6:31 pm

Well I did some testing with animation and under normal circumstances the walk animation and run animation are different. Since I am only concearned about your deciding wether to slow down or not then being so encumbered that you can only walk will not cause a problem.

As a side note the walk animation is used when strafing and walking backwards too. From the behaviour of encumberance I am betting that there is sort of lookup as to what point your speed drop flicks from the running anim to the walking one. Dunno how to go about finding that out though. I aint got round to learning decompiling and assembly etc yet I only just started learnign C++ :P
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

Mimatas
a hill giant
a hill giant
Posts: 262
Joined: Wed Mar 10, 2004 4:22 pm

Post by Mimatas » Mon Aug 23, 2004 7:14 pm

also, walk/run doesnt affect your animation. the animation is purely speed based. if you have sow and are running but are super encumbered and moving slow youll show the walk animation.
Techincally, Sparr is correct. No matter what your toggle is set to, if your run speed is slow, you will show the slow animation.. if your run speed is fast, you will show the fast animation.

Having said this, it could also be said that if you are encumbered, you are walking, no matter what your toggle actually says.

As for determining WHEN you start to run... I think drogmors/horses could help with that. Since moving on a horse has a much slower rate of acceleration, you could theoretically run a macro that does the following (in horribly inaccurate MQ Psudocode):

Code: Select all

 

Sub main
/declare myspeed
:loop
/varset myspeed ${Me.CurrentSpeed}
/if (Me.Animation==Running) {
/echo myspeed
/return
}
/goto :loop

note: this is not the most efficient way to do this. Ideally, you could just echo the value without storing it. However, I was writing this with the idea that the value would be stored and used later.. or stored in an array for averaging (unfortunately, I don't know how to do MQ2 arrays)

Basically code that spits out your speed the second you start running. Since drogmors have different running/walking animations as well, but accelerate more slowly, using it's animation to determine run speed could be done. This, of course, assumes that run speed is the same when mounted as when you're not. [/quote]

Terramantian
a ghoul
a ghoul
Posts: 120
Joined: Thu May 13, 2004 6:20 pm

Post by Terramantian » Mon Aug 23, 2004 10:47 pm

Who cares about run speed? It can be altered by so many things... if you want to be sure you're running, just throw in a

Code: Select all

/notify actionsmainpage AMP_RunButton leftmouseup
as someone said, it is a different button than walk, so even if you're already running it'll work. I can't think of a circumstance where you'd just need to know if you're running or walking, without wanting to make sure you are...

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Sat Sep 04, 2004 3:06 pm

OK That was nearly right Terramantian

Code: Select all

/notify ActionsWindow AMP_RunButton leftmouseup
and if anybody else is interested your can check if you are running or not using this.

Code: Select all

${Window[ActionsWindow].Child[ActionsMainPage].Child[AMP_WalkButton].Open}
If the walk button is open ie visible this will return true so you are currently running.
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

User avatar
Zornecro
a ghoul
a ghoul
Posts: 82
Joined: Sun Sep 19, 2004 10:19 pm
Location: El Paso, TX

How to force run/walk without a 3-child IF chain

Post by Zornecro » Sun Oct 31, 2004 5:05 pm

Want to be sure you're in RUN mode?

Code: Select all

/notify ActionsMainPage AMP_RunButton leftmouseup
Want to be sure you're in WALK mode?

Code: Select all

/notify ActionsMainPage AMP_WalkButton leftmouseup
Q.E.D. :twisted:

(Unlike the IF logic above which returns TRUE regardless of being in run or walk mode.) :P
- Zornecro Mancer, Retired EQ1 Veeshan
- Unktehila, Redtigre, Twinaxe, EQ2 Crushbone

zanomo
a hill giant
a hill giant
Posts: 285
Joined: Thu Jun 24, 2004 11:21 pm

Post by zanomo » Sun Oct 31, 2004 11:19 pm

Nice... :D

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Sun Oct 31, 2004 11:35 pm

Just play a bard, and it won't really matter either way :twisted:

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Mon Nov 01, 2004 12:57 am

Cr4zyb4rd wrote:Just play a bard, and it won't really matter either way :twisted:
Nod, they are useless whether they run or walk. :lol:

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Mon Nov 01, 2004 3:17 am

ZING!