Page 1 of 14 1234511 ... LastLast
Results 1 to 10 of 134

  Click here to go to the first Developer post in this thread.  

Thread: [OA] UnitCapture & UnitPlay Functions

  1. #1

    [OA] UnitCapture & UnitPlay Functions

    So I was going through BIS's scripts and stuff and came across something very interesting, and so I thought I'd see if it interests you guys.

    Operation Arrowhead includes a new set of of functions called UnitCapture & UnitPlay. From what I've gathered, they basically allow you to capture the movement data (and there's one for weapon firing data) of a unit, and then play it back exactly the same way every time.

    It's how BIS pulled off those seemingly impossible (for AI at least) littlebird insertions in the campaign. In short, all you have to do is call CaptureUnit on a vehicle (it appears to work on people to), drive/fly it around as you see fit, and it will copy the movement data to the clipboard. Then, simply paste the data in a script, call the PlayUnit function with this data and it will play back the same movement you just recorded.

    I imagine this can be used to some pretty substantial potential. Ex: getting AI to land aircraft on buildings/carriers, flying/driving through objects no AI could possibly pull off, and creating some very complex cinematic scenes. Now I haven't got a chance to actually try it yet, but judging from it's use in the campaign it seems to work very nicely (at least on aircraft).

    You can find some documentation in the scripts themselves. They're in the OA modules pbo, under 'scenes'. Hope this interests some of you mission (and movie) makers.
    Last edited by Big Dawg KS; Jul 1 2010 at 18:01.
    VBS2 Designer

    Quote Originally Posted by Armored_Sheep View Post
    I like to call Arma a sandbox game that works pretty much like LEGO - you buy it not just because you want to have a nice car from the main picture on its box, do you?

  2. #2
    HOLY SHIT! So when you have problems getting the AI to do as you want, just record it yourself and let them play it instead. That's just brilliant!! Prequel to AAR?
    Regards
    Carl Gustaffa - left this game due becoming Steam Exclusive

  3. #3
    Can you give some a more detailed location for a noob on where the documentation is and how to access it?

  4. #4
    Sergeant Major ])rStrangelove's Avatar
    Join Date
    Jan 24 2002
    Location
    Rainy, foggy, begins with G
    Posts
    1,760
    If this works it could be worth starting a 'MoveData Scripts' sticky thread here. Ppl could post all kinds of recorded movements that make sense for mission designers like searching patterns, getting in /out of houses with leaning etc etc.
    This could be good.

    Spoiler:

  5.   Click here to go to the next Developer post in this thread.   #5
    Keep in mind this script is designed for air units, like helicopters and aircrafts. It's not working properly with ground units (wheels are not turning with vehicle among other things) and it doesn't capture soldier's animations.
    Also, using too many recorded paths can lead to slower framerate. Use as you wish for making videos, but be really careful when using it in playable mission.
    Alpha is alpha.

  6. #6
    Could this also be used for normally static objects? Like say getting an empty vehicle to move around in a certain pattern? I am thinking of moving targets on a tank gunnery range, lack of animation isn't a problem.

    Är du svensk och vill spela Arma2 med vettigt folk? Gå till SSG-Clan.se nu på direkten!
    I think it is possible that Arma community is simply too impatient for Steam. /Maruk

  7. #7
    Captain Big Dawg KS's Avatar
    Join Date
    Dec 13 2004
    Location
    v *Spam Level*
    Posts
    6,358
    Author of the Thread
    Quote Originally Posted by Gaia View Post
    Keep in mind this script is designed for air units, like helicopters and aircrafts. It's not working properly with ground units (wheels are not turning with vehicle among other things) and it doesn't capture soldier's animations.
    Also, using too many recorded paths can lead to slower framerate. Use as you wish for making videos, but be really careful when using it in playable mission.
    Right, I was kind of expecting that since the functions and captured data didn't seem to contain anything about animation states/phases. Maybe in the future though.

    Could this also be used for normally static objects? Like say getting an empty vehicle to move around in a certain pattern? I am thinking of moving targets on a tank gunnery range, lack of animation isn't a problem.
    Trracer, I would imagine so. It should work on anything that can be given a velocity. Static objects might not work though.

    ---------- Post added at 08:26 AM ---------- Previous post was at 06:57 AM ----------

    Quote Originally Posted by ])rStrangelove View Post
    If this works it could be worth starting a 'MoveData Scripts' sticky thread here. Ppl could post all kinds of recorded movements that make sense for mission designers like searching patterns, getting in /out of houses with leaning etc etc.
    This could be good.
    I was also thinking of something like this where users (who are perhaps very skilled pilots) can share their captured moves. When I get home tonight I'll probably fiddle around with the capture function and see if I can pull off some cool things with it.

  8. #8
    Captain Big Dawg KS's Avatar
    Join Date
    Dec 13 2004
    Location
    v *Spam Level*
    Posts
    6,358
    Author of the Thread
    Quote Originally Posted by Toasticuss View Post
    Can you give some a more detailed location for a noob on where the documentation is and how to access it?
    So far the only documentation I can find is within the function headers, and you can find them in the OA modules PBO, under the directory "scenes". You can also find some of those headers here.

  9. #9
    Wow this sounds awesome, good finding Big_Dawg. I haven't looked at it, can you determine when the "recorded movement" is over?

  10. #10
    Captain Big Dawg KS's Avatar
    Join Date
    Dec 13 2004
    Location
    v *Spam Level*
    Posts
    6,358
    Author of the Thread
    For the UnitCapture function, you pass a duration as an argument. It will stop recording either after this duration, when you press Esc, or when the unit dies. IIRC you can also skip into a certain frame when playing it back, and there's probably a way to end it early.

    There's also a UnitCaptureSimple function where it stops when you press Esc or the unit dies. Corresponds with UnitPlaySimple, which probably doesn't have all those above features.
    Last edited by Big Dawg KS; Jul 1 2010 at 18:03.

Page 1 of 14 1234511 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •