Jump to content

Recommended Posts

Hey guys in the mission I am working on I would like, while ingame, the map to open and show some certain locations. Like show the first one and then show the second one and so on.

 

There is however an issue .... I could not find a way to make the map change the location it focuses on steadily. It just shows the second marker instantly. Does not seem right :scratchchin:

 

So how can I make the map open and show different markers steadily. Like in the Tactical Ops DLC missions if I recall correctly.

 

 

 

What I have so far in my humble script:

 

openMap true;
Sleep 0.01;
((uiNamespace getVariable "RscDiary") displayCtrl 51) ctrlMapAnimAdd [0,0.05,getMarkerPos "marker01"];   ctrlMapAnimCommit ((uiNamespace getVariable "RscDiary") displayCtrl 51);
Sleep 5;
((uiNamespace getVariable "RscDiary") displayCtrl 51) ctrlMapAnimAdd [0,0.02,getMarkerPos "marker02"];   ctrlMapAnimCommit ((uiNamespace getVariable "RscDiary") displayCtrl 51);
Sleep 5;
openMap false;

 

Share this post


Link to post
Share on other sites

How are you executing the code? Is suspension allowed?

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
8 hours ago, JohnKalo said:

ctrlMapAnimAdd [0

0 here is the time it takes the map to animate to the given position.

 

8 hours ago, JohnKalo said:

It just shows the second marker instantly.

As @7erra says your code needs to be able to suspend (spawn, execVM). Else the sleeps do not work and you will immediately see last anim before map closes.

 

Spoiler

openMap true;

{
	//Animate map to positoin over 4 seconds
	((uiNamespace getVariable "RscDiary") displayCtrl 51) ctrlMapAnimAdd [4,0.05,getMarkerPos _x];
	ctrlMapAnimCommit ((uiNamespace getVariable "RscDiary") displayCtrl 51);
	
	//Wait until animation has finished
	waitUntil { ctrlMapAnimDone ((uiNamespace getVariable "RscDiary") displayCtrl 51) };
	
	//Pause for a further 1 second at position
	sleep 1;
}forEach [ "marker01", "marker02" ];

openMap false;

 

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
8 hours ago, Larrow said:

((uiNamespace getVariable "RscDiary") displayCtrl 51) ctrlMapAnimAdd [4,0.05,getMarkerPos _x];

Hmmm. Setting the commit time to 4 will take 4 seconds to even reach the position. It would probably be better to commit in one second and sleep for four.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Quote

How are you executing the code?

With an execVM through a trigger.
 

Quote

 

0 here is the time it takes the map to animate to the given position.

 

Dang thought it was something like the sleep command.

 

Quote

As @7erra says your code needs to be able to suspend (spawn, execVM). Else the sleeps do not work and you will immediately see last anim before map closes.

And was wondering what suspension was  :rock:

Yep that is a better code indeed. I will try it out and if an issue occurs I will report back. Thanks guys!!

  • Like 2

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

×