Jump to content
Sign in to follow this  
konyo

Sliding door, not rotation.

Recommended Posts

Im currently trying to make a cargo door on a helicopter slide open. Ive got it all defined in model.cfg and config.cpp however when i go in game the door rotates inwards? Not sliding across as it should? :confused:

However looking into model.cfg this is why :

type = "rotation";

What is the type that makes it slide open?

And 2 axis points in middle of door or at beginging and end?

Regards,

Share this post


Link to post
Share on other sites
http://community.bistudio.com/wiki/Model_Config#Animation_types

Please do search the biki for such answers.

For the memory points it doesn't matter. I think you can do it either in units or in the percent of the axis. It might be easiest to put a memory point at the beginning and end.

Sorry thanks, never think to check Biki.

Got it working, its sliding but its sliding the wrong way? Need it to go other way?

Currently got translationZ

Share this post


Link to post
Share on other sites

You can turn around your axis by rotating it 180 degrees, or you can play with the offset0 and 1 values. First, try offset1 = -1.

Share this post


Link to post
Share on other sites
You can turn around your axis by rotating it 180 degrees, or you can play with the offset0 and 1 values. First, try offset1 = -1.

It runs the animation without an axis :) Where do i put offset? Model.cfg or config?

Share this post


Link to post
Share on other sites

