Download as .md ↓

Animations in boopi_mod and G.A.M. mods: gestures, scenes, camera

Animations in boopi_mod and G.A.M. mods: scripts, dialogues, scenes, camera

🇷🇺 Русский · 🇬🇧 English

← All guides · Project home page · Before this: Import and your own scenes

Modding has never been this easy.

boopi_mod is first of all a mod manager in which you create your own things: animations, scenarios, scenes and dialogues — by hand or with AI help. This guide is for modders: how to make G.A.M. — the animation engine play an animation from a script, from a dialogue line or from the «Life» system, how to build a cinematic scene with a camera, and how to pack a mod that our manager installs.

Importing other people's animations (Skyrim, OAR) and the scene editor are described in ANIMATION_IMPORT.md.

Everything described here was tested in the game (Fallout 4 1.10.163, G.A.M. 0.3.0, BoopiCorp 2.4.4): Stella's gesture in a dialogue, «hands up» on an NPC and on the hero, a nod with the head only, a hug with the camera in both modes.

Contents

  1. Two ways to animate

  2. Quick start: 3 lines of Papyrus

  3. Where animations come from: scene id and tag query

  4. A one-off animation (gesture)

  5. Scene — stages, events, sounds

  6. Scene camera

  7. Animation from a dialogue — our trees, Creation Kit

  8. Through the «Life» system: contexts

  9. Safety

  10. A mod for our manager — editing a scene in the editor, polishing, AI polish

  11. How to test in the game

  12. Common mistakes

  13. What next


1. Two ways to animate

One-off animation (gesture)Scene
What it isOnce, on one actor: wave, nod, scratch the back of the head, shrugLike in a film: one or more actors, the whole body, stages in turn
BodyA body part over whatever the actor does on their own (arms while walking, head while talking)The whole body; people step onto their marks
CameraNot touchedFloats around the people and picks angles itself (auto) or the player controls it (free)
Player controlStaysDisabled while the hero is in the scene (look stays for the manual camera)
Does the script waitNo: the function returns control at onceYes: RunScene waits for the scene to end (or use StartScene without waiting)
PapyrusGAM.Gesture(actor, "gesture,point,forward")GAM.RunScene("hug,pair", actors)
Dialogue (our trees)do: { anim: { tags: "...", who: npc, part: head } }do: { anim: { tags: "hug,pair", who: both, when: after } }
Through «Life» (with consent)OGAIAnim.Context("talk_gesture", npc, "npc")OGAIAnim.Context("hug", npc)

The rule of choice is simple:

  • if the animation should happen «in passing», it is a gesture;

  • if the player lets go of the mouse and watches, it is a scene.


2. Quick start: 3 lines of Papyrus

; point forward - a one-off gesture on the upper body, the NPC keeps walking
GAM.Gesture(akSpeaker, "gesture,point,forward")

; nod with the head only
GAM.Gesture(akSpeaker, "gesture,talk,friendly", "head")

; hug the hero - a scene: the camera floats, control is disabled, the script waits for the end
Actor[] two = new Actor[2]
two[0] = Game.GetPlayer()
two[1] = akSpeaker
GAM.RunScene("hug,pair", two)

For this to compile:

  • GAM.psc must be in the import folder of your Papyrus compiler; its source is installed together with G.A.M.;

  • GAM.pex and GAM.dll are needed in the game.


3. Where animations come from: scene id and tag query

Every G.A.M. animation is a scene file Data\GAM\Scenes\<path>\<name>.gam. Its id is the path without the extension: gesture/talk_friendly_f_s1.

In every function with an asWhat parameter you can pass:

  • a scene id — exactly that scene plays;

  • a tag query — "hug,pair", "gesture,talk,-nervous". G.A.M. picks a random suitable scene:

    • all plain tags are required, tags with a minus exclude;

    • the number of roles must match the number of actors;

    • an intimate one — never (see section 9).

The tag vocabulary is in data/gam/tags.yaml. The most useful tags:

WhatTags
A gesture in conversationgesture,talk + a mood friendly, confident, nervous, irritated, neutral, depressed, scared, shocked; length short / medium
Hands upgesture,surrender
Smoke and talkgesture,smoke
Point a directiongesture,point + forward / back / left / right
Salutegesture,salute (+ military, brotherhood)
Wavewave — the vanilla game has no such clip: you need your own scene or a pack with this tag
Pairpair + an action: hug, kiss, handshake, dance, hold_hands …
One actorsolo
Upper / lower bodyupper_body / lower_body

Gestures out of the box.

  • The «Gestures from the game» pack (gam_gestures, installed by the manager) builds from your own game's animations at install time 64 conversation gestures (8 moods × male/female × 4 clips) and 9 single ones: «hands up», «smokes and talks», three kinds of «salute» and «point» in four directions.

  • No game files are copied into the pack: the clips are read from your archives during the build.

  • Ids: gesture/talk_<mood>_<m|f>_<s1|s2|m1|m2>, gesture/hands_up, gesture/smoke_talk, gesture/salute, gesture/salute_military, gesture/salute_bos, gesture/point_<forward|back|left|right>.

Our animation packs. The scenes we made in G.A.M. install as mods: boopi_mod → «Mods» → «boopi_mod animations» → «Install» (also «Update to …» and «Remove» there). Five packs:

PackWhat is insideFolder in the game
Couples & romancehugs, slow dances, a kiss, holding hands, a head on a shoulder, a proposal on one knee, a flirtData\GAM\Scenes\boopi-anim-couples\
Everyday lifesitting, drinking, reading, cards, warming hands, solo dances, a handshake, passing a bottle…\boopi-anim-life\
Workhammer, saw, repairs, terminal, kitchen, garden, cleaning, guard duty…\boopi-anim-work\
Emotions & reactionslaughter, applause, a cheer, impatience, threats, a quarrel, comfort…\boopi-anim-emotions\
Gaits & smoking13 gaits of illness, withdrawal, hangover, exhaustion and wear; lighting up, smoking standing, at a wall, seated, putting it out…\boopi-anim-gaits\

A pack's scenes appear in the G.A.M. library and in the game; Life contexts, the living town, gaits and your own tag queries find them by themselves — the query "hug,pair" or "smoke,upper_body,loop" plays them when the pack is installed. Removing a pack takes it out of the library and the game, and a file that lay in the same place before (your own copy of a scene, say) comes back. You can open a pack's scene in the editor and save it as your own — it stays yours after the pack is removed.

