OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: aLlamaWithARifle on 10 Aug 2011, 15:03:24

Title: Map Anim
Post by: aLlamaWithARifle on 10 Aug 2011, 15:03:24
I remember the map anim tools from OFP, gave it a few goes back then but now have completely forgotten everything about it, I'm looking into several OFP missions that used it and trying to figure it out but it's farely tricky.

I remeber there being a tutorial in the editors depot about map anim for cutscenes but I can't seem to find it, I found a link from a long time ago but the ed depot tells me it can't be found.

Can anyone find the tutorial or does anyone remember how the commands work?

If it's not clear what I'm talking about I mean the commands that could force the map to open in cutscenes and then you could pan the map via script and add markers to create detailed briefings in intros
Title: Re: Map Anim
Post by: Wolfrug on 10 Aug 2011, 16:15:19
Heya!

The map anims are actually fairly simple, since there are only a few commands, and they work roughly the same as the camera tools - i.e. you "plan" an animation, and then you "commit" it. The commands involved are:

mapAnimAdd (http://www.ofpec.com/COMREF/index.php?action=details&id=210&game=All)
mapAnimClear (http://www.ofpec.com/COMREF/index.php?action=details&id=211&game=All) (hardly necessary)
mapAnimCommit (http://www.ofpec.com/COMREF/index.php?action=details&id=211&game=All)
mapAnimDone (http://www.ofpec.com/COMREF/index.php?action=details&id=213&game=All)

Finally, to force the map during the cutscene, use, forceMap (http://www.ofpec.com/COMREF/index.php?action=details&id=139&game=All) (true/false)

The only one you really need to worry about is mapAnimAdd. Let's say you want to show a panning view from point A to point B, all you need to do in your cutscene.sqf is add something like:

Code: [Select]
//Force map
forcemap true;
//Place map over initial position (time = 0), with initial zoom (=0.1)
mapAnimAdd [0, 0.1, getMarkerPos "obj1"];
mapAnimCommit;

// Sleep a moment to allow for voiceover or text or whatever you want
sleep 2;
// Add new position to be moved to, with a new zoom, over 5 seconds
mapAnimAdd [5, 0.4, getMarkerPos "obj2"];
mapAnimCommit;

// Wait until the 5 second pan + zoom is finished
waitUntil {mapAnimDone};

// Sleep for effect
sleep 2;

// End scene
forceMap false;

There are various other fun things you can do on the map while this is happening for added effect, but the above should give you the general idea of how to make it work. If you want more action in your map anims, consider using the various setMarker... commands to, for instance, make your markers blink, change size, appear dynamically, spell out text and so on, all the while zooming across the map. :)

Good luck!

Wolfrug out.
Title: Re: Map Anim
Post by: aLlamaWithARifle on 10 Aug 2011, 21:42:08
Thanks a lot, was a lot easier than what I remember it to be.

A few slight niggles with it though, when you force the map the players cursor is available to move, although the player can't interfere with the map animations he can still move the map cursor about. As well as the "Map", "Notes" and "Units" options are viewable along with the bar that says the players name, squad and mission name.

Is it possible to remove these and have a totally plain map like the OFP one was?

Edit - For anyone trying this I recommend putting "mapAnimClear" before adding a new animation

Code: [Select]
mapAnimClear
mapAnimAdd [4, 0.04, getMarkerPos "marker1"]
mapAnimCommit

So you have something like this, I had a problem where it just seemed to be a step behind and using manAnimClear fixed the problem.