Theme
The RP character in game
On a WFramework server, the server's database is the truth, not the player's Ubisoft save. When a character spawns, nothing from the campaign is kept: no weapon, no ammo, no gadget, no campaign outfit. The player appears in a basic outfit, unarmed, at the position where the character last left.
Nothing is ever written to the player's real save: during a WildM session the wildm_net client plugin blocks save writes, and all RP state lives in game-server/data/wframework.db.
Waiting for client natives
The server side and the client script (wf_core/client/character.lua) are ready and tested. Removing campaign weapons, giving weapons and changing the outfit need client natives that the WildM client does not have yet (reverse engineering in progress). Until then, these steps are skipped and logged once.
What happens at spawn
- The server loads the character and sends
wf:spawnwith{ coords, appearance, loadout = {} }. - The client applies the appearance (outfit, face…), removes all weapons and gear, then teleports the player.
- The loadout is empty: weapons stay in the inventory until the player equips one.
The same steps run again whenever the engine recreates the player (death, fast travel, reload) and when the player leaves the game's own loadout or gunsmith menu, so nothing taken from there survives. Weapons picked up in the world are removed within a second.
Appearance
Stored per character as a small object, validated by the server:
json
{ "preset": "base", "torso": "shirt_white", "legs": 12, "face": 3 }Allowed keys: preset, model, face, skin, hair, beard, head, mask, glasses, torso, undershirt, gloves, legs, feet, backpack, accessory, tattoos, colors. Values are short strings or integers (engine ids, or a list of them), 2 KB in total.
- New characters get
defaultAppearancefromwf_core/config.json({ "preset": "base" }= the minimal outfit), merged with what the player chose at creation. - Server scripts change it with
exports.wf_core:SetAppearance(source, appearance, merge)— e.g. a clothing shop. - The client can only send an appearance itself (
wf:saveAppearance) after a server script allowed it once withexports.wf_core:AllowAppearanceEdit(source)— e.g. when opening a character editor.
Weapons
Weapons are inventory items (like ox_inventory), defined with "type": "weapon":
jsonc
"weapon_pistol": {
"label": "Pistolet", "type": "weapon",
"weapon": "P227", // engine weapon id given to the client
"ammo": "ammo_pistol", // the item that loads it
"maxAmmo": 60, "weight": 900
}- Each weapon is unique: it never stacks and gets a
serialand anammocount in its metadata. Giving, dropping or storing it keeps both. - Using a weapon item equips it, using it again puts it away. At most
maxEquippedWeapons(default 3) at once. - Using an ammo item loads it into an equipped weapon that takes it, up to
maxAmmo. - The client reports the rounds left after shooting; the server only accepts a lower count, never a higher one.
- A weapon that leaves the inventory (given, dropped, put in a trunk, removed by a script) is unequipped at once. Unloading the character unequips everything: the next spawn is unarmed again.
Client natives required
| Native | Purpose |
|---|---|
RemoveAllWeapons() | remove every weapon, ammo and gadget |
GiveWeapon(weapon, ammo) | give one RP weapon |
GetWeapons(), GetWeaponAmmo(weapon) | detect picked-up weapons, report shots |
ApplyAppearance(t) | apply the outfit (preset = "base" or pieces) |
IsInLoadoutMenu() | re-apply after the game's loadout menu — available |
SetPlayerCoords(x, y, z, heading) | available |
event wildm:playerSpawned | the engine recreated the player |
The weapon ids in the sample items.json (P227, MP5, M4A1) are placeholders until GiveWeapon defines the real ids.