my fishy wont move (importing animations)

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

eskarn

FNG / Fresh Meat
Feb 25, 2010
55
3
0
29
Perth, WA, Austraila
ok so i have a fishy and he moves just fine in the animation browser but he doesn't move in game

why wont my fishy move
 

Attachments

  • fishymoving.jpg
    fishymoving.jpg
    54.3 KB · Views: 0
  • fishywontmove.jpg
    fishywontmove.jpg
    83.4 KB · Views: 0

YoYoBatty

FNG / Fresh Meat
Dec 17, 2009
3,459
2,502
0
Canada
You have to make an actor that extends the FloatyClot actor which extends the Decoration actor and change the mesh to your fish mesh. Also put this code in and compile it:

simulated function PostBeginPlay()
{
if( Level.NetMode!=NM_DedicatedServer )
LoopAnim('REPLACE WITH YOUR ANIMATION NAME!');
}
If you are wondering why it doens't play in the ed is because anything intended to move in game won't in the editor.
 

Falidell

FNG / Fresh Meat
May 22, 2009
646
78
0
33
Mesa,Az,USA
well what you can do is make your fishy a pawn subclass just a quicky subclass pawn with the mesh and texture set no other code.

then what you can do is when you want to trigger the animation just use the scripted trigger and the action you will be looking for is Action_PlayAnim

you can set that trigger to loop, or play a certain amount of play iterations via AnimIterations

stuff like that.... =)

so again
thing you want to play an animation when triggered needs to be a pawn subclass(i think it could be a deco, im not sure thats why i say it needs to be a pawn subclass.. feel free to try the floatyclot subclass if you please)

and to trigger animation
Code:
Scripted trigger
(0)Action_WaitForEvent
(1)Action_PlayAnim
(2)"whatever the heck you want :P "
 

ro_sauce

FNG / Fresh Meat
Sep 26, 2007
3,134
329
0
bwhgaming.com
here's what i used. copied an edited from the wikishark, and then tested and tried and recompiled.

Code:
//=============================================================================
// Dancer.
//=============================================================================
class dancer extends Decoration;

#exec texture   IMPORT      NAME=dancerbody  FILE=Textures\Dancer_body_2.dds


#exec DECAANIM  IMPORT      ANIM=Dances ANIMFILE=models\dances.PSA COMPRESS=1
#exec ANIM SEQUENCE ANIM=Dances SEQ=s_cheer2 GROUP= RATE=20.000000
#exec DECAANIM  DIGEST      ANIM=Dances VERBOSE USERAWINFO

#exec DECAMESH  MODELIMPORT MESH=Dancer MODELFILE=models\dancer2.PSK
#exec DECAMESH  ORIGIN      MESH=Dancer X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
#exec DECAMESH  scale       MESH=Dancer X=1.0 Y=1.0 Z=1.0
#exec DECAMESH  DEFAULTANIM MESH=Dancer ANIM=dances
#exec DECAMESH  SETTEXTURE  MESH=Dancer NUM=0 TEXTURE=Dancer_body_2
#exec DECAMESH  SETTEXTURE  MESH=Dancer NUM=1 TEXTURE=Dancer_body_2

simulated function PostBeginPlay()
{
    LoopAnim('s_cheer2');
    Super.PostBeginPlay();
}
 

Raziel

FNG / Fresh Meat
Mar 21, 2009
538
149
0
Valhalla
www.facebook.com
then what you can do is when you want to trigger the animation just use the scripted trigger and the action you will be looking for is Action_PlayAnim
Tried this some time ago, but looping the animation didn't work.
The pawn froze at the end of the animation and did float around the map from time to time.
Did you manage to set up a looped animation like this ? Not sure what I've done wrong.
 

ro_sauce

FNG / Fresh Meat
Sep 26, 2007
3,134
329
0
bwhgaming.com
simulated function postbeginplay()

event trigger(actor other, pawn eveninstigator)
{
playanim('animationsequencename', 1.00)
}

oops, you want it to trigger and loop, so instead of playanim, use loopanim.
you can also specify the framerate it plays and umm, other stuff.
someone please correct me if i'm wrong, i'm ultra noob at coding right now.
 
Last edited: