MoveRate?

MoveRate?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
wedge72
Posts: 15
Joined: 21 Aug 2011, 01:59

MoveRate?

Post 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.
User avatar
Karl
Panzerstahl Developer
Posts: 746
Joined: 01 Apr 2010, 21:05

Re: MoveRate?

Post 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.
wedge72
Posts: 15
Joined: 21 Aug 2011, 01:59

Re: MoveRate?

Post 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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: MoveRate?

Post by knorke »

oh now you say cob :/ well for lua maybe this:
http://answers.springlobby.info/questio ... taking-off
wedge72
Posts: 15
Joined: 21 Aug 2011, 01:59

Re: MoveRate?

Post 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!
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: MoveRate?

Post 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.
wedge72
Posts: 15
Joined: 21 Aug 2011, 01:59

Re: MoveRate?

Post 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?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: MoveRate?

Post by FLOZi »

You could just do:

Code: Select all

#define PRINT 81

MoveRate0() {
get PRINT (0);
}

MoveRate1() {
get PRINT (1);
}

MoveRate2() {
get PRINT (2);
}
wedge72
Posts: 15
Joined: 21 Aug 2011, 01:59

Re: MoveRate?

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: MoveRate?

Post 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
wedge72
Posts: 15
Joined: 21 Aug 2011, 01:59

Re: MoveRate?

Post 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?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: MoveRate?

Post 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.
Post Reply

Return to “Game Development”