FiveM scripts · Cortex Multicharacter

Author Cortex Multicharacter selection scenes

Add locations, place characters, frame cameras, and save poses in game with /cortex-scene-here and /cortex-spots.

9 sections · 6 min read

How scenes work

Each entry in Config.Scenes is a location. Each connection gets one random enabled location. It is kept through refresh, relog, and resource restart. Reconnecting picks again.

A location has an anchor and an optional list of spots. Each character takes a spot. Characters without a spot stand in a lineup at the anchor. They never borrow a spot from another location. Each player has a private routing bucket and local preview peds, so two players can share a location without seeing each other.

Three locations ship enabled: penthouse (Diamond Penthouse, eight authored spots), beach (Vespucci Beach, lineup only), and rooftop (City Rooftop, lineup only). The beach and rooftop are starting presets. Check ground level and framing on your map before using them.

Add a location

/cortex-scene-here captures a complete scene entry from where you stand. It copies the entry to your clipboard and prints it to F8. It does not save anything on the server.

  1. Load into the world. Stand where the lineup should be centred and face the direction the characters should face.
  2. Run /cortex-scene-here with a unique ID and a name, for example /cortex-scene-here harbor Harbor View.
  3. Paste the entry inside Config.Scenes in config.lua. Set enabled = false while you are still working on it.
  4. Restart cortex-multicharacter. The empty spots list already works through the automatic lineup.
Example Config.Scenes entry
{
    id = 'my_rooftop',
    enabled = true,
    label = 'My Rooftop',
    anchor = { x = -1023.45, y = -418.42, z = 67.66, w = 205.69 },
    camera = { distance = 3.0, overviewDistance = 3.4 },
    lineup = { spacing = 1.0, maxWidth = 3.2 },
    time = { hour = 21, minute = 30 },
    weather = 'CLEAR',
    spots = {},
},

Scene fields

IDs use letters, numbers, underscores, or hyphens. Keep them stable, because saved positions are stored by scene ID. Up to 64 locations and 64 spots per location are accepted. At least one location must be enabled.

FieldPurpose
idStable unique ID. Saved spots are stored under it.
enabledfalse keeps the scene out of new assignments. The editor can still find it.
labelName shown in the editor.
anchorLineup centre as { x, y, z, w }. w is the direction the characters face.
camera, lineupOptional overrides of Config.Camera and Config.Lineup for this location.
time, weatherOptional, for example time = { hour = 18, minute = 30 } and weather = 'CLEAR'.
spotOrderOptional override of Config.SpotOrder for this location.
spotsDefault spots. Saved in-game spots replace this whole list.

Place characters with /cortex-spots

Use /cortex-spots while logged in and playing, not from the selection screen. It edits the nearest configured scene, including disabled ones, and shows that scene's name. Without a body argument, the stand-in copies your current model and appearance.

Run /cortex-spots with no number to author a new spot. Add a number to edit an existing spot, and add male or female to load that body. Run /cortex-spots again with no arguments to close the editor.

Chat commands
/cortex-spots
/cortex-spots 1
/cortex-spots 1 male
/cortex-spots 1 female

Editor controls

The editor has three modes. Position moves the stand-in. Camera sets the selection camera. Aim moves the camera target. Hold Shift for fine movement in any mode.

ControlAction
Arrows, PgUp/PgDn, Q/EPosition mode: move, change height, turn.
ScrollCycle the poses available for the current body or model.
BSwitch between the male and female stand-ins.
HToggle the selection camera preview.
GPosition mode: move the stand-in to you.
TabCycle Position, Camera, and Aim. Camera and Aim open the preview.
Camera modeLeft/Right orbit, Up/Down closer or farther, PgUp/PgDn lens height, Q/E wider or tighter.
Aim modeArrows move the aim across the body, PgUp/PgDn aim height, Q/E shift the character left or right on screen.
RCamera or Aim mode: toggle automatic angle search.
Z / CPrevious or next spot, including New. Unsaved edits are kept while the editor is open.
EnterSave the current spot to the server.
Shift + EnterCopy the current spot to the clipboard and F8 as config text.
BackspaceClose the editor and discard unsaved edits.

Saving and permissions

Enter saves only the current spot, including its male, female, and model variants. Save each changed spot separately. Reopen selection to see the change. No config edit or restart is needed.

Saving needs the ACE in Director.SaveAce, which defaults to cortex.multicharacter.edit, or the admin ACE. Director.SaveRadius limits spots to 250 metres from the scene anchor by default. Values from 10 to 1000 are allowed.

Saves go to the resource's server KVP under scene-spots:SCENE_ID. The previous confirmed list is kept at scene-spots:SCENE_ID:backup. There is no reset command. Restoring a backup is a server maintenance task. Renaming a scene ID or the resource changes which saved data is found.

If another editor saved first, the save is rejected. Copy your work with Shift+Enter, close, reopen, and apply it again. If a save timed out, reopen and check before trying again.

server.cfg
add_ace group.admin cortex.multicharacter.edit allow

Bodies and poses

Each spot can hold separate male and female entries with their own pose, at position, and camera. Set either to false to disable that body at the spot. A new spot enables only the body you saved or edited. Spots and poses also accept models = { ['ped_model_name'] = { ... } } for an exact ped model. An exact model entry wins over the body entry.

Config.Poses defines 22 poses: stand, lookout, lean, think, couch, chair, lounge, bed, sofa, floor, arms_crossed, arms_folded, wait_relaxed, wait_impatient, think_chin, think_director, lean_relaxed, lean_bar, sit_casual, sit_forward, sit_ground, and sit_slouched. They use base-game animations only. Preview both bodies before assigning a seated or reclined pose. For a spot, at's z value is the seat or mattress height for sitting and lying poses.

Config.SpotOrder controls which character gets which spot. 'random' shuffles the spots each connection. 'config' uses list order, with slot 1 first. The default is 'random'.

Camera and lineup defaults

Config.Camera and Config.Lineup apply to every scene unless a scene or pose overrides them. The camera is pulled in automatically when a wall is close.

KeyDefaultMeaning
Camera.distance3.4Preferred lens distance in metres.
Camera.frame2.4Metres of height kept in shot.
Camera.screenX0.64Where the selected character stands on screen, 0 left to 1 right.
Camera.transition950Milliseconds between characters.
Camera.intro1900Milliseconds for the opening glide.
Camera.blurtrueDepth of field behind the selected character.
Lineup.spacing1.2Metres between characters.
Lineup.maxWidth5.4The line is compressed to fit this width.
Lineup.unselectedAlpha150Transparency of unselected characters, 0 to 255.

Test a scene

To force one location while you work on it, temporarily enable only that scene and restart Cortex. Test with enough characters to fill the authored spots and the overflow lineup, then relog, restart the resource, and reconnect. Restore the normal enabled list when you are done.