Animation Speed

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Animation Speed

Post by metal_head »

I'm sure I have seen this somewhere,but now when I need i,I can't find it. What I need is to make make an animation faster only in the script. Why? Because I can't get one of my enemies animation fast enough (it's a SMD import from a model).
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: Animation Speed

Post by bernie »

Look in the documents its there.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Animation Speed

Post by metal_head »

Well,I know that the command

Code: Select all

AnimationSpeed
is for that,but I'm not sure how to use it :D,and in the manual it's not explained (sorry,I should have started with this in first place). I tried,but didn't succeed with it. After the Animate order I put

Code: Select all

AnimationSpeed(7);
but nothing changed.
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: Animation Speed

Post by QuestOfDreams »

Show us the whole order you are using it in ... :roll:
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Animation Speed

Post by metal_head »

Here it is: :)

Code: Select all

monster_run_start[ ()
	{ 
		TargetPlayer();
		UpdateEnemyVis(true); 			
		UpdateTarget();
		Animate(RUN);				
                          AnimationSpeed(7);
		self.ThinkTime = 0;			
		self.think = "monster_run";		
		self.ideal_yaw = enemy_yaw;		
		self.yaw_speed = YAWSPEED;		
		back_up = false;				
		attack_state = AS_NONE;			
		melee_time = time;
		run_sound_time = time;
	} ]
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Animation Speed

Post by Jay »

It's a low level order. AnimationSpeed(...) is a high level command. There must be a variable like self.animate_speed or somethign like that. You would set that variable to the number you would enter in AnimationSpeed(x) (i am using a computer at the university now, so i cannot look it up)

Normally one would use the AnimationSpeed(...) command in the setup order to set the animation speed for the actor one time (this requires that the animations fit to each other. I mean they all have to have the same speed in relation to each other)
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: Animation Speed

Post by QuestOfDreams »

Actually it is both, a high level and low level method. However, I just noticed that they don't do the same thing ... the high level method is multiplying the current animation speed whereas the low level version is setting the animation speed to the given value. (I'll synchronize that in the next version ...).
Both should work tough, try calling AnimationSpeed before setting the animation ...
As Jay said, this command affects the speed of all animations.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Animation Speed

Post by metal_head »

Actually it is both, a high level and low level method.
Yeah,I saw it in the manual,but it's fine now,it works,when I tried it for the ifrst time,I haven't noticed the difference,but when I set a higher value,the difference could be seen. Thanks,guys!
Post Reply