Get CURRENT_SPEED;

Get CURRENT_SPEED;

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
User avatar
BlueIce
Posts: 61
Joined: 27 Sep 2005, 10:05

Get CURRENT_SPEED;

Post by BlueIce »

Code: Select all

	animtime = Get CURRENT_SPEED; //CURRENT_SPEED = 29
	animtime = ANIMFACTOR / animtime;
This Code don't work, spring give an error:

Cob error, unknown get costant 29.

How do I get the current speed of a unit?
User avatar
Kuroneko
Posts: 483
Joined: 03 Jan 2005, 05:32

Post by Kuroneko »

take out the // comment
User avatar
BlueIce
Posts: 61
Joined: 27 Sep 2005, 10:05

Post by BlueIce »

the real file don't have the comment
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

So is this a .bos you're trying to compile into a .cob?
User avatar
BlueIce
Posts: 61
Joined: 27 Sep 2005, 10:05

Post by BlueIce »

the bos compile without errors, but when I build the unit spring gives this error continuously. ("Cob error, unknown get costant 29.").

Code: Select all


MotionControl() 
{
 while (TRUE)
 {
  animtime = Get CURRENT_SPEED; 
  animtime = ANIMFACTOR / animtime;
  ///ANIMATION CODE [...]
  sleep(100)
 }
}
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Because Spring doesn't support getting the current speed...
User avatar
BlueIce
Posts: 61
Joined: 27 Sep 2005, 10:05

Post by BlueIce »

OK, tanks for the replies!
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

get CURRENT_SPEED; was from TA:Kingdoms, not from TA. Although some progress has been made, Spring doesn't fully support TA:K units yet.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

It would be trivial to add support for that, but i think we're just better off waiting for the new scripting language instead of coding, copiling, recoding, then recompiling for the new language :P
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

I disagree, and think it would be good to have Spring support all TA:K cob commands.
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

zwzsg wrote:I disagree, and think it would be good to have Spring support all TA:K cob commands.
Indeed. The new scripts won't replace the old ones, just give fresh developers much more powerful alternitives. Inclusion of the TA:K cob commands will allow tonnes of old units to be dumped into spring much like the current old units were. Mod makers love units they don't have to fabricate from scratch.
User avatar
BlueIce
Posts: 61
Joined: 27 Sep 2005, 10:05

Post by BlueIce »

Will the new scripts support external model animations?
Post Reply

Return to “Game Development”