Configuration
Store
config_shops.lua: the notebook store with its NPC, blip, opening hours, 3D preview, wagon, items, prices, selling back and texts.
config_shops.lua sets up the store that sells the coloured notebooks, and the back radio set while fx-radio is started. Its layout is the same as fx-accessories' config_shops.lua. Price, distance and job are checked on the server. Money and items go through FXShop in framework/frameworks.lua, for VORP and RSG.
The shipped store stands near Blackwater as a placeholder. Correct info.coords, preview.previewPropsCoord and wagon.coords in game.
#General settings
| Setting | Default | What it does |
|---|---|---|
Config.SellPercent |
50 |
Every item of a store can be sold back there for this share of its price, in the same money type. 0: no selling |
Config.PreviewLight |
see below | Light on the preview item, used when a store has no previewLight |
Config.AutoRotatePreview |
false |
Turn the preview item by itself |
Config.PreviewRotation |
vector3(0.0, 0.0, 180.0) |
Pitch, roll and extra turn of preview items. The props face -Y, so 180 shows their front. A BuyItems row can have its own previewRotation |
Config.PlacementCamFov |
45.0 |
Preview camera field of view, when the store has none |
Config.PlacementCamDist |
0.6 |
Preview camera distance, when the store has none |
Config.PlacementCamHeight |
0.25 |
Preview camera height |
Config.PlacementCamAngleOffset |
87.0 |
Preview camera turn round the item, when the store has none |
Config.HideHud, Config.ShowHud |
functions | Called when the store opens and closes. The shipped ones hide and show fx-hud when it is started |
Config.TargetSystem |
'auto' |
Target script for stores with useTarget = true: 'auto' (the first started of ox_target, murphy_interact, pc_interaction, rsg-target), 'ox_target', 'murphy_interact', 'pc_interaction', 'rsg-target'. None started: the hold prompt is used |
Config.OpenStoreKey |
0x2CD5343E |
Key of the hold prompt (Enter) |
Config.Prompts.store |
Label = 'Pocketbook Store', distance = 2.0, one key with HoldTime = 700 |
The hold prompt |
Config.TargetSystem is also used by the phonograph when Config.Music.Target.System is nil.
#Config.PreviewLight
luaConfig.PreviewLight = {
Enabled = true,
Time = { AlwaysOn = true, StartHour = 20, EndHour = 6 }, -- only between these hours when AlwaysOn = false
Direction = { Mode = "custom", CustomOffset = { X = 0.0, Y = 0.0, Z = 1.2 } }, -- top_down | side_right | bottom_up | custom
Visual = { ColorHex = "#ffffff", Range = 2.0, Intensity = 20.0 },
}
#Config.Stores
One entry per store, by key. The shipped one is ["blackwater"].
#info
| Field | Shipped value | What it does |
|---|---|---|
storename |
'Blackwater Pocketbook Store' |
Store name |
promptitle |
'Pocketbook Store' |
Prompt title |
useTarget |
true |
true: target (Config.TargetSystem). false: the RDR2 hold prompt |
distance |
2.0 |
Players trade within this distance of the NPC |
coords |
vector4(-852.2557, -1244.9204, 42.5395, 180.0) |
NPC position and heading |
blip |
enabled = true, sprite = -417940443, color = 'BLIP_MODIFIER_MP_COLOR_0', name = 'Pocketbook Store', scale = 0.6 |
Map blip |
openTimeSetting |
allowed = false, open = 8, close = 21, blipSprite, blipmodifier = 'BLIP_MODIFIER_MP_COLOR_2' |
allowed = true closes the store outside open to close on the game clock. The blip takes blipmodifier while closed |
requiredJobs |
false |
false: everyone. { 'job1', 'job2' }: only these jobs |
#previewLight, ped, preview, wagon
| Block | Fields |
|---|---|
previewLight |
Same layout as Config.PreviewLight. The shipped store uses CustomOffset Z = 0.4, Range = 3.5, Intensity = 22.0 |
ped |
enabled, model ('cs_mp_travellingsaleswoman'), outfit (0 = the model's default outfit, 1, 2, 3... = its outfit preset), spawnDistance (30.0), scenario ('WORLD_HUMAN_SMOKE_NERVOUS_STRESSED'), anim = { animDict, animName } |
preview |
enabled, previewPropsCoord (where the selected item is shown), camDist (closest camera distance; it backs off to fit bigger items), camAngleOffset, lift (how far the item floats above the point, in metres), camFov |
wagon |
enabled, spawnDistance (80.0), model ('p_chuckwagon01b'), coords, wagonProps (models attached to the wagon with offset, rotation, bone, collision; the shipped one is the p_gangwagoncloth01x tent) |
#BuyItems
lua{ itemName = "pocketbook_sand", itemLabel = "Pocketbook (Sand)", category = "notebooks", price = 10.0,
previewRotation = vector3(75.0, 0.0, 180.0), previewModel = "fx_pocketbook_sand" },
| Field | What it is |
|---|---|
itemName |
Inventory item |
itemLabel |
Name in the store |
category |
"notebooks" or "radio" |
price |
Price |
moneytype |
"cash" or "gold". Cash when left out |
previewModel |
Model shown in the preview |
previewRotation |
Optional, overrides Config.PreviewRotation |
requires |
Optional resource name. The row exists only while that resource is started |
image |
Optional picture link for the store card |
Every one of the 15 notebook colours has its own picture in the store. Shipped prices: each of the 15 notebooks 10.0. The three radio rows (pocketbook_radio 75.0, pocketbook_radio_battery 15.0, pocketbook_radio_charger 30.0) have requires = "fx-radio" and take their pictures and preview models from fx-radio, so they are hidden while fx-radio is not started.
The preview waits up to about 5 seconds for a model the first time it is streamed. A model the game does not know fails at once with "The preview model could not be loaded."; see Troubleshooting.
#Config.ShopLocales
The store texts, one block per language. Config.Locale picks the block, English when it is missing. The file has tr and en. Add a language by copying the en block under a new key. ${count}, ${item}, ${price}, ${currency} and ${open} are filled in.