Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Danimations

  1. #1
    I don't have anywhere to host this so is it ok to post here?

    Ok so now you're wondering: "how can i get the doors on my Uh-1 to slide open?" or "how can I open the bomb bay doors on my b52 bomber?", to tell you the truth its not that hard it's just a game of selection names, memory points and brains.

    PART 1

    First of all for examples sake I've created this little model of a windmill thingy. Now I want to make the rotor part rotate whenever I comeup to it and in my menu press "Rotate windmill". See picture here.

    now we need to name that part so the game recognises it. Ok we have to name it something that we will remember:

    Select the object that will be animated and right-click in the selections list, choose NEW. Type windmill as the selection name.

    Now we move to the Memory LOD where we have to create two points that will define the axis' around which the object will rotate. Create the points by pressing Insert and place them as shown here.

    Select both and make a new selection called osa windmill.
    Now everything is set and everything that is left is to add the following code into the CfgVehicles class in the config.cpp.

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">
    class All {};
    class Static: All {};
    class Building: Static {};
    class NonStrategic: Building {};
    class House: NonStrategic {};
    class windmill: House
    {
    *** animated=1;
    *** model="path to model.p3d";
    *** displayName="Windmill";
    *** class Animations
    *** {
    *** *** ***class animWindmill
    *** {
    *** *** *** angle0=0
    *** *** *** angle1="2 **** ***3.1415926"; // 2 * Pi
    *** *** *** multiplyer=20;
    *** *** *** type="rotation";
    *** *** *** animPeriod=1;
    *** *** *** selection="windmill"; // this is the selection we named in resolution LOD
    *** *** *** axis="osa windmill"; //the points selection acting as axis
    *** };
    *** };
    [/QUOTE]<span id='postcolor'>

    Now you want to add that function to your menu everytime you walk up to the windmill. Just after that add this code:

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">
    class UserAction
    {
    *** class rotateWindmill
    *** {
    *** *** *** displayName="Rotate windmill";
    *** *** *** positon="osa windmill";
    *** *** *** radius=10; //how far from the object u gotta be to be able to activate it.
    *** *** *** condition="this *** *** animationPhase ""windmill"" < 0.5";
    *** *** *** statement="this animate [""animWindmill"", 1]";
    *** ***};
    };
    [/QUOTE]<span id='postcolor'>

    save, Suff and play
    So you see its really not that hard, now I hope I dont have to tell you how to use that for more complex stuff I&#39;m sure you can figure that out...

    Have a nice time plain with it.




  2. #2
    Chief Warrant Officer Soul_Assassin's Avatar
    Join Date
    May 4 2002
    Posts
    3,188
    Author of the Thread
    Please post here any suggestion, aditions or corrections.

  3. #3
    Gunnery Sergeant
    Join Date
    Jul 12 2001
    Location
    Manassas, Virginia
    Posts
    416
    Is there a way to define an exact point on the object at which, when the player reaches that exact point, the action will be added to the player&#39;s menu? Using the Antonov add-on as an example, "Get in as pilot" shows up only when the player is at the left front of the fuselage of the aircraft? Is this something specific only to vehicles, or may I define a specific point or place on objects as well?

    "We gotta go to the crappy town where I'm a hero!"

  4. #4
    Chief Warrant Officer Soul_Assassin's Avatar
    Join Date
    May 4 2002
    Posts
    3,188
    Author of the Thread
    The thing you refer to is a memory point "pos driver" in memory LOD, its already predefined but in my example the distance is defined through the "radius = "";" parameter in the UserAction class.

  5. #5
    Whats is the animation type for a sliding animation.

  6. #6
    Yeah are u sure u can make objects properly slide, so u could make for example and elevator or sliding doors like u said?

    And csn u define the exact pint at which a animation can be triggered, not just in the radius but so u could put point away from animation - example:

    A prison door - u dont want area u have to be to open it right near the object cause then u could open it from both sides - even if u were in prison.

    U would want it on a control panel somehwere else - is that possible?

  7. #7
    Chief Warrant Officer Soul_Assassin's Avatar
    Join Date
    May 4 2002
    Posts
    3,188
    Author of the Thread
    *This is not tested

    In O2 in memory LOD put the point where u want to trigger call it "pos openmydoor" or "pos whateverulike" then in config.cpp in part:

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    class UserAction
    {
    class rotateWindmill
    {
    displayName=&#34;Rotate windmill&#34;;
    positon=&#34;osa windmill&#34;;
    radius=10; //how far from the object u gotta be to be able to activate it.
    condition=&#34;this animationPhase &#34;&#34;windmill&#34;&#34; &#60; 0.5&#34;;
    statement=&#34;this animate &#91;&#34;&#34;animWindmill&#34;&#34;, 1&#93;&#34;;
    };
    };

    [/QUOTE]<span id='postcolor'>

    in position put the "pos whateverulike" and set the radius. Tell me if it worked

  8. #8
    so at my place it doesnt work because of v1.46 took long but found the solution. but im still not able to find the "delete post"-button




  9. #9
    I mean how can i make a sliding door not just a rotating thing i have done it many times but i want the whole door just to slide left you right if you know what i mean like when you define the animation in the cpp theres the thing that says

    type="rotation";

    well is there like type sliding or something so doesn anyone know this.

  10. #10
    Chief Warrant Officer Soul_Assassin's Avatar
    Join Date
    May 4 2002
    Posts
    3,188
    Author of the Thread
    no other type than rotation is availiable right now

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •