Jump to content
Sign in to follow this  
soul_assassin

Danimations

Recommended Posts

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

  };

  };

<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]";

   };

};

<span id='postcolor'>

save, Suff and play smile.gif

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'm sure you can figure that out...

Have a nice time plain with it.

Share this post


Link to post
Share on other sites

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'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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

*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="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]";

};

};

<span id='postcolor'>

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

Share this post


Link to post
Share on other sites

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 biggrin.gif

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Would it be possible to do this on parts of a gun?

I want my ammo to rotate through the gun, like in OFP Taiwan's machineguns. Can this be used to do that at about 1,2 revolutions per second?

Share this post


Link to post
Share on other sites

Yes it is possible, and has been demonstrated on several ocasions. Give me a vouple of hours and i will get back at u with how to do it.

Share this post


Link to post
Share on other sites

Oh, YESYESYESYES !!!!

PLEASE!!!

smile.gif

I want to let the "ammo belt" (actually a circle) to rotate VERY fast when firing. It's currently using the "revolve" animation, which rotates the object once for each magazine emptied.

Also see [ THIS ] thread.

I would be very thankful for your help!

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (NAA_Us_Marine @ Nov. 04 2002,00:22)</td></tr><tr><td id="QUOTE">What about sliding doors how can you do that.

I have seen them on alot of people making helo's these days.<span id='postcolor'>

I didn't check, but my guess is that it's a rotation with a very far point as the axis.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Matthijs @ Nov. 04 2002,09:51)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (NAA_Us_Marine @ Nov. 04 2002,00:22)</td></tr><tr><td id="QUOTE">What about sliding doors how can you do that.

I have seen them on alot of people making helo's these days.<span id='postcolor'>

I didn't check, but my guess is that it's a rotation with a very far point as the axis.<span id='postcolor'>

Yes it is. On the Huey I'm building for the Falklands mod the pivot point for the port door is on the starboard side and the starboard pivot on the port side. You have to experment with distances. the closer the pivot the smaller turning circle etc.

Heres the animation code I used:

// Door Animation

class Animations

{

class PrtDoor

{

type="rotation";

animPeriod=3;

selection="prtdoor";

axis="osa_prtdoor";

angle0=0;

angle1=0.2;

};

class StabDoor

{

type="rotation";

animPeriod=3;

selection="Stabdoor";

axis="osa_stabdoor";

angle0=0;

angle1=-0.2;

};

};

class UserActions

{

class OpenPrtdoor

{

displayName="Open Port Door";

position="osa_L";

radius=3;

condition="this animationPhase ""prtdoor"" < 0.5";

statement="this animate [""prtdoor"", 1]";

};

class ClosePrtdoor

{

displayName="Close Port Door";

position="osa_L";

radius=3;

condition="this animationPhase ""prtdoor"" >= 0.5";

statement="this animate [""prtdoor"", 0]";

};

class Openstabdoor

{

displayName="Open Starboard Door";

position="osa_R";

radius=3;

condition="this animationPhase ""Stabdoor"" < 0.5";

statement="this animate [""Stabdoor"", 1]";

};

class CloseStabdoor

{

displayName="Close Starboard Door";

position="osa_R";

radius=3;

condition="this animationPhase ""Stabdoor"" >= 0.5";

statement="this animate [""Stabdoor"", 0]";

};

};

Door activation position points and radius:

osa_R and osa_L are the position points in the memory lod where you want the doors to be activated from. ie osa_R is by the starboard door and osa_L by the port door. radius=3 is the distance from those points. Note: Make the radius big enough so it includes the pilot or copilot seat area for the respective sides.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Colonel_Klink @ Nov. 04 2002,12:07)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Matthijs @ Nov. 04 2002,09:51)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (NAA_Us_Marine @ Nov. 04 2002,00:22)</td></tr><tr><td id="QUOTE">What about sliding doors how can you do that.

I have seen them on alot of people making helo's these days.<span id='postcolor'>

I didn't check, but my guess is that it's a rotation with a very far point as the axis.<span id='postcolor'>

Yes it is. On the Huey I'm building for the Falklands mod the pivot point for the port door is on the starboard side and the starboard pivot on the port side. You have to experment with distances. the closer the pivot the smaller turning circle etc.

Heres the animation code I used:

// Door Animation

class Animations

{

class PrtDoor

{

type="rotation";

animPeriod=3;

selection="prtdoor";

axis="osa_prtdoor";

angle0=0;

angle1=0.2;

};

class StabDoor

{

type="rotation";

animPeriod=3;

selection="Stabdoor";

axis="osa_stabdoor";

angle0=0;

angle1=-0.2;

};

};

class UserActions

{

class OpenPrtdoor

{

displayName="Open Port Door";

position="osa_L";

radius=3;

condition="this animationPhase ""prtdoor"" < 0.5";

statement="this animate [""prtdoor"", 1]";

};

class ClosePrtdoor

{

displayName="Close Port Door";

position="osa_L";

radius=3;

condition="this animationPhase ""prtdoor"" >= 0.5";

statement="this animate [""prtdoor"", 0]";

};

class Openstabdoor

{

displayName="Open Starboard Door";

position="osa_R";

radius=3;

condition="this animationPhase ""Stabdoor"" < 0.5";

statement="this animate [""Stabdoor"", 1]";

};

class CloseStabdoor

{

displayName="Close Starboard Door";

position="osa_R";

radius=3;

condition="this animationPhase ""Stabdoor"" >= 0.5";

statement="this animate [""Stabdoor"", 0]";

};

};

Door activation position points and radius:

osa_R and osa_L are the position points in the memory lod where you want the doors to be activated from. ie osa_R is by the starboard door and osa_L by the port door. radius=3 is the distance from those points. Note: Make the radius big enough so it includes the pilot or copilot seat area for the respective sides.<span id='postcolor'>

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE"> Note: Make the radius big enough so it includes the pilot or copilot seat area for the respective sides.

<span id='postcolor'>

Hmm animations can't be triggered in-flight anyway so y really bother?

@Matthijs

Can you please post yuo config here?

PS: R u Dutch? If yes I live in Holland smile.gif

Share this post


Link to post
Share on other sites

Eyyyyyy!!!!

IF IT AIN'T DUTCH, IT AIN'T MUCH !!! marnsmile.gif

I live in Gorinchem. And you?

There's a lot I remarked out. But I guess you can see what I did.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// THE FN MAG/MAG58/GMPG/M240/C6 was created by W.M. Crielaard

// url: http://www.bbemariniers.net

// email: webmaster@bbemariniers.net

//

// This addon for Operation Flashpoint is shareware and can be distributed under the

// following conditions:

//

// If you want to use some or all of the content of this addon for your own work,

// send a request to webmaster@bbemariniers.net

//

// - Non commercial distribution only

// - Modified versions may never be packaged with the original versions

// - Modified versions may never have the same class names the original versions

// - Original packages may not be modified in any way

//

// Model\Skinning\Importing by Willem-Matthijs Crielaard

// config.cpp by Willem-Matthijs Crielaard

// Original optics by OFP Taiwan workshop

// Military consultancy by "Assault[CAN]" Tyler

// V1.0

class CfgPatches

{

class KM_Mod

{

units[] = {};

weapons[] = {KM_FNMAG};

requiredVersion = 1.2;

};

};

class CfgModels

{

class Default

{

sections[] = {};

sectionsInherit="";

};

class Weapon: Default{};

class km_fnmag: Weapon

{

sections[] = {"zasleh"};

};

class km_fnmagoptics: Weapon

{

sections[] = {"zasleh"};

};

};

//class CfgAmmo

//{

// class Default {};

// class BulletSingle: Default {};

// class Bullet7_6: BulletSingle {};

// class KM_762NATO: Bullet7_6

// {

// airLock=1;

// hit=10;

// cost=5;

// tracerColor[]={1,0.25000,0.12500,0.5};

// minRange=1;

// minRangeProbab=0.9;

// midRange=500;

// midRangeProbab=0.75;

// maxRange=1000;

// maxRangeProbab=0.25;

// };

//};

////////////////////////////////////////////////////////

// FNMAG + AMMO DEFINITION

////////////////////////////////////////////////////////

class CfgWeapons

{

class Default {};

class MGun : Default {};

class MachineGun7_6: MGun {};

class MachineGun7_6Manual: MachineGun7_6 {};

class KM_FNMAG: MachineGun7_6Manual

{

displayName="FN MAG";

weaponType=1;

model="\km_fnmag\km_fnmag.p3d";

picture="\km_fnmag\fnmaginv.paa";

scopeWeapon = 2;

scopeMagazine = 2;

modelOptics="\km_fnmag\km_fnmagoptics.p3d";

optics = true;

opticsFlare=0;

opticsZoomMin=0.35;

opticsZoomMax=0.35;

displayNameMagazine="FN MAG ammo box";

shortNameMagazine="FN MAG ammo";

reloadSound[]={"",1,1};

reloadMagazineSound[]={"\km_fnmag\fnmagreload.wav",db-70,1};

count=100;

magazines[] = {"KM_FNMAGMag"};

revolving="ammobelt";

revolvingAxis="ammobelt_ax";

revolvingspeed=0.1;

modes[] = {"gas1", "gas2", "gas3"};

class gas1

{

ammo=Bullet7_6W;

// ammo=KM_762NATO;

multiplier=1;

burst=1;

displayName="FN MAG, gas:1";

sound[]={"\km_fnmag\fnmag.wav",db10,1};

soundContinuous=0;

reloadTime=0.085000;

ffCount=6;

ffMagnitude=0.500000;

ffFrequency=11;

dispersion=0.002500;

aiDispersionCoefX=5.000000; // dispersion used to simulate horizontal burst

// aiDispersionCoefY=2.000000;

maxLeadSpeed=300;

recoil="mgunBurst3";

// recoil="riffleSingle";

autoFire = true;

useAction= false;

useActionTitle="";

aiRateOfFire=0;

aiRateOfFireDistance=0;

};

class gas2

{

ammo=Bullet7_6W;

// ammo=KM_762NATO;

multiplier=1;

burst=1;

displayName="FN MAG, gas:2";

sound[]={"\km_fnmag\fnmag.wav",db10,1};

soundContinuous=0;

reloadTime=0.070000;

ffCount=6;

ffMagnitude=0.500000;

ffFrequency=11;

dispersion=0.002500;

aiDispersionCoefX=5.000000; // dispersion used to simulate horizontal burst

// aiDispersionCoefY=2.000000;

maxLeadSpeed=300;

recoil="mgunBurst3";

// recoil="riffleSingle";

autoFire = true;

useAction= false;

useActionTitle="";

aiRateOfFire=0;

aiRateOfFireDistance=0;

};

class gas3

{

ammo=Bullet7_6W;

// ammo=KM_762NATO;

multiplier=1;

burst=1;

displayName="FN MAG, gas:3";

sound[]={"\km_fnmag\fnmag.wav",db10,1};

soundContinuous=0;

reloadTime=0.060000;

ffCount=6;

ffMagnitude=0.500000;

ffFrequency=11;

dispersion=0.002500;

aiDispersionCoefX=5.000000; // dispersion used to simulate horizontal burst

// aiDispersionCoefY=2.000000;

maxLeadSpeed=300;

recoil="mgunBurst3";

// recoil="riffleSingle";

autoFire = true;

useAction= false;

useActionTitle="";

aiRateOfFire=0;

aiRateOfFireDistance=0;

};

};

class KM_FNMAGMag : KM_FNMAG

{

picture="\km_fnmag\fnmagmaginv.paa";

};

};

class CfgVehicles

{

class All{};

class AllVehicles : All{};

class Land : AllVehicles{};

class Man : Land{};

class Soldier : Man{};

class SoldierWB : Soldier{};

class SoldierWMG: SoldierWB {}

class KM_Soldier_FNMAG : SoldierWMG

{

displayName="Machinegunner (FN MAG)";

weapons[]={"KM_FNMAG","Binocular","Throw","Put"};

magazines[]={ "KM_FNMAGMag", "KM_FNMAGMag", "KM_FNMAGMag", "KM_FNMAGMag", "KM_FNMAGMag" };

};

};

class CfgGroups

{

class KM_Mod

{

name="Korps Mariniers mod";

class KMequipment

{

name="NL KMARNS equipment";

class KM_FNMAG_Soldier

{

name="Machinegunner (FN MAG)";

class Unit0

{

side=1;

vehicle="KM_Soldier_FNMAG";

rank="Private";

position[]={0,2,0};

};

};

};

};

};

<span id='postcolor'>

Share this post


Link to post
Share on other sites

I live in Den Haag and the queen is my neighbour on Noordeinde smile.gif but im not dutch though but lived here for 7 years.

now about the rotation no matter what I try the speed satys the same sad.gif hmm im gonna try some more but i promise nothing

Share this post


Link to post
Share on other sites

I see that there is an animations called "revolve":

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// From Matthijs's Config.cpp

revolving="ammobelt"; // selection to ratate

revolvingAxis="ammobelt_ax"; //axis for rotation