See what is installed:

  • in the game: GAM.ListScenes("gesture,talk") — an array of ids;

  • in the app: boopi_mod → G.A.M. → Library (search by name, id and tags; an «in game» badge, thumbnails, groups by folder and source — details).

G.A.M. library: a scene list filtered by tag and the pack import tab

The G.A.M. library in the app: scenes with tags (filter by tag, for example hug,pair,-intimate) and pack import — this is where you see what exactly your query will find.


4. A one-off animation (gesture)

int Function Gesture(Actor akWho, string asWhat, string asPart = "") global
  • asWhat — an id or a tag query.

  • asPart — the body part. An empty string means «as set in the scene» (meta.part or the tag upper_body). Options:

asPartWhat movesExample
uppereverything from the waist uppoint, spread the arms, a gesture in conversation
headneck and headnod, shake the head, look back
armsboth arms (shoulders and below)clap, rub the palms
left_arm / right_armone armscratch the back of the head with the right, fix the hair
lowerlegs and pelvisshift the feet, stamp
fullthe whole body— (for the whole body a scene is better)

How a gesture behaves:

  • It plays once and smoothly returns the actor to their own animation (blend in 0.3 s, out 0.45 s).

  • The rest of the body stays its own: you can wave while walking.

  • The camera and control are not touched. The function returns a handle (0 — no suitable scene) and hands control back to the script at once.

  • A clip for the actor's sex is looked for first: one with the tag male or female. Only if there is none, any clip is taken.

Examples:

GAM.Gesture(akSpeaker, "gesture,talk,confident")                 ; a confident upper-body gesture
GAM.Gesture(akSpeaker, "gesture,talk,friendly,short", "head")    ; a nod only
GAM.Gesture(Game.GetPlayer(), "gesture,surrender")               ; the hero raises their hands
GAM.Gesture(akGuard, "gesture/talk_irritated_m_s1", "right_arm") ; a specific scene, right arm only

A lower level if you need your own behaviour:

int h = GAM.PlayPart("gesture/hands_up", actors, "upper")   ; plays until stopped (if the scene has a loop)
GAM.Stop(h)                                                 ; finish and exit; GAM.Stop(h, true) - at once
int o = GAM.OverlayPart(akActor, "drunk_sway", "upper", 0.6) ; a weighted layer until stopped
GAM.SetWeight(o, 0.3)

5. Scene

bool Function RunScene(string asWhat, Actor[] akCast, ObjectReference akFurniture = None, \
                       float afSecondsPerStage = 0.0, float afMaxSeconds = 0.0, string asCamera = "") global
  • akCast — actors in the order of the scene's roles. For a pair, [0] is usually the hero and [1] the NPC.

  • akFurniture — the anchor furniture (a bed, a sofa): the scene is placed on it. Without furniture the scene is placed where the first actor stands, the others relative to them.

  • afSecondsPerStage:

    • 0 — each stage plays as many passes as the scene specifies;

    • > 0 — each stage loops in whole passes until that many seconds have passed.

  • afMaxSeconds — the limit of the whole scene. A scene without stages is looped and would run forever without a limit, so the default is 20 s.

  • asCamera — "auto", "free", "off"; an empty string means «as in GAM.ini» (auto by default).

What happens on a call:

  1. A scene is picked (PickScene).

  2. Actors smoothly step onto their marks: bodies «glide» there instead of jumping. If an NPC tries to walk away under its own AI, G.A.M. returns it to its mark.

  3. Stages (5.1) and the camera (section 6) are switched on.

  4. While the hero is in the scene, walking, combat, menus and view changes are disabled; look works — it turns the manual camera.

  5. At the end the scene leaves the loop, actors smoothly return to their own animations, control comes back.

If there is no suitable scene, RunScene returns false.

Without waiting (for example, to flip through the stages yourself):

int h = GAM.StartScene("dance,pair", two, None, 0.0, "auto")   ; 0 = nothing found
if h > 0
    Utility.Wait(5.0)
    GAM.NextStage(h)          ; the next stage at once (false: that was the last one - exit)
    GAM.WaitScene(h, 60.0)    ; wait for the end, at most a minute; the hero's control is disabled meanwhile
endif

5.1 Stages (how a scene develops)

A scene with stages runs in order: each stage loops its passes, then the next one, and after the last one — exit. This is how «developing» scenes are made: meeting → hug → dance.

Stages are set in the scene file in one of two ways:

  • meta.stages: [{ "name": "stage1", "start": 0, "end": 4, "loops": 2 }, ...] — exact boundaries and the number of passes;

  • markers markers: { "stage1": 0.0, "stage2": 4.0, "stage3": 9.5 } — a stage runs from its marker to the next one (the last — to the end), one pass each.

In the G.A.M. editor stages are marked up without JSON — the Body part and stages section (10.4).

Functions:

  • GAM.StageCount(h) — how many stages (0 — a scene without stages, just a loop);

  • GAM.GetStage(h) — the current stage, 1…N;

  • GAM.NextStage(h) — go to the next stage now;

  • GAM.Staged(h, sec) — switch on step-by-step mode manually (StartScene does it itself).

5.2 Scene events

A scene can carry events (events in the file; «Events» in the editor). At its moment G.A.M. performs each one itself (since 0.4.0) on the actor of the event's role (target; empty — the scene's first role), wherever the scene was started — a script, a dialogue, «Life» or the editor:

