<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Playing animations</title><link>https://sourceforge.net/p/sanandreasunity/wiki/Playing%2520animations/</link><description>Recent changes to Playing animations</description><atom:link href="https://sourceforge.net/p/sanandreasunity/wiki/Playing%20animations/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 24 Aug 2023 01:36:51 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/sanandreasunity/wiki/Playing%20animations/feed" rel="self" type="application/rss+xml"/><item><title>Playing animations modified by john lemmon</title><link>https://sourceforge.net/p/sanandreasunity/wiki/Playing%2520animations/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;There are 2 ways to play anim:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;using it's ifp file name and anim name&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;using it's anim group and index&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br/&gt;&lt;/p&gt;
&lt;h3 id="ifp-file-name-and-anim-name"&gt;Ifp file name and anim name&lt;/h3&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;PedModel.PlayAnim (fileName, animName);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For example: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;PedModel.PlayAnim ("ped", "roadcross");
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;this will play anim which is located in &lt;em&gt;ped.ifp&lt;/em&gt;, and which is called &lt;em&gt;roadcross&lt;/em&gt;&lt;/p&gt;
&lt;h3 id="anim-groups"&gt;Anim groups&lt;/h3&gt;
&lt;p&gt;Anims can be placed in groups. The idea is that peds' anims can be grouped, so that using the same index, you can play different anims for different ped groups.&lt;/p&gt;
&lt;p&gt;For example, if you use &lt;code&gt;AnimGroup.WalkCycle&lt;/code&gt; as anim group, and &lt;code&gt;AnimIndex.Walk&lt;/code&gt; as index, then when ped is a man, 'walk_civi' will be played, and when ped is a woman, 'woman_walknorm' will be played.&lt;/p&gt;
&lt;p&gt;Anim groups are defined inside &lt;code&gt;/Data/auxanimgrp.dat&lt;/code&gt; file. You can read more about file structure in that file.&lt;/p&gt;
&lt;p&gt;If you want to add new anims, you can add them to existing group, or create new group. After you added them to a file, you will need to update &lt;code&gt;AnimGroup&lt;/code&gt; and &lt;code&gt;AnimIndex&lt;/code&gt; enumerations, so that you can play those anims.&lt;/p&gt;
&lt;p&gt;Example for playing walk anim:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;PedModel.PlayAnim (AnimGroup.WalkCycle, AnimIndex.Walk)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;br/&gt;&lt;/p&gt;
&lt;h3 id="previewing-anims"&gt;Previewing anims&lt;/h3&gt;
&lt;p&gt;You can preview anims in game, from Animations window. Make sure "override player anims" is checked, and click on anim to play it.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">john lemmon</dc:creator><pubDate>Thu, 24 Aug 2023 01:36:51 -0000</pubDate><guid>https://sourceforge.net193604cfdddaadcd7892b395c3990da1a1ee135d</guid></item></channel></rss>