Page 1 of 1

Walking or Running

Posted: Mon Aug 23, 2004 2:51 pm
by Fippy
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 ?.

Posted: Mon Aug 23, 2004 3:27 pm
by Me.Name
${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.

Posted: Mon Aug 23, 2004 4:16 pm
by aChallenged1
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.

Posted: Mon Aug 23, 2004 4:48 pm
by Sparr
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.

Posted: Mon Aug 23, 2004 4:51 pm
by Sparr
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.

Posted: Mon Aug 23, 2004 5:10 pm
by Night Hawk
Hmm are you sure? Walking looks like a lot different from running to me. :?

Posted: Mon Aug 23, 2004 6:31 pm
by Fippy
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

Posted: Mon Aug 23, 2004 7:14 pm
by Mimatas
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]

Posted: Mon Aug 23, 2004 10:47 pm
by Terramantian
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...

Posted: Sat Sep 04, 2004 3:06 pm
by Fippy
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.

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

Posted: Sun Oct 31, 2004 5:05 pm
by Zornecro
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

Posted: Sun Oct 31, 2004 11:19 pm
by zanomo
Nice... :D

Posted: Sun Oct 31, 2004 11:35 pm
by Cr4zyb4rd
Just play a bard, and it won't really matter either way :twisted:

Posted: Mon Nov 01, 2004 12:57 am
by Chill
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:

Posted: Mon Nov 01, 2004 3:17 am
by Cr4zyb4rd
ZING!