View topic - MoveRate?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: MoveRate?
PostPosted: 02 Oct 2011, 21:09 

Joined: 21 Aug 2011, 00:59
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.


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 03 Oct 2011, 07:47 
User avatar

Joined: 01 Apr 2010, 20:05
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.


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 03 Oct 2011, 11:39 

Joined: 21 Aug 2011, 00:59
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.


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 03 Oct 2011, 11:50 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
oh now you say cob :/ well for lua maybe this:
http://answers.springlobby.info/questions/606/how-do-i-animate-aircraft-as-their-landing-or-taking-off


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 03 Oct 2011, 12:36 

Joined: 21 Aug 2011, 00:59
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!


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 03 Oct 2011, 14:58 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
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.


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 03 Oct 2011, 17:45 

Joined: 21 Aug 2011, 00:59
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?


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 03 Oct 2011, 18:55 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
You could just do:

Code:
#define PRINT 81

MoveRate0() {
get PRINT (0);
}

MoveRate1() {
get PRINT (1);
}

MoveRate2() {
get PRINT (2);
}


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 03 Oct 2011, 20:31 

Joined: 21 Aug 2011, 00:59
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.


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 03 Oct 2011, 21:40 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
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


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 04 Oct 2011, 21:43 

Joined: 21 Aug 2011, 00:59
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?


Top
 Offline Profile  
 
 Post subject: Re: MoveRate?
PostPosted: 04 Oct 2011, 21:47 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
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.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.