Esc to clear, Enter to open the best match, click an export to open it in its page
Director

The Director

The Director builds missions, heists and stories in game from cards, with no code. Your resource can start and steer its runs, hear what they do, ship scenarios, and add cards of its own.

Scenarios, runs and cards

Scenarios are managed in /whip → Director (the /w menu's Director row opens it too) and built in game, in the world.

Who may build

LevelPermissionMay
Builderdirector.buildSee every scenario; make, edit, test, switch on and off; restore an old revision; stop a run
Director admindirector.adminAll a builder may, and delete scenarios, accept shipped packs, export packs, and give or take Director access
Dungeon Masterdirector.liveDungeon Mode: change the live world until a restart. Neither of the other two includes it, nor does it include them
Full adminwhip.devtoolsAll three, always, and the /director dev commands

Give access per account in /whip → Director → Access: pick a character, and every character on that account has it. A builder who isn't a full admin sees only the Director in /whip; a Dungeon Master sees only its Dungeon Mode page.

Builders see through walls. The world builder's camera goes anywhere. Give Director access only to people you trust.

How a scenario starts

Switching a scenario on makes it available. A run then begins the way its Scenario Enabled card's It starts says:

It startsHow
When it's switched onThe default for a new scenario. A run starts at once with nobody in it, and players join it (below)
Talk to an NPCTalk on a standing NPC. While its runs are full, others see "They're busy right now."
Press somethingAn E prompt, in your words, on a standing prop or a spot (a laptop, a keypad, a job board)
A player comes nearWithin the distance of a placed thing. Once a visit: still there when their run ends, they must leave and come back. One turned away by full runs gets one as soon as a place frees
Use an itemKept unless Used up. Only an item that does nothing else when used (Check refuses one that does); two scenarios can't start with the same item
On a timerEvery so many minutes, the first that long after switching on: one run for every player near a placed thing
From a scriptexports.whip_core:StartScenarioRun(key, source) from another resource (a phone app, a job menu)
By handOnly Start a run: admin-run events

When it's switched on, Scenario Enabled's cards play straight away and what they make (an NPC to talk to, vehicles, props) is out for everyone. The first player to talk to its NPC (a Dialog Line), press its prompt (Wait for Press, an Interaction Menu) or come near (Player Arrives) joins the run, and that card plays for them. The job starts at Scenario Started By Player (before it nothing counts), or as they join when there's no such card.

When that run ends, however it ended, a fresh one starts a couple of seconds later. One that ended before anyone joined (a Succeed with nobody there) waits until the scenario is switched off and on. Start a run and StartScenarioRun put the player into the waiting run.

With the other choices, a run starts for the player who does it, and Scenario Enabled's cards play then. Test starts one for you at once whatever it says, and anyone with Director access can press Start a run on its page in /whip. Started any other way, a player is never in two runs of the same scenario, and Runs at once and Players this close join apply.

For other resources#

The Director tells other resources what its runs do, and its server exports start, read and steer runs. Two rules run through all of it:

A builder fills in settings for you in Settings → For scripts: Kind (a few words, "heist, crime") and Where it happens (a placed thing: the bank, not the job giver) become a run's and a scenario's kinds and where. Scripts may switch it on and off allows SwitchScenario.

Server eventPayload
whip_core:run:started{ run, startedBy = { mode, by } }. mode: interaction · press · area · item · timer · script (by: the resource) · hand · enabled (When it's switched on: the run has nobody in it yet)
whip_core:run:ended{ run, outcome, reason, vars, payout, faultCard, stopping }. outcome: succeeded · failed · calledOff (a Call Off card) · aborted (an admin, the last player leaving, whip_core stopping) · faulted
whip_core:run:playerJoined{ run, source, charId, by }: AddPlayerToScenarioRun
whip_core:run:playerLeft{ run, source, charId, why, by, runEnds }. run is without them; sent before its run:ended; by: the resource that took them out
whip_core:run:signalled{ run, name, data = { value }, source }: a Send Signal card
whip_core:scenario:switchedOn / :switchedOff{ scenario, name, rev, replaced | why, by }. by: { source, name } (a person), { resource } (SwitchScenario) or nil (the server itself)
AddEventHandler('whip_core:run:started', function(e)
    if GetInvokingResource() ~= 'whip_core' then return end
    local run = e.run
    for _, k in ipairs(run.kinds) do
        if k == 'heist' and run.where then
            -- one mark for every on-duty officer, by character (it follows them through a relog)
            local people = {}
            for _, o in ipairs(exports.whip_core:GetClockedOnEmployees('police') or {}) do
                people[#people + 1] = { charId = o.charId }
            end
            if #people > 0 then
                -- the run's tag: the mark goes when the run ends
                exports.whip_core:ShowBlip({ people = people }, 'heist:' .. run.id,
                    { coords = run.where.coords, label = 'Alarm: ' .. run.where.label, sprite = 161, color = 1, tag = run.tag })
            end
        end
    end
end)

Two cards let a builder work with your script without a card of yours: Send Signal (you hear whip_core:run:signalled) and Wait for Script Event (the run carries on when you call SendDirectorEvent).

On the player's game (a phone's job screen, a HUD), exports.whip_core:GetPlayerScenarioRuns() returns the runs that player is in: { { runId, scenario, name, objective, countdown } }. The local events whip_core:run:joined, :updated (their objective or clock changed), :left and :ended ({ outcome, payout }) say when that changes. Never a Test.

Shipping scenarios in a resource

A resource can bring scenarios as data, with no scripts: one manifest line per file.

-- fxmanifest.lua of your pack
whip_director_scenario 'scenarios/bank_job.json'
whip_director_scenario 'scenarios/drug_run.json'

Each file is a scenario document as the editor saves it ("format": 2, at most 512 KB), with "key" (its key on every server) and "requires": { "items": [...], "models": [...], "resources": [...] }. Its "taskTimes": 2 says a task time of 0 is no end and a give-up of 0 is never; in a document without it, either 0 is a tenth of a second. Things it ships unplaced ("coords": "spot") are placed by each server in a copy. Export as a pack (a Director admin, on a scenario in /whip) writes one in exactly this shape to whip_core/pack_exports/, with its manifest beside it.

To offer scenarios or editor templates from code, use Whip.scenario and Whip.template (Cards of your own).

The Director in /whipServer owners

PageWhat it shows
OverviewNumbers for every scenario, or some, over 7, 14, 30 or 90 days: payouts, runs, successes, why runs fail, the newest runs. Tests left out
ScenariosEvery scenario. Its page has Active (its newest revision; edits made while on go live when you switch it off and on), Previous Versions with Restore, Duplicate, Open Editor, Start a run and Delete
Lore charactersThe people your stories come back to: picture, details, voice lines, where they're used
ShippedScenarios resources bring, and anything this server lacks to run one
Live runsRuns going now, with Stop; scenarios on from a file (/director load)
Access · Dungeon ModeWho has Director access (Director admins only) · what you made in Dungeon Mode, each with Remove

Building a scenarioServer owners

New scenario or Open Editor takes you into the world builder: place its people and things with Place, set each one up with Configure, and open Blueprint for its cards in a window over the world. Fullscreen opens the full editor (Cards, World, Variables and Settings tabs; Save, Test and Check); its ‹ or Esc goes back into the world.

Building togetherServer owners#

Several builders can work on one scenario at the same time. Everyone who opens it is in the same scenario: what one changes, the others see as it happens, and Save saves everyone's changes as the next revision, whoever presses it.

Cards builders useServer owners

CardWhat it does
Dialog LineAn NPC's line with answers. Each answer can have rules: offered only if (an item, cash, a player flag, a variable), a cost, once a run or once ever, and a chance rolled on the server (a miss goes out of Answer N failed)
Multiple ChoiceA question with up to four answers on the player's screen, with no NPC: "Shots inside: go in, or stay in the car?" The keys and the answer rules are a Dialog Line's, and each answer is its own outcome. It waits while the player is talking to someone or is down, and the inventory or phone only hides it until they close it
Sell to NPC · HaggleThe NPC buys an item at a price. Haggle agrees a price and moves no money: wire Deal to Sell to NPC, Pay or Take Item
Goal cardsShow Objective, Show Blip, the wait and Clear Objective in one: Go To, Deliver the Vehicle, Kill Them All, Collect, Bring Item To, Steal the Vehicle, Search, Speak To, Survive
Set Player Flag · If Player FlagRemember something about the player for good (Player flags), and branch on it
Claim Vehicle · Give VehicleThe run's vehicle made the player's own (ClaimVehicle), or a new vehicle of their own
Force Player(s) Change Vehicle SeatFor each seat of the run's vehicle, where its player goes: "If in Driver, move to…" lists that model's other seats. The run's players move as if they picked the seat on the wheel's Seats page. Players who swap seats go one after another, through a free seat. A seat held by someone who stays (an NPC, or a player whose seat is set to Stay) isn't freed for them, and the card goes out of Not all moved
Fire WeaponRemote Control Firearms (firearms placed from the world builder's More, a rifle until you change its Gun) fire real shots that hurt, every one picked at once, in a Test too
Play on Speakers · Stop SpeakersProps play a song from a Fivemanage link, in step, heard through walls like a voice, until stopped or the run ends (Speakers)
Send Signal · Wait for Script EventTalk to your scripts (For other resources)
Phone Call · Lore SaysA lore character phones a player or speaks (Lore phone calls, Lore characters speak)

Others give items, take money, show objectives and clocks, put up props, open menus and move NPCs. A card that waits on the server gives up out of Took too long.

What a run hands out#

In a live run, items are real: what Give Item, Drop Item and Put in Vehicle hand out, a heist's loot and a run vehicle's keys are the player's to keep. A Test marks everything it hands out and takes it back when it ends, from its players and the ground (a test's items).

NPCs, vehicles and propsServer owners

Configure opens a thing's page, with these tabs among others:

Interaction points (More, Interaction Point) are what Wait for Press puts up for players to press. Each one's page sets its Interaction Text and icon, its size, how far it's seen and pressed from, whether it faces the player or stays locked as placed (turned with it, leaning back on a table), and whether it's gone once pressed until the next run. Place and turn it in the world builder like any other thing; while it's selected there it shows as it looks up close. An Interaction Menu on a point takes its place and look, with the menu's own words.

Routes (More, Route) are points an NPC walks with its Walk a Route task. Props have Physics on unless switched to static; a static one is made by each player's game (ShowPropSet). Config.ExperimentalDriveSync (off by default) has every game play recorded drives itself, smooth on every screen. /npcdebug shows each NPC's and vehicle's task.

Dungeon ModeServer owners#

The world builder with no scenario: what a Dungeon Master (director.live) makes goes into the live world, for everyone, with nothing to save. Open it from /whip → Director → Dungeon Mode → Start Dungeon Mode, or the Dungeon Mode row under Panels in /w (full admins).

What you make stays until a restart or until you remove it. It's yours by account, so it stays when you log off; only you or a full admin removes it. One account may have 150 things and 20 effects up at once; everyone together, 600 and 80. Everything is logged on the activity log as dungeon_mode.

Nothing that lasts past a restart. A Dungeon Master sees these greyed, Admins only, and the server refuses them: making a car someone's, changing a saved car (put away, delete, owner, stats, repairing a player's own), a player's stats, movement style or character editor, kick and ban, inventories, trunks and gloveboxes, getting into a player's locked car, and changing a ground item. Restore health and Restore armour stay open.