Jump to content
cc_kronus

Animation for Land_MobileRadar_01_radar_F?

Recommended Posts

In Arma3 BI asset page https://community.bistudio.com/wiki/createVehicle/vehicles

The building  Land_MobileRadar_01_radar_F has a note:   Radar_Rotation => user.  Does it mean that there is a way to animate the radar and make it rotate?? anyone knows what line code would be needed in the object's init to make it happen?

Share this post


Link to post
Share on other sites

You can make the antenna rotate. In init field of the radar:
 

if (isServer) then {
  this spawn {
    while {alive _this} do {
      _this animateSource ["Radar_Rotation",0];
      waitUntil {_this animationSourcePhase "Radar_Rotation" == 0};
      _this animateSource ["Radar_Rotation",1,TRUE]
    };
  };
};

 

Replace 0 by 1 and 1 by 0 for anti-clockwise rotation.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
12 hours ago, pierremgi said:

You can make the antenna rotate. In init field of the radar:
 


if (isServer) then {
  this spawn {
    while {alive _this} do {
      _this animateSource ["Radar_Rotation",0];
      waitUntil {_this animationSourcePhase "Radar_Rotation" == 0};
      _this animateSource ["Radar_Rotation",1,TRUE]
    };
  };
};

 

Replace 0 by 1 and 1 by 0 for anti-clockwise rotation.

10:02:11 Error in expression < ["Radar_Rotation",1,TRUE]
    };
  };
};>
10:02:11   Error position: <
};>
10:02:11   Error Invalid number in expression

Where are these weird characters coming from? Is copy/paste doing something odd?

Share this post


Link to post
Share on other sites
3 hours ago, Tankbuster said:

Where are these weird characters coming from? Is copy/paste doing something odd?

Yep unwanted invisible character. I tested it by copy/paste after post, so ... it's on your side.

  • Like 1

Share this post


Link to post
Share on other sites

@reyhard as a matter of interest where did you get the 1e10 for the second element of the animate source to give continual rotation? I had done  a small script for rotation of this radar a while back but ended up doing a loop between phases of the rotation. That 1e10 is very useful in this instance. Does it have any relevance to any other animations eg rotational animations?

Share this post


Link to post
Share on other sites
6 hours ago, The Real Bunc said:

@reyhard as a matter of interest where did you get the 1e10 for the second element of the animate source to give continual rotation? I had done  a small script for rotation of this radar a while back but ended up doing a loop between phases of the rotation. That 1e10 is very useful in this instance. Does it have any relevance to any other animations eg rotational animations?

I *think*... 1e10 is infinity, at least as far as the gae engine is concerned.

Share this post


Link to post
Share on other sites

https://www.quora.com/What-is-1E10

1e10 is notation for 10^10 (ten to power of ten) which is quite large number (10000000000) and practically it's rather unlikely that animation is ever going to reach that. Single cycle of radar last 3 seconds, so using 1e10 as a desired animation state means that radar will make  10000000000 cycles which will take 8333333.33333 hours to complete.

  • Like 2

Share this post


Link to post
Share on other sites

Yes, but the undocumented (or deeply hidden) thing, here, is a phase >1 for animateSource command.

You can rotate the radar antenna 30 times and stop it, just setting phase to 30. Not useful but undocumented. Not sure there is an interest on other objects.

  • Like 1

Share this post


Link to post
Share on other sites

It deeply depends on the asset - if model.cfg source is using sourceAddress = loop, then there are no limits on end value. Otherwise min & max value is the limit

https://community.bistudio.com/wiki/Model_Config#Animations

I wouldn't say it's a secret since i.e. on https://community.bistudio.com/wiki/animateSource you have example with phase > 1

ugv animateSource ["MainTurret", rad 90]

rad 90 translates to 1.5707963

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for the responses to my query. I hadn't realised that a phase number greater than the max continued the animation in such situations. It could maybe be a bit clearer in the wiki but all is good that ends good. btw I did know what 1e10 was. 

Share this post


Link to post
Share on other sites
On 12/9/2020 at 11:13 AM, reyhard said:

Protip: You can skip whole loop and use


nameOfRadar animateSource ["Radar_Rotation",1e10]

You can also modify speed of rotation with speed coef

https://community.bistudio.com/wiki/animateSource

 

Can anyone confirm that this doesn't work in multiplayer?  1e10 doesn't do anything on a MP client. It does work on the hosting client-server, but not on a remote client.

Sending it other big numbers, 1000 for example does work on MP clients.

Share this post


Link to post
Share on other sites

Perhaps your client should wait this night for a better PC? 😋

 

Yes confirmed. With 1e10, the client reads 1... On the other hand, you can pass 999999 (turns) That not too much if you want to finish here, but enough most of the time.

  • Haha 1

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

×