TypeValueWhat happens in the game
sounda sound descriptor (SNDR): Plugin|0xID, e.g. Fallout4.esm|0x0001A4E1a sound at the actor (Sound.Play)
saya topic (DIAL): Plugin|0xIDthe actor says the line (Say)
expressiona face: happy, angry, sad, afraid, surprised, in_pain … (Fallout 4's 35 expressions, listed in the editor); empty — their own facethe face until the next one or the end of the scene (ChangeAnimFaceArchetype)
equipan item: Plugin|0xIDthe actor puts it on (silently; added when it is not in the inventory)
unequipan item: Plugin|0xIDthe actor takes it off
stagea quest and a stage: Plugin|0xID|stagethe quest's SetStage
a word of your ownanythingnothing by itself — an event for your script

0xID is the form's number in its own plugin as xEdit and the Creation Kit show it, without the load order index (ESL plugins work too). A face the scene put on goes back when it ends.

Your script hears every event (your own words too) and the start and end of every scene through F4SE's external events (Fallout 4's stand-in for Skyrim's ModEvent):

Scriptname MyGamListener extends Quest

Event OnQuestInit()
    Listen()
    RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame")
EndEvent

Event Actor.OnPlayerLoadGame(Actor akSender)
    Listen()                                   ; once more after a save is loaded, to be safe
EndEvent

Function Listen()
    RegisterForExternalEvent("GAM_SceneEvent", "OnGamEvent")
    RegisterForExternalEvent("GAM_SceneStart", "OnGamStart")
    RegisterForExternalEvent("GAM_SceneEnd", "OnGamEnd")
EndFunction

Function OnGamEvent(int aiHandle, string asScene, string asType, string asValue, Actor akActor, string asRole)
    if asType == "door_knock"                  ; your own event: the editor's type «your own (for scripts)»
        Debug.Notification(asScene + ": a knock at the door")
    endif
EndFunction

Function OnGamStart(int aiHandle, string asScene, Actor[] akActors)
EndFunction

Function OnGamEnd(int aiHandle, string asScene, Actor[] akActors)
EndFunction
  • The functions' signatures must be exactly these (the names are yours: you pass them to RegisterForExternalEvent).

  • GAM_SceneStart / GAM_SceneEnd come for scenes, gestures and layers (not for gaits).

  • The queue GAM.NextEvent(h) is still there for a script that wants to read the events in its own loop: "type|target|value", "end||" when the scene is over, "" — nothing yet.

  • GAM.log has a line for each event performed — event <type> '<value>' on <actor>; a form not found or a role without an actor is a warning event say: no topic '…'.


5.3 Sounds on the timeline

Since G.A.M. 0.5.0 you can put your own sounds on the timeline: a clap, a footstep, a knock, a voice, music - any wav, ogg or mp3 file (also flac, m4a). A sound is a clip on a lane: it has a start (a second of the scene), an optional trim (which part of the file plays) and a volume; it is attached to a role (in the game it comes from that actor's position, quieter with distance, left or right by the side the actor is on seen from the camera) or to the scene (heard in the head, not placed: music, ambience). The clips play together with the scene, both in the editor's preview and in the game.

In the editor (the timeline at the bottom, the «🔊 Sounds» button):

  • Drop files with the mouse onto the lane of a role (or the «Scene» lane); onto the editor window in general works too - the sound lands at the playhead. The «+ File» button does the same. The browser reads any format itself and the core keeps the sound in one form (16-bit WAV, at most two channels) - that is the «converted as needed». The same file dropped twice is kept once.

  • «Sound library» holds our own sounds (a clap, steps on concrete, boards, gravel, grass and metal, a knock, a door, a cup, glass, clothes and paper rustle, a heartbeat, an arm swing, wind, applause); we made them from scratch, nothing was downloaded.

  • A clip: a click picks it, a drag moves it (also onto another lane - another role), its edges trim it, a double click listens to it alone. Below is the clip's card: name, lane, start, trim from the start and end in the file, volume 0-200 %, «Mute», «Remove». Delete removes the picked clip.

  • «M» on a lane mutes all its sounds (this goes to the game, too), «S» listens to that lane only (the editor's preview only).

  • Play plays the sounds with the animation: from where the playhead stands, round and round with a loop. Everything goes through the common undo (Ctrl+Z).

Files: the scene keeps only the file's name, the sound itself lies beside the library (<user folder>/gam/audio/), so «Save as…», «Copy» and the history of versions lose nothing. A scene with a clip whose file the library does not have is saved, but the editor and «Play in game» name the problem.

In the game: «To the game», installing a scene and «Play in game» put the sounds it needs into Data\GAM\Audio\; GAM.dll plays them with its own mixer (XAudio2 of Windows 10) - not through the game's sound system. So neither a plugin nor a sound descriptor per file is needed: a clip sounds the moment the scene reaches its start (every pass of a loop, too); the loudness follows the game's master volume slider and GAM.ini [Sound] fVolume; when the scene is stopped the clips fade out in a fraction of a second, and the game's pause pauses them. A sound of the game itself (a SNDR form) can still be called by the sound event (5.2) - that is for the game's own sounds; your files go in as clips. The log: G.A.M.: scene N 'id' sound 'file' on 00000014 (0.60 s of it, volume 1.00); no file - `sound '...': no such file in Data\GAM\Audio`.

GAM.ini, section [Sound]: bSounds=0 - the clips stay silent; fVolume - the overall loudness (1 = as made); fRefDistance and fMaxDistance - at what distance (game units, about 70 to a metre) a sound is still full and where it is gone.

Mods and export: «Save mod» puts the scene's sounds (gam/audio/...) into the .ogmod together with the scene; they land in the receiver's library and, with the scene, in their game, and leave the game's folder when the mod is removed. A clip that uses one of our library sounds takes it from the program.

6. Scene camera

The camera is switched on for scenes only (RunScene / StartScene, our dialogues and «Life», when the hero is in the scene). Gestures do not touch it.

ModeHow it behaves
track (scene camera)A scene with a camera track (editor → «Scene camera») is filmed by it: place, turn and field of view by keys, relative to the scene's origin. Such a scene takes this mode by itself.
auto (default)By itself: 6 shots in a cycle — front side, closer side, over the shoulder from behind, from above on the other side, low and close, wide front. Within a shot it slowly orbits the people and creeps in a little; between shots it glides over smoothly (2.5 s). It looks at chest level, with all the people in frame.
freeManual: mouse or arrows — around the people, PageUp / PageDown or the wheel — closer / further.
offThe game's normal camera.

How to control the camera:

  • F7 during a scene cycles the modes: auto → free → off → auto; for a scene with a camera track `track → auto → free → off → track (leaving track`, the orbit starts where the scene camera was).

  • If the hero was in first person, the camera switches to third person for the scene and goes back after it. For track too, even when the hero is not in the scene.

  • Leaving is always safe: the scene ends (or is stopped) — the camera, the first person view and the game's field of view come back; F7 to off — the game's camera at once.

  • The mode from a script: GAM.Camera(h, "free"); to read the current one — GAM.CameraMode() (an empty string if the camera follows nothing).

Settings are in Data\F4SE\Plugins\GAM.ini, section [Camera]:

KeyDefaultMeaning
sModeautothe default mode
iSwitchKey118the switch key (Windows code: F7 = 118, F8 = 119)
fShotSeconds7how long a shot lasts
fGlideSeconds2.5the glide between shots
fOrbitDegrees5degrees per second of orbit within a shot
fDistance1.0distance multiplier (0.7 in tight rooms)
fHeight35height of the look-at point above the people's centre (35 — chest)
bMessages1an on-screen note about a mode change (visible if the HUD is not hidden)
bDebug01 — camera shots are written to Documents\My Games\Fallout4\F4SE\GAM.log
bSceneCamera1a scene with a camera track is filmed by it (track) unless the script names a mode; 0 — never

Section [Editor]: bLink=1 — the game takes scenes from the editor («Play in game», 11); 0 — it never asks the app at all.


7. Animation from a dialogue

7.1 Our dialogue trees (data/talk/*.yaml)

In the do: consequences block of any line (a hero option or an NPC reply) you can add anim:

do: { anim: { tags: "gesture,talk,friendly", who: npc, part: head, when: line } }
FieldValuesMeaning
ida scene id of the G.A.M. library (my/wave)exactly that scene (one role for a gesture, two for both); the studio's «To the game» puts a library scene into the game
tagsa tag queryan animation straight from G.A.M. (a gesture for one, a scene for both)
contexta context id (data/gam/contexts)the core picks the animation; an intimate one — only with consent (section 8)
whonpc (default) / player / bothon the interlocutor, on the hero, or a scene for both
parthead, upper, arms, left_arm, right_arm, lower, fullthe body part (by default — as in the scene)
whenline (default) / afternow, while the line is spoken, or when the conversation ends

Exactly one of three is required: id, tags or context (none, or several named — the studio's check and check_talk.py report an error). By id and by tags an intimate scene is never taken (only a context, with consent). A tag query (it has a comma) written in id or context is read as tags. With who: both it is always a scene with a camera. It is better to set it with when: after so that it does not fight the dialogue camera.

The same «play a scene» shape is used in Studio triggers (scene:) and in the rows of a mission's world (MISSION_WORLD.md): exactly one of id / tags / context. Instead of `who: npc | player | both and when they have actors: [hero, EDID…] (for id and tags) or npc + who: both | npc + part (for context`, no actors); world rows take context too. Details: SCRIPT_STUDIO.md.

Example: a small dialogue with a head and arm gesture.

trees:
  my_barman:
    who: [MyModBarman]
    title: { ru: "Бармен", en: "Barman" }
    flags: [met]
    greet:
      - { when: { not: met }, go: first, do: { set: met }, ru: ["Новенький? Садись."], en: ["New here? Take a seat."] }
      - { go: first, ru: ["Опять ты. Что налить?"], en: ["You again. What'll it be?"] }
    nodes:
      first:
        - slot: question
          label: { ru: "Что у вас тут?", en: "What's this place?" }
          reply:
            # a reply with a nod: only the head moves, the hands keep wiping the glass
            - { do: { anim: { tags: "gesture,talk,friendly,short", who: npc, part: head } },
                ru: ["Бар. Лучший в квартале. Единственный в квартале."], en: ["A bar. Best on the block. Only one on the block."], go: first }
        - slot: positive
          label: { ru: "Выглядишь уставшим.", en: "You look tired." }
          reply:
            # an upper-body gesture: spread the arms, the feet stay where they were
            - { do: { anim: { tags: "gesture,talk,depressed", who: npc } },
                ru: ["Третья смена подряд. А ты как думал{p:а|}?"], en: ["Third shift in a row. What did you think?"], go: first }
        - slot: negative
          label: { ru: "Руки вверх! Шучу.", en: "Hands up! Kidding." }
          reply:
            - { do: { anim: { tags: "gesture,surrender", who: npc } },
                ru: ["Очень смешно. Я чуть бутылку не уронил."], en: ["Very funny. Nearly dropped a bottle."], go: first }
        - slot: neutral
          label: { ru: "Мне пора.", en: "I should go." }
          reply:
            # a parting point at the door - after the conversation, on the move
            - { do: { anim: { tags: "gesture,point,forward", who: npc, when: after } }, ru: ["Выход там. Заходи ещё."], en: ["Door's that way. Come again."], go: end }

Checking the tree (errors in anim — an unknown field, who, part, when — are found by the check):

uv run --project core python scripts/check_talk.py data/talk/my_barman.yaml

You can also click through such a conversation without the game: «▶ Try the dialogue» in the Studio (SCRIPT_STUDIO.md). The player does not play the animation; it shows how many scenes fit the line's tags.

After that the tree is built into a plugin together with the others:

  • every line with anim gets the properties AnimContext / AnimTags / AnimPart / AnimWho / AnimWhen of the script OGAITreeInfoScript (a scene id goes into AnimTags: GAM.PickScene looks for a scene with that id first);

  • in the game the line calls OGAILifeScript.TreeAnim.

A live example is data/talk/black_acorn_singer.yaml, Stella: a compliment — a friendly gesture; «Sing something» — a confident one; «I'm just listening» — a nod.

7.2 Your own dialogue in Creation Kit

In a line fragment (TopicInfo) it is ordinary Papyrus:

Scriptname MyMod_TIF_Barman_Nod extends TopicInfo Hidden

Event OnBegin(ObjectReference akSpeakerRef, bool abHasBeenSaid)
    GAM.Gesture(akSpeakerRef as Actor, "gesture,talk,friendly,short", "head")   ; a nod while speaking
EndEvent
  • The start of a line is OnBegin, the end is OnEnd.

  • A scene for two is better started in the OnEnd of the last line: by then the dialogue camera has already been released.

Event OnEnd(ObjectReference akSpeakerRef, bool abHasBeenSaid)
    Actor[] two = new Actor[2]
    two[0] = Game.GetPlayer()
    two[1] = akSpeakerRef as Actor
    GAM.RunScene("hug,pair", two)
EndEvent

8. Through the «Life» system: contexts

A context is a meaningful place where an animation is wanted: «wave», «a gesture in conversation», «hug», «dance for two», «closeness». A context does not name a scene itself. It holds tag queries in order of preference, the kind (overlay — a gesture, scene — a scene, gait — a gait), the number of actors, the body part and suitable furniture. The files are data/gam/contexts/*.yaml. Your own contexts go into %APPDATA%\BoopiMod\gam\contexts\*.yaml.

Your own contexts in the app. You do not have to write them by hand: G.A.M. → Library → «Contexts» → «+ Own context». The form has an id (Latin letters, digits, _), a kind («scene», «layer» — that is overlay, «gait»), a name in Russian and in English, tag queries (one per line, the first that finds anything wins), for a scene the number of actors and «Where it may play» (furniture), and the part of the body. The app keeps such contexts in %APPDATA%\BoopiMod\gam\contexts\app.yaml and lists them under «My contexts» with «Edit» and «Delete» buttons. Files you wrote yourself it leaves alone and shows read-only («your file»); the contexts of installed mods are marked «from the mod …». An id that the program, a mod or a file of yours already has cannot be taken. The editor sets no 18+ mark: your context never takes an intimate scene. Next to each context you see how many installed scenes fit it («fits: N»).

Your own contexts that your mod's lines and triggers name (anim.context, scene.context) and your own race groups mentioned in the roles of the packed scenes (@group) are put into the .ogmod by «Save the mod» by itself. For whoever installs the mod they are read next to their own and leave together with the mod; another context or group with the same id is not overridden — the install refuses (SCRIPT_STUDIO.md).

A call from Papyrus (BoopiCorp.esp and a running boopi_mod are needed):

OGAIAnim.Context("talk_gesture", akNpc, "npc") ; a gesture on the NPC
OGAIAnim.Context("hug", akNpc)                 ; a hero + NPC scene: camera, stages, waiting for the end
OGAIAnim.Tags("gesture,talk", akNpc, "npc")    ; the same by tags, without the core (GAM.Gesture / GAM.RunScene)

How a call through the core differs from a direct one:

  • the core picks a scene for these people and this place: sex, furniture nearby, «the same person — the same manner»;

  • the kind of call comes from the context: overlay — a gesture, scene — a scene;

  • an intimate context (intimacy) plays only after consent under the core's rules, and only with adults.

«Life» actions (act: hug, act: kiss in trees) are already linked to contexts through verbs: in life.yaml: a successful action plays its own context by itself.

Gaits and smoking. Sickness, withdrawal, a hangover, exhaustion and a worn body ask for a gait by a context of body.yaml (sick_cough, withdrawal_crisis, worn …), the living town for smoking (amb_smoke); scripts also have smoke_light, smoke_out, smoke_wall (against a wall) and smoke_sit (seated). Whatever is installed in the game and carries the tags answers. The app needs no animation mod of anyone else: when nothing fits, the person walks with the game's own walk and the gesture simply does not play — nothing breaks. You can make a gait of your own in the editor: a set of scenes with meta.gait (a stance, a walk and a run by direction, male and female) in a …/gait/<set>/ folder — details in docs/GAM.md, «Походка по условию» (gaits by condition). Ready gaits for all these contexts and the smoking scenes come with our «Gaits & smoking» pack (section 3).


9. Safety

  • Closeness (intimate) — only through the core and its consent: relationship stage, trust, sobriety, not in public, never for payment. Adults only, never a captive, never «forced».

  • GAM.PickScene, GAM.RunScene, GAM.Gesture and OGAIAnim.Tags never pick an intimate scene by tags.

  • Children. GAM.dll will not start a scene with closeness or romance tags (intimate, romance, kiss, sex, nsfw, flirt) if one of the actors is a child — no matter who calls it. The core will neither save nor install a scene in which a child has an intimate role.

  • External packs. A scene from another mod's pack for two or more, in which no simple safe action (a hug, a kiss, a handshake, a dance) is named, is considered intimate and goes only through consent.

  • People and animals — never.

If your mod calls a scene and it does not play, look into GAM.log. The line is a scene of closeness: never with a child means this protection kicked in. It cannot be bypassed, and that is by design.


10. A mod for our manager

10.1 What to put in the archive

MyMod.zip
└─ Data/
   ├─ MyMod.esp                         ; your plugin (NPCs, CK dialogues, quests)
   ├─ Scripts/MyMod_*.pex               ; your scripts (do NOT include GAM.pex - it comes from the G.A.M. pack)
   └─ GAM/Scenes/mymod/
      ├─ barman_wipe_glass.gam          ; your scenes: id = "mymod/barman_wipe_glass"
      └─ barman_toast.gam
  • Put scenes in your own folder (GAM/Scenes/<your_mod>/) so that ids do not clash with other people's.

  • Give your scenes honest tags. Contexts and other mods' queries find them by tags. A pair — pair, one actor — solo, the upper body — upper_body, closeness — intimate (without this tag the core will not let a scene into an intimate context, and with it — nowhere else).

  • State the dependency in the mod description: G.A.M. 0.3.0+ (and «Gestures from the game» if you call gesture,talk…).

  • The manager installs such an archive like an ordinary mod (hard links and a journal, one-button rollback). G.A.M. finds new scenes itself (GAM.Reload() or at the next load).

10.2 A minimal scene file

{
  "gam": 1, "id": "mymod/barman_toast", "name": "Тост", "mode": "absolute",
  "duration": 2.4, "loop": false, "blend": { "in": 0.3, "out": 0.45 },
  "tags": ["toast", "drink", "solo", "upper_body"],
  "roles": [ { "id": "a", "label": "A", "skeleton": "human", "sex": "any" } ],
  "tracks": [
    { "kind": "bone", "target": "a", "name": "RArm_UpperArm",
      "rot": [ { "t": 0, "q": [1, 0, 0, 0] }, { "t": 1.2, "q": [0.92, 0.38, 0, 0], "i": "auto" }, { "t": 2.4, "q": [1, 0, 0, 0] } ] }
  ],
  "props": [], "events": [], "markers": {},
  "meta": { "part": "upper" }
}

Main fields:

  • roles — actors in order: id, sex (male / female / any), skeleton (human).

  • tracks — bone keys; the quaternion is [w, x, y, z] in the bone's local axes, as in the game's clips.

    • kind: root — the actor's place and heading relative to the scene origin (for pairs).

  • markers — loop_start / loop_end (a loop: entry — loop until stopped — exit) and stage1…N (stages, 5.1).

  • meta.part — the default body part; meta.stages — stages with the number of passes.

  • props — objects: an anchor furniture piece (anchor: true), an item in place or an item in the hand (kind: held, role + bone); form is Plugin.esm|0x0004D1F9. In the editor's viewport they show as the game's real models from your game (when there is a model), not as boxes.

Scenes are easier to make in the G.A.M. editor (boopi_mod → G.A.M.): the skeleton, timeline, keys, IK handles, a check and one-button installation into the game are all there. How to work with it: ANIMATION_IMPORT.md.

The G.A.M. editor: IK handles on the body, the light panel, the timeline and the AI animator log

The G.A.M. editor: keys are placed with rings and IK handles right on the body, and the AI animator, given a description in words, places the participants and makes a first draft of the motion.

10.3 Version check

if GAM.GetVersion() >= 300        ; 0.3.0: stages, camera, PickScene, RunScene, Gesture
    GAM.Gesture(akSpeaker, "gesture,salute")
endif
if GAM.GetVersion() >= 400        ; 0.4.0: events performed, GAM_SceneEvent, the scene's face and camera, SetFace
    GAM.SetFace(akSpeaker, "happy")
endif

10.4 Editing a scene in the editor: undo, keys, mirror, time

Everything below is in G.A.M. (boopi_mod → G.A.M.), in the inspector on the right: the Body part and stages and Edit sections. The full list of keys is behind the «?» button of the editor's tool bar (or the ? key); the keys work in any keyboard layout.

Undo. Every edit of the scene can be undone: keys, rotations, dragging an IK ball (one drag is one step), roles, props, events, markers, stages, the scene's settings, optimisation and the AI animator's result. Ctrl+Z undoes, Ctrl+Y or Ctrl+Shift+Z redoes; the Undo / Redo buttons of the tool bar say what exactly. Typing in one field (the scene's name) or moving one slider is one step. The history keeps up to 100 steps while the program is open. Ctrl+S saves; the program does not let a window with an unsaved scene close silently, and the scene survives a restart as a draft anyway.

Version history. Undo lives while the program is open. What is already saved is not lost: before every save or delete the scene's previous version is kept (the last 12), and the «History» button in the tool bar brings any of them back (ANIMATION_IMPORT.md).

Keys on the timeline.

ActionHow
Pick a keyclick
Add to / take from the picked keysShift or Ctrl + click
Pick with a boxdrag over the empty part of the rows (with Shift — add)
Move the picked keysdrag any picked key — all of them go, by frames; Alt+←/→ — one frame (Alt+Shift — 10)
Delete the picked keysDelete
All keys / the keys at this momentCtrl+A / the «Keys at the playhead» button
Playheadthe ruler on top; ←/→ — a frame, Shift+←/→ — 10 frames, Home/End, [/] — previous / next key
Zoom and panCtrl + wheel — closer / wider at the mouse, Shift + wheel (or the wheel over the ruler) — along the time; «Fit» — the whole scene

Tracks in groups. The timeline shows the tracks by role and, inside a role, by body part: place, spine and head, arms, hands, fingers, legs, face. A click on a role's or a group's header folds it to one summary row (the moments of its keys show), «Fold the groups» / «Unfold all» does every one. The «Find a bone…» field and the «Show» list (all tracks / the picked role only / without fingers) hide the rest. A scene the AI made, with a hundred tracks, is no longer a sheet of fingers.

The key card is a strip right over the timeline (not in the middle of the right column): time, interpolation, ease, track weight and the value in numbers — a bone's turn as three angles (from the rest pose, as on the curves), a place as X / Y / Z, a role's place as a heading in degrees, a face as its weight. A number is typed freely (the field can be emptied, «-12.5» typed) and taken on Enter or when the field is left; ↑ / ↓ step it (with Shift — by 10). Interpolation and ease change on every picked key at once.

Pose. Ctrl+C copies a role's pose at this moment (every animated bone), Ctrl+V pastes it as keys at this moment — onto the same role or another one (the «→ role» choice in Edit): this is how a pose moves from actor to actor or from one scene to another.

Mirror (left ↔ right).

  • Mirror pose (M) — the pose at this moment is flipped: a wave of the right hand becomes a wave of the left one.

  • Mirror (Shift+M) — the picked keys move to the other side; with both sides picked they swap. Pick all keys (Ctrl+A) and the whole clip is mirrored, the character's path through the scene included.

  • Copy to the other side — the picked keys stay and their mirror image goes to the other side: a symmetric motion (both arms up) from one arm.

Bone pairs come from the skeleton's names (LArm_* ↔ RArm_*, LLeg_* ↔ RLeg_*); the mirror goes through the skeleton's rest pose, so the mirrored pose is an exact mirror image, not «roughly alike». The face and the helper bones (weapon, camera) are not mirrored.

Numbers and snapping. The role's card («Roles») has its place X / Y / Z and heading at the playhead: type a number and a place key is set. The pair is set up exactly there too: pick the partner (or an object), «Face it» turns the role toward it, «Stand at the distance» puts the role at the distance facing it (presets: talk 90, handshake 56, hug 26 units). Over the view are «Angle step» (1° / 5° / 15° / 45°: bone turns by the rings and the character's heading snap to it) and «Grid» (1 / 5 / 10 / 25 units: the character's place snaps to the floor grid while dragged).

A ready pose without the AI. «Edit» has a list of poses (standing, sitting on a chair, kneeling, crouching, sitting on the floor, lying) and «Put the pose on role …»: a whole-body pose is keyed at the playhead (the AI animator's own presets; no LLM key needed). On an empty scene the same poses are on the «Where to start» card — a new scene no longer has to start as the A-pose mannequin.

Time. The «Time factor» field: 2 — twice as slow, 0.5 — twice as fast.

  • «Stretch picked keys» — only the picked keys, from the first of them; with «Shift what follows» everything after them (keys, events, sounds, markers, stages) moves along.

  • «Stretch the scene» — the whole scene: keys, events, the timeline's sounds, markers, stages, props and the length. A sound is not stretched: only the moment it starts moves, the clip's length and trim stay.

The scene's length («Length, s») is typed as a number; when it gets shorter than the last keys or sounds, the field says how many are past the end and offers «Length to the last key».

Loop seam. A looping scene (the Loop box or the loop markers) jerks when the loop's last frame does not match its first — a common trouble of imported clips. «Fix loop seam» makes the loop's end equal to its start and bends the keys in the «blend window» before the end (0.3 s by default) smoothly into the seam.

Stages and body part. «Default body part» is meta.part: the bones the scene drives unless the call says otherwise (a gesture of the arms over a walk and so on). «Stages» are meta.stages (5.1): name, start, end and the number of passes; «+ Stage to the playhead» and «Split at the playhead» mark the scene up along the timeline, and the stages show as bands on the ruler.

Full screen. The «⛶ Full screen» button in the editor's tool bar (or F11) gives the whole window to the 3D view and the timeline: the sidebar, the top strip and the right column go away, and the properties and the library open with the «☰ Panel» button — they slide in over the picture. «⤢ Screen» takes the whole monitor too (no window frame); the program remembers which mode you used last. To leave, press F11 or «Exit»; Esc closes the panel first, then lets the picked keys go, then leaves. The scene, the selection, the playhead and the undo history stay as they are.

10.5 Polishing: curves, ghosts, trails, comparison, speed

Tools for polishing a finished animation by hand. They are viewing aids of the editor: nothing is written into the scene (except the edits you make), and their settings are remembered between runs.

Curves. The «Curves» button at the right of the timeline bar (next to «Keys») turns it into the curve view. It shows the tracks of the picked keys, or, when no keys are picked, of the picked bone in the 3D view; a click on a track's name in the key list picks all its keys and the bone. The «Whole role» box adds every track of the role.

The curves of a shoulder's rotation: three axes, a key with its tangents, the interpolation buttons, speed and frame steps

The curves of a shoulder's rotation: three axes, a key with its tangents, the interpolation buttons, speed and frame steps.

  • Channels — «Rotation» (three Euler angles X/Y/Z in degrees; by default as the bone's turn from its rest pose, the «From rest pose» box), «Position», «Face», «Field of view». The X Y Z buttons hide axes.

  • What you see is what plays. The line is the curve as the core samples it (the same C++ library the game uses: Bezier, automatic handles, squad with ease for rotations); it is recomputed under your hand while you drag a key. A mode the curve view does not know (the core learned a new one) is drawn from the core's own samples, marked «≈», and never guessed.

  • A key: a click picks it (Shift/Ctrl add, a box over the empty part picks a group). Drag in time (snapped to frames, Alt for free) and in value (the axis of the dot you took; Shift — only the way the mouse went further). Picked keys move in time together. One drag is one step of undo.

  • Tangents. For positions, the face and the field of view, a picked key shows its Bezier handles: drag one and the key becomes a «curve» key with your handles. For rotations the handles are small squares — the ease in and out (the further from the key, the softer).

  • Interpolation of the picked keys — the buttons «Smooth» / «Linear» / «Step» / «Curve» and «Ease» (a soft start and stop). The list of modes comes from the core and from the scene itself, so a mode the core learns later appears among the buttons without updating the program.

  • View. The wheel zooms time, Shift+wheel zooms values, Ctrl+wheel and the middle mouse button pan, F or «Frame» frames the picked keys, «All» — the whole curves. A click on the ruler at the top puts the playhead.

Ghosts (onion skin). The «Onion skin» button over the 3D view draws translucent silhouettes of the poses before (blue) and after (orange) the playhead — the body from your game, or a stick figure without one. The little arrow next to it opens the settings: how many ghosts each side (1–8) and where they stand — every few frames, or at the neighbouring keys.

Trails. The «Trails» button draws the path of the hands, feet and head (or of the picked bone) over the whole scene or ±1 s around the playhead; white dots are keys, the big dot is where the playhead is now. The left side is cyan, the right orange.

Ghosts and trails on a dance: blue poses before the playhead, orange after, the paths of hands and feet with their keys

Ghosts and trails on a dance: blue poses before the playhead, orange after, the paths of hands and feet with their keys.

Before / after. The «Compare» button puts the version of the scene from before your edit beside the scene. What to compare with is in its settings: before the last operation, as the scene was opened or saved, or any version from the history («History» in the tool bar). How to show it: as a pink ghost over the scene (only the part that changed shows), beside the scene, or instead of it. The «Hold to compare» button (or the B key) shows the old version for as long as it is held — flip between «was» and «is» quickly.

Compare: the pink ghost is the arm before the edit

Compare: the pink ghost is the arm before the edit.

Speed and steps. The timeline bar has the playback speed 0.25× / 0.5× / 1× / 2×, the frame back / forward buttons (← / →) and the previous / next key buttons ([ / ]). The speed is for watching in the editor only; it goes neither into the scene nor into the game.

10.6 AI polish: one button from a stiff scene to a natural one

A scene built by the AI animator or keyed by hand can be correct and still lifeless: every bone reaches its pose at the same moment, the motion between poses runs at one speed, the body freezes in the pauses. The «AI polish» section in the editor's right column brings it to life with one button, by the principles of animation rather than by eye:

  • smoothness — slow-in and slow-out between pauses, small jitter and jerks removed, the loop's seam closed;

  • overlap — the head, the arms and the fingers trail the torso by a few frames and overshoot a little when it stops (the spine leads);

  • anticipation and settle — a small move the other way before a big one and a soft stop with a little overshoot;

  • hand arcs — a hand travels to its target along an arc, not along a ruler;

  • weight shift — the hips go over the standing leg while the other is up, and a pose that leans out of balance comes back over the feet;

  • life layer — breathing, a slight sway and an occasional glance aside where the body stands still («Auto»; off for scenes that already move a lot).

Contacts stay where they are: standing feet do not slide, a hand on a partner's shoulder, on a table, on a tool's handle or in another hand stays there (it follows what it touches). Everything else is checked after the polish: where it spoiled the anatomy (an elbow, a wrist, a foot) that place is taken back by itself.

How to use it:

  1. Open the scene. The sliders set the strength of each technique (0.5 by default); «More settings» — anticipation, settle, arcs, weight.

  2. «Whole scene» or «Range» (from … to …; «From the selected keys» takes the time of the keys selected on the timeline).

  3. «AI polish». The log shows the work; below it the motion score before and after (0–100) and the numbers: jerks, balance, contact shake, stiffness. Not to your taste — Ctrl+Z (it is one step of undo); to compare by eye use «Compare» (before the last operation, section 10.5).

  4. «Check the motion» — the same numbers for the scene as it is, without changing it.

The «Visual check» box shows the scene's contact sheet to a model that reads images (the «Vision» route in Settings → Routing; DeepSeek reads no images — without such a model the check is simply skipped).

Role heights are in the role's card («Roles»): a number and a slider 0.5–1.5 (the same range as the core, the AI animator and GAM.dll) with about how tall that is in centimetres; the role's skeleton is scaled, and the pair scene is built for that height (a short partner's head on a tall one's chest). The «Heights in the game» switch over the roles picks what the game does: fit to the actors' heights (the default), do not fit (play as made) or give the actors the roles' heights (meta.heights: fit / off / apply). In the game an actor's height is the game's own, and G.A.M. fits the scene to the real heights: the places shift, and the hands that touch the partner (the back, the shoulders, the head, a palm) land on the same spot, so a hug with a short companion no longer floats. "Set this height on the actor in the game" makes the actor the role's height for the scene (put back afterwards and before any save).

The AI animator (the «AI animator» section, the first one in the right column) polishes its own result after its operations and checks it; what is still wrong (anatomy, balance, the visual check's findings) it fixes in a separate round — and when the fix round fails or makes it worse, the checked result of the first pass stays.

The findings of «Check the motion» and of the AI's log are written in the app's language and in plain words («the motion is wooden — body parts move in lockstep (67 %) … The AI polish helps», «the right elbow bends backwards (1.20–1.60 s, -34°)»); the score is 0–100, the check passes when nothing is found. A long polish can be stopped with «Cancel» — the scene stays as it was. A polish or AI result belongs to the scene it was asked for: when another scene was opened meanwhile, it is not applied to it.

A preview for a mod page. The «Preview…» list in the editor's bar records the scene's view: GIF (480 px, 15 fps, our own encoder), WebM (as on the screen) or a PNG still. The scene plays from the start, joints and rings are not in the picture; the file goes to %APPDATA%\BoopiMod\gam\previews, «Show in the folder» opens it. Previews of your scenes are yours to make; only an intimate scene with a child in it gets none (the same locked line as everywhere).


11. How to test in the game

The simplest is the animation menu in the game (G.A.M. 0.7.0): put the scene into the game, look at a person and hold "=" — the scene for yourself, for the person, for them and someone near, or for you both, Stop and the camera (ANIMATION_IMPORT.md).

Quickest — right from the G.A.M. editor (G.A.M. 0.4.0):

  1. Start the game and load a save; boopi_mod is open.

  2. In G.A.M. open or make a scene and press «▶ In game» (or the «In game» tab on the right). No need to save it: what is in the editor right now goes to the game.

  3. Pick who plays each role — The player, NPC in front (picked in the console with a click, or standing right in front of the player) or Nearest NPC — the camera and a limit in seconds, and press «▶ Play in game».

  4. The status line: «Sent» → «The game took the scene» → «Playing» → «Played». «Did not play» comes with the reason (no save loaded, nobody in front of the player, the race does not fit the role…). «■ Stop» ends the scene; the player's controls come back.

  5. Below is the «Game log (GAM.log)»: the lines about this scene (or all of them) with a hint on what to do.

The game takes scenes only while GAM.ini has [Editor] bLink=1 (the default). «The game is connected» means GAM.dll is asking the app for scenes.

The console (~) — call any global function from it:

cgf "OGAIAnim.Tags" "gesture,surrender" 14 "player"                 ; the hero raises their hands (14 - the hero's reference)
cgf "OGAIAnim.Tags" "gesture,talk,confident" <refid> "npc"           ; a gesture on an NPC (refid - click the NPC in the console)
cgf "OGAIAnim.Tags" "gesture,talk,friendly" <refid> "npc" "head"     ; head only
cgf "OGAIAnim.Tags" "hug,pair" <refid> "both"                        ; a hero + NPC scene with the camera

The log Documents\My Games\Fallout4\F4SE\GAM.log:

LineWhat it means
play 3 'gesture/hands_up' (1 actors, part 1, first 00000014)scene 3 started, body part 1 (upper)
scene 3 'gesture/hands_up' ended after 3.4 s (frames: 00000014:205)it ended; how many frames each actor received (0 — the actor was not updated: unloaded or far away)
scene 1 asked to stop at 20.8 sa script asked it to finish (Stop, the WaitScene limit)
camera: following scene 1 (auto)the camera took hold of the scene
no scene 'x' / needs 2 actors, got 1 / does not fit roleid not found / not enough actors / the race does not fit the role
scene 3 'x' event sound 'Fallout4.esm|0x0001A4E1' on 00000014a scene event was performed
scene 3 'x' event say: no topic '…'the event found no form (check Plugin|0xID and that the plugin is enabled)
scene 3 'x' face 'happy' on 0001A4D7the face track changed the expression
G.A.M. editor: command 5 play 'editor/my/hug' / command 5 failed: …a scene from the editor («Play in game») and why it did not play

In the app all logs — the core's, the game's, Papyrus and F4SE — are collected into a single file %APPDATA%\BoopiMod\logs\all.log, and errors into errors.log next to it.


12. Common mistakes

A gesture is not visible in a dialogue. The dialogue camera holds a close-up of the face. The upper body is hard to see, a nod (part: head) is easy. For arms use when: after or a wide gesture.

A scene for two in a dialogue «fights» the dialogue camera. Use when: after or start it in the OnEnd of the last line.

The NPC stands sideways. In a full-body scene the actors are put on marks. For a gesture the actor stays where they stand — turn them yourself (SetAngle) or use a scene.

A scene without stages runs for 20 seconds. That is the default limit for a looped scene. Set stages (5.1) or afMaxSeconds.

Nothing plays, the log is empty. There is no suitable scene. Check GAM.ListScenes("your,tags") and install a pack with such tags.

A clip's sound is not heard in the game. Open «Play in game» → the log: sound '...': no such file in Data\GAM\Audio - the file is not there (press «To the game» or «Play in game» again, they put the sounds in by themselves), nobody plays role 'b' - the clip's role has no actor, `the sound engine did not start - the system has no xaudio2_9.dll (Windows 10 or newer is needed). A clip marked «Mute» and bSounds=0 in GAM.ini [Sound]` are silent on purpose. The loudness also follows the game's own sound slider and the distance to the role's actor (a scene clip is «in the head»: distance does not matter).


13. What next