Jump to content
Sign in to follow this  
snkman

SpeedMode incorrect?

Recommended Posts

Hey Guy's,

well i just tryed to find out the speed mode of the units using:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#start

_grpspeed1 = speedMode grp1

?grp1 speedmode = "FULL" : hint "FULL"

titletext[format ["\n\n\n %1 ",_grpspeed1], "Plain down"]

~3

goto "start"

But with titletext i always get SpeedMode "NORMAL" and the hint messege is never shown up...

Is this a bug or did i do something wrong?

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?grp1 speedmode == "FULL" : hint "FULL"

You drop an equals sign.

Share this post


Link to post
Share on other sites

Hey Mr.Peanut,

nope that was not the problem.

It think it's a bug becouse if fast i run fast it shows NORMAL and if i walk slow it show NORMAL too.. crazy_o.gif

Edit: Okay i don't know why but it looks like speedMode is only working with AI and not with Players.

Share this post


Link to post
Share on other sites

That is correct. SpeedMode is an enumeration of AI behavior. I signifies that they should move as quickly as possible to next waypoint. It does NOT mean they should run full speed 100% of the time as if double tapping the forward keys.

As with most of those commands, they do not and probably never will apply to player controlled units.

If you want to determine the velocity of the player, I would use the many commands available for that (i.e. velocity player) and building your own custom enumeration (if so needed).

Share this post


Link to post
Share on other sites

I already tryed the velocity command but if i use the example i always get an error:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? velocity player > 2 : hint "FULL"

velocity player |#|> 2

Error: >: Typ Array, expected number

Share this post


Link to post
Share on other sites

If you use speed in cars the speed hint will go crazy when you stop the car for about 5 secs. It is pretty annoying.

Share this post


Link to post
Share on other sites
Quote[/b] ]?grp1 speedmode = "FULL" : hint "FULL"

try

Quote[/b] ]?speedmode grp1 == "FULL" : hint "FULL"

Share this post


Link to post
Share on other sites
I already tryed the velocity command but if i use the example i always get an error:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? velocity player > 2 : hint "FULL"

velocity player |#|> 2

Error: >: Typ Array, expected number

Velocity doesn't return a number, it returns a velocity vector in the form of an array of 3 component vectors (the x, y, and z components). You need to either calculate its magnitude (Pythagorean theorem) or use the speed command.

Share this post


Link to post
Share on other sites

Thanks for the replay's guy's.

I think i stick to the speed command it's easy to use and it's good for what i need it.

So THX to all. smile_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×