Home   Help Search Login Register  

Author Topic: Animation problem, NEED HELP!  (Read 1309 times)

0 Members and 1 Guest are viewing this topic.

Offline General_NS

  • Members
  • *
Animation problem, NEED HELP!
« on: 14 Feb 2008, 12:12:08 »
Hi,
Can anyone tell me how to set animation phase on 0 without animations. I want to light spin around

from config file:
Code: [Select]
class Animations
{
class rotacon
{
type = "rotation";
animPeriod = 0.5;
source = "rotat";
selection = "rotac";
axis = "osa_rotac";
minValue = 0;
maxValue = 1;
angle0 = 0;
angle1 = "rad -360";
};
};
...
class UserActions
{
class RotacionOn
{
displayName = "Turn On";
onlyForPlayer = false;
position = "mainrotac";
radius = 3
condition = "this animationPhase ""rotacon"" == 0 and player in this";
statement = "[this,0] exec ""\a6q\scripts\rotacija.sqs""";
};
};

from script file:
Code: [Select]
...
#startanim
_rotac1 animate ["rotacon",1]
~0.5
_rotac1 animationPhase ["rotacon_1"] = 0
~0.5
_rotac1 animate ["rotacon_1",1]
~0.5
_rotac1 animationPhase ["rotacon"] = 0
~0.5
goto "startanim"
...

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Animation problem, NEED HELP!
« Reply #1 on: 14 Feb 2008, 13:29:23 »
The animationPhase command queries the value of the current animation and is not the way to set a phase in any way. It also doesn't take an array, but rather just the name of the animation you want to look at. For example, to perform the "rotacon" animation once and wait until it is completed before doing something else:
Code: [Select]
_rotac1 animate ["rotacon", 1]
@ (_rotac1 animationPhase "rotacon") == 1

E.g. To spin one way, then back the other way, continually:
Code: [Select]
#startanim
; Rotate one way...
_rotac1 animate ["rotacon", 1]
@ (_rotac1 animationPhase "rotacon") == 1
; Rotate back the other way...
_rotac1 animate ["rotacon", 0]
@ (_rotac1 animationPhase "rotacon") == 0
goto "startanim"

OK, real problem with your code snippet though is that you don't explain exactly what you are trying to achieve, so it is hard to correct it. The config doesn't have anything about a "rotacon_1" animation either. Do you want the light to continually spin around? Spin around once then pause before spinning again. Spin one way, then back the other?
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline General_NS

  • Members
  • *
Re: Animation problem, NEED HELP!
« Reply #2 on: 14 Feb 2008, 15:12:13 »
I want the light spin around continually in one way. Is that posible?

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Animation problem, NEED HELP!
« Reply #3 on: 14 Feb 2008, 16:46:13 »
Unfortunately, continually playing the rotation animation is not as straightforward as it could be. Using animate you can only move the animation forwards or backwards (but not jump directly to the start or end of the cycle). This is where I look dumb, because I don't know how to do what you require, but I'm quite sure that it can be done, so hopefully some other wise person can tell you the answer...
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline General_NS

  • Members
  • *
Re: Animation problem, NEED HELP!
« Reply #4 on: 18 Feb 2008, 19:15:24 »
Find out something new?

Offline Sparky

  • Former Staff
  • ****
    • Hellenic Warfare Mod
Re: Animation problem, NEED HELP!
« Reply #5 on: 18 Feb 2008, 20:40:15 »
i think that somehow i can help, i'm not sure though....
For start you want to make an animation that is triggered by a user action, and you want it to be a spin of 360 degrees .
Let's say something like a radar?
also this addon is a vehicle or something else?

Sorry to ask but i need to know the more information in order to help you better.
Also if you like, you can't send it over at sparky@otenet.gr, and see if i can make it work.

I have some ideas but i need to practise them 1st, and in order to have a better picture the addon is the best solution.