You can see the parameters for animations in the model config in the website I gave you. I think this is what the base translation animation looks like (I'm sure there are people that know more about it):

class Translation
{
       type = "translation";
       source = "";
sourceaddress = "";
       selection = "";
       memory = true;
       axis = "";
       begin = "";
       end = "";
minValue = 0;
maxValue = 1;
       minPhase = 0;
       maxPhase = 1;
offset0 = 0;
offset1 = 1;
};

Not all of those things have to be filled in, and in some cases the biki isn't clear, but all of those are explained in the animation properties part.

Share this post


Link to post
Share on other sites
You can see the parameters for animations in the model config in the website I gave you. I think this is what the base translation animation looks like (I'm sure there are people that know more about it):

class Translation
{
       type = "translation";
       source = "";
sourceaddress = "";
       selection = "";
       memory = true;
       axis = "";
       begin = "";
       end = "";
minValue = 0;
maxValue = 1;
       minPhase = 0;
       maxPhase = 1;
offset0 = 0;
offset1 = 1;
};

Not all of those things have to be filled in, and in some cases the biki isn't clear, but all of those are explained in the animation properties part.

Got it working now, just decided to make the model start with the door open, and it closes the right way etc.

Only trouble is when i open it, the option dont come up to close it again?

Think its because the animation is too short.

"this animate[""Ani_DriW"",0]"; - CLOSE

"this animate[""Ani_GunW"",0.6]"; - OPEN

As its 0.6, when i close it with 0, there is no option, but when i put it to 1 the option comes up to close it? :/

Share this post


Link to post
Share on other sites

you need to make user actions for those those animation sources, and make sure that they are configured properly. Your user action script probably has the condition > 0.9 or something. You should probably change that to 0.5;

Share this post


Link to post
Share on other sites
you need to make user actions for those those animation sources, and make sure that they are configured properly. Your user action script probably has the condition > 0.9 or something. You should probably change that to 0.5;

The user condition already has > 0.5:

class AnimationSources 
       { 
           class Ani_DriW 
           { 
               source = "user"; 
               animPeriod = 2; 
               initPhase = 0; 
           };
}; 
class UserActions
{
       class CloseWindow1 
       { 
               displayName = "Close Pilot Window"; 
               position = "pos pilot"; 
               radius = 10; 
               condition = "(this animationPhase ""Ani_DriW"" < 0.5)&& (alive this)"; 
               statement = "this animate[""Ani_DriW"",0.6]"; 
               onlyforplayer = 1; 
               priority = 4.7; 
               showWindow = 1; 
           };
           class OpenWindow1 
           { 
               displayName = "Open Pilot Window"; 
               position = "pos pilot"; 
               radius = 10; 
               condition = "(this animationPhase ""Ani_DriW"" < 0.5)&& (alive this)"; 
               statement = "this animate[""Ani_DriW"",0]"; 
               onlyforplayer = 1; 
               priority = 4.7; 
               showWindow = 1; 
           };

& the model cfg:

class Ani_DriW {
			type = "translationZ";
			source = "Ani_DriW";
			animPeriod = 3;
			selection = "Ani_DriW";
			axis = "Ax_DriW";
			angle0 = 0;
			angle1 = "rad 36";
		};

Share this post


Link to post
Share on other sites
The user condition already has > 0.5:

No it doesn't. Check again :)

& the model cfg:

        class Ani_DriW 
       {
	type = "translationZ";
	source = "Ani_DriW";
	animPeriod = 3;
	selection = "Ani_DriW";
	axis = "Ax_DriW";
	angle0 = 0;
	angle1 = "rad 36";
       };

Type=translation... angle =? Whatever works :p

Share this post


Link to post
Share on other sites
No it doesn't. Check again :)

Type=translation... angle =? Whatever works :p

Tryed changing the condition to > 0.6: As its the same as animate length?

Still nothing

Share this post


Link to post
Share on other sites

Okay, here's what the problem is.

 class CloseWindow1 
       {  condition = "(this animationPhase ""Ani_DriW"" ***** < 0.5****)&& (alive this)";  
           statement = "this animate[""Ani_DriW"",0.6]";  

"Move the animation to the animation phase of 0.6 if and only if the animation phase is less than 0.5."

The animation phase is at 0. You can animate on the condition that the animation phase is less than 0.5 (it is). You have the option to animate.

 class OpenWindow1 
           {  condition = "(this animationPhase ""Ani_DriW"" ***** < 0.5****)&& (alive this)";  
               statement = "this animate[""Ani_DriW"",0]";  

"Move the animation to the animation phase of 0 if and only if the animation phase is less than 0.5."

The animation phase is at 0.6. You can animate on the condition that the animation phase is less than 0.5 (or less than 0.6, neither of which is true). You have no option to animate.

You have to switch the less than 0.5 to greater than 0.5, or some other number that makes sense.

Share this post


Link to post
Share on other sites
Okay, here's what the problem is.

 class CloseWindow1 
       {  condition = "(this animationPhase ""Ani_DriW"" ***** < 0.5****)&& (alive this)";  
           statement = "this animate[""Ani_DriW"",0.6]";  

"Move the animation to the animation phase of 0.6 if and only if the animation phase is less than 0.5."

The animation phase is at 0. You can animate on the condition that the animation phase is less than 0.5 (it is). You have the option to animate.

 class OpenWindow1 
           {  condition = "(this animationPhase ""Ani_DriW"" ***** < 0.5****)&& (alive this)";  
               statement = "this animate[""Ani_DriW"",0]";  

"Move the animation to the animation phase of 0 if and only if the animation phase is less than 0.5."

The animation phase is at 0.6. You can animate on the condition that the animation phase is less than 0.5 (or less than 0.6, neither of which is true). You have no option to animate.

You have to switch the less than 0.5 to greater than 0.5, or some other number that makes sense.

Im really sorry but that still dont make sense :confused:

So i need to change the condition to greater? As its 0.6? :/

Share this post


Link to post
Share on other sites

The condition states that you only have the option for the user action if the controller is less than 0.6. The controller, I believe, is moving from 0 to 0.6 when you close the window. So now the state of the controller is now 0.6.

The open window action will only be present if its conditions are true. One of the conditions is that the controller must be less than 0.6.

0.6 < 0.6. True or false?

Edited by Max Power

Share this post


Link to post
Share on other sites
The condition states that you only have the option for the user action if the controller is less than 0.6. The controller, I believe, is moving from 0 to 0.6 when you close the window. So now the state of the controller is now 0.6.

The open window action will only be present if its conditions are true. One of the conditions is that the controller must be less than 0.6.

0.6 < 0.6. True or false?

So changed it to 0.5? or 0.4?

Still dont work :confused:

I think ill remove the animation, nothing but annoyance :(

Share this post


Link to post
Share on other sites

Maybe its not even capable of reaching such heights as 0.4 or 0.5 ?

class Ani_DriW {

type = "translationZ";

source = "Ani_DriW";

animPeriod = 3;

selection = "Ani_DriW";

axis = "Ax_DriW";

angle0 = 0;

angle1 = "rad 36";

look at angles shouldnt even have angles ? ,you need some min and max phaes i think also 0 and 1 ,

open door in mission ad get myani = chopper animationphase Ani_DriW ; hintsilent format ["anim phase is %1", myani]

what is it saying ? 1 ? i doubt it to be honest but i never know with this engine :)

whatever it says then this is the value you need for your switch trigger

Share this post


Link to post
Share on other sites
So changed it to 0.5? or 0.4?

Still dont work :confused:

I think ill remove the animation, nothing but annoyance :(

Just change it to

condition = "(this animationPhase ""Ani_DriW"" > 0)&& (alive this)";

Share this post


Link to post
Share on other sites
Just change it to

condition = "(this animationPhase ""Ani_DriW"" > 0)&& (alive this)";

Thanks :D

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  

×