Page 1 of 1

MoveRate?

Posted: 02 Oct 2011, 22:09
by wedge72
does moverate work properly for planes? I was trying to animate some wings to sweep back as a plane approaches maximum velocity but I am having no luck with it.

Re: MoveRate?

Posted: 03 Oct 2011, 08:47
by Karl
BrakeRate=4;
Acceleration=0.15;
Try to play around with those variable

http://springrts.com/wiki/Units-UnitDefs#Aircraft

Has some useful variable to play around.

Re: MoveRate?

Posted: 03 Oct 2011, 12:39
by wedge72
Thank you for the reply, Karl, what I am trying to do is get some wings to sweep back using some animations in the MoveRate2 call in the COB scripts, and I've not seen any indication that it is getting called at all. I was looking for other MoveRate calls in some of the other aircraft scripts in BA and noticed the armhawk has a barrel roll animation in there. I've not seen any hawk doing a barrel roll either :/ So I was wondering if these even work properly in COB files anymore.

Re: MoveRate?

Posted: 03 Oct 2011, 12:50
by knorke
oh now you say cob :/ well for lua maybe this:
http://answers.springlobby.info/questio ... taking-off

Re: MoveRate?

Posted: 03 Oct 2011, 13:36
by wedge72
Yeah, thank you, Knorke. I was really hoping for a cob solution, it is just what every unit in BA uses and is what I'm more familiar with. Is there any means to echo something to the game messages from within the cob? Just so I can place a text message in the MoveRate2 or other MoveRates to see if it gets called at all? Now I'm obsessed with even the hawks not doing barrel rolls :( and it is terrible when I don't know how to fix them!

Re: MoveRate?

Posted: 03 Oct 2011, 15:58
by FLOZi
From COB you can call

get PRINT (a,b,c,d);

where a to d are vars, PRINT should be defined in your standard include, if not, it is 81.

If MoveRate is being called in LUS it is (most probably) being called in COB, and vice versa, although LUS has just one MoveRate(number) instead of MoveRate1(), MoveRate2(), etc.

Re: MoveRate?

Posted: 03 Oct 2011, 18:45
by wedge72
Thank you, Flozi. Ok, so I set up a static variable to have the value of the corresponding moverate,

MoveRate0()
{
sv = 0;
}

MoveRate1()
{
sv = 1;
}...

and I tried to put a get Print(sv) in the fireprimary function but I'm not seeing any output. what is the syntax I need or am I doing this all wrong?

Re: MoveRate?

Posted: 03 Oct 2011, 19:55
by FLOZi
You could just do:

Code: Select all

#define PRINT 81

MoveRate0() {
get PRINT (0);
}

MoveRate1() {
get PRINT (1);
}

MoveRate2() {
get PRINT (2);
}

Re: MoveRate?

Posted: 03 Oct 2011, 21:31
by wedge72
ok, I did get it to output to the chat, but nothing from within the moverates is being output, like the functions aren't being called at all.

I did it as I did above, with the variable being output to chat when the primary is fired. In Create I set the variable to 10, in each moverate I set it to the corresponding number followed with a get PRINT (sv). The only number I'm seeing in chat is 10, and only when the weapon fires. The prints in the MoveRatex() aren't showing and the variable isn't being changed from 10.

Re: MoveRate?

Posted: 03 Oct 2011, 22:40
by FLOZi
From a quick grep of the engine source, it looks like it is only ever called for gunship type aircraft i.e. those with hoverAttack = true

Re: MoveRate?

Posted: 04 Oct 2011, 22:43
by wedge72
well that sucks all the cream out of my coffee :(
Thank you for checking that, Flozi. Do you happen to know why all the aircraft weren't included?

Re: MoveRate?

Posted: 04 Oct 2011, 22:47
by FLOZi
Not the foggiest. Maybe it was that was in TA or its just a consequence of how different the movetypes are.

You could probably write a gadget to call it as and when you liked.