revolvingspeed=0.1; // the speed of the rotation (rotation/x time in secs.)

<span id='postcolor'>

Correct me if I'm wrong.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Frugo_PL @ Nov. 04 2002,21:36)</td></tr><tr><td id="QUOTE">I see that there is an animations called "revolve":

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// From Matthijs's Config.cpp

revolving="ammobelt"; // selection to ratate

revolvingAxis="ammobelt_ax"; //axis for rotation

revolvingspeed=0.1; // the speed of the rotation (rotation/x time in secs.)

<span id='postcolor'>

Correct me if I'm wrong.<span id='postcolor'>

Sharp to notice!  tounge.gif

My question was: "(...) to do that at about 1,2 revolutions per second?"

And that's not possible with the "revolve" animation. The revolve animation rotates once per magazine emptied, to be used for a revolver. (duh...)

Oh, and the "REVOLVINGSPEED" does nothing. I just made that one up myself, tried to see if it had any effect, with different values. (unsurprisingly none whatsoever)

sad.gif

I also tried to find something in the CPP for the Vulcan, but again... nothing useful.

Share this post


Link to post
Share on other sites

Ok this is the config from GFX's Minigun - has very fast revolving animation - does aything in this helps or it it much the same as vulcan?

// type scope

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot 0// dummy weapons

#define WeaponSlotPrimary 1// primary weapons

#define WeaponSlotSecondary 16// secondary weapons

#define WeaponSlotItem 256// items

#define WeaponSlotBinocular 4096// binocular

#define WeaponHardMounted 65536

class CfgPatches

{

class hh_minigun_Soldier {units[] = {hh_minigun_Soldier}; weapons[] = {}; requiredVersion = 1.75; };

class hh_minigun {units[] = {hh_minigun}; weapons[] = {}; requiredVersion = 1.75; };

};

class CfgModels

{

class Default{};

class Weapon: Default{};

class minigun: Weapon{};

};

class CfgAmmo

{

class Default {};

class BulletSingle : Default {};

class hh_minigunAmmo: BulletSingle {

hit=20;indirectHit=0.1;indirectHitRange=0.1;

minRange=20;minRangeProbab=0.80;

midRange=500;midRangeProbab=0.95;

maxRange=3000;maxRangeProbab=0.05;

cost=30;

};

};

class CfgWeapons

{

class Default{};

class MGun: Default{};

class MachineGun7_6: MGun{};

class MachineGun7_6Manual: MachineGun7_6{};

class PK: MachineGun7_6Manual{};

class hh_minigun: PK

{

count=100;

model="\minigun\minigun";

modelOptics="optika_PK";

displayName="M134";

displayNameMagazine="M134 Magazine";

shortNameMagazine="M134";

drySound[]={"weapons\m16dry",0.000316,1};

ammo=hh_minigunAmmo;

initSpeed=600;

reloadTime=0.0500000;

magazineReloadTime=0.0500000;

autoReload=1;

dispersion=0.0015;

sound[]={"\minigun\minigun.wav",db0,1};

soundContinuous=0;

maxLeadSpeed=865;

picture="\minigun\w_minigun.paa";

revolving="barrels";

revolvingAxis="barrels_axis";

};

};

class CfgNonAIVehicles

{

class ProxyWeapon {};

class Proxyhh_minigun: ProxyWeapon {};

};

//Vehicle Settings

class CfgVehicles

{

class All{};

class AllVehicles:All{};

class Land:AllVehicles{};

class Man:Land{};

class Soldier:Man{};

class SoldierGB:Soldier{}

class hh_minigunSoldier: SoldierGB

{

//access=1;

displayName="Soldier (M134)";

weapons[]={"hh_minigun"};

magazines[]={"hh_minigun","hh_minigun","hh_minigun","hh_minigun&quo

t;,"hh_minigun"};

};

};

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">has very fast revolving animation<span id='postcolor'>

Is that the minigun from the bunker pack 5? If it is, then you have a weird definition of "fast". It revolves once per 100 shots! It's VERY slow! At least it revolves.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">

Note: Make the radius big enough so it includes the pilot or copilot seat area for the respective sides.<span id='postcolor'>

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">

Hmm animations can't be triggered in-flight anyway so y really bother?<span id='postcolor'>

True, but the reason the radius includes the pilot and copilot is to be able to close the doors once you board the helo. one way of getting the doors to open during flight would be to script them and use the Fire command to trigger a script inside the pbo.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×