Make a pawn imitate animations
Make a pawn imitate animations
I am trying to make a pawn imitate the animation of the player. So if the player is walking the pawn is walking, if the player is jumping the pawn is jumping and so on.
I know I have to script it, I got the pawn following me correctly, but I dont' know the commands to get the players current animation and apply it to the pawn. Help would be great!
Also, is there a reference to the scripting that tells us names of attributes we can get and functions we can perform for this scripting language?
I know I have to script it, I got the pawn following me correctly, but I dont' know the commands to get the players current animation and apply it to the pawn. Help would be great!
Also, is there a reference to the scripting that tells us names of attributes we can get and functions we can perform for this scripting language?
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Exactly. With that in, you can then just tell the pawn to set the animation to the player's animation constantly.
(slightly offtopic, but is that the version of self.player_animation I made? just curious)QuestOfDreams wrote:In the RF075A release there is a new pawn script variable that returns the player's animation (self.player_animation)
RF2 site: http://realityfactory2.sourceforge.net/
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
No problem, just glad I could get SOME code into RF1, I never had the proper compiler so I couldn't... Thanks!
RF2 site: http://realityfactory2.sourceforge.net/
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
so would it be someting simular to this? (obviously not this, cause if it worked i wouldn't be asking the question) Sorry just not familiar with the language trying to learn it, but definately am lost.
Code: Select all
{
PANIM [Idle];
Spawn[()
{
LowLevel("anim");
}]
anim[()
{
PawnRender(true);
PlayAnimation(PANIM, true, "");
self.ThinkTime = 1;
self.think = "update";
}]
update[()
{
PANIM = self.player_animation;
self.think = "anim";
}]
}
I could be way off, but try this. (It's been awhile since I used simkin; expect a few errors)
Code: Select all
{
PANIM [Idle];
Spawn[()
{
LowLevel("anim");
}]
anim[()
{
PawnRender(true);
PlayAnimation(PANIM, true, "");
self.ThinkTime = 1;
self.think = "update";
}]
update[()
{
if(PANIM != self.player_animation)
{
PANIM = self.player_animation;
self.think = "anim";
}
}]
}
RF2 site: http://realityfactory2.sourceforge.net/
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Re: Make a pawn imitate animations
Fallen wrote: Also, is there a reference to the scripting that tells us names of attributes we can get and functions we can perform for this scripting language?
Thank you, missed that link when looking through the online help.
Good grief, maybe I should avoid even trying, it's pretty clear I haven't used simkin in awhile!QuestOfDreams wrote:PlayAnimation is a high level command which can't be used in a low level order...
RF2 site: http://realityfactory2.sourceforge.net/
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
RF2 tasks: http://sourceforge.net/pm/?group_id=179085
Incase someone else searches for this in the future, this works well.
Code: Select all
{
PANIM [Idle]
Spawn[()
{
LowLevel("setup");
}]
setup[()
{
self.think = "update";
}]
update[()
{
self.ThinkTime = 0.0;
self.think = "fll";
}]
fll[ ()
{
if(self.player_animation != PANIM){
Animate(self.player_animation);
}
PANIM = self.player_animation;
}]
}