In Barkdell, the Tryker village on the newbieland island, the Sage Mac'Rippsey Jidgen keeps the tales of his people. He sends the player to Ba'Dardan Lixie, the storyteller of a small troupe that plays the story of Loria on the sand outside the village. The troupe cannot play yet. Their Loria needs pebbles for her pocket, an elder needs a string of yubo teeth, and the actress needs new boots. The player gets each from one of three villagers, by foraging, hunting and crafting. Once all three tasks are done, the Sage offers the rite: watch the first act of the play. The storyteller narrates, the actress and two elders act it out on the sand, and at the curtain the player pays the troupe. The encyclopedia then shows the theme's reward text, which tells the whole tale.
The sample shows how an encyclopedia theme is put together from mission primitives, Georges sheets and phrase files, and how a mission can direct AI bots through a scene. Every part is regular leveldesign data, written the way the World Editor writes it, and can be copied for other themes.
TRYKER_STORY4_INTRO). The Sage greets the player and sends them to the storyteller. Talking to the storyteller unlocks the theme in the encyclopedia (encyclo_unlock : 12 19), and he names the three villagers who need help.Tasks and marks its task done in the encyclopedia when it succeeds.R_12_19). Once all three tasks are done, the Sage offers it. The player talks to the storyteller and watches six scenes, targeting the actor each scene ends on, then pays 50 dappers. The rite rewards 200 dappers and 300 Tryker fame and completes the theme.A task done before the introduction also shows the theme. Only the rite needs the tasks.
All paths are in the leveldesign repository.
| File | Holds |
|---|---|
primitives/tryker/nland/urban_tryker_story4.primitive |
The NPCs, the stage states and routes, and the compiled missions |
primitives/tryker/nland/missions_tryker_story4.primitive |
The mission source: five mission_tree nodes |
primitives/tryker/nland/botobjects_tryker_story4.primitive |
Scenery: jars, the costume chest, the stage tent, lamps, flags, a ruin wall, campfires |
primitives/tryker/nland/fauna_tryker_story4.primitive |
Two herds of six Suckling Yubos (chdla1) on the meadow west of the village |
primitives/tryker/nland/deposit_tryker_story4.primitive |
The shell deposit on the pond shore |
game_elem/creature/npc/newbieland/tryker_story4_*.creature |
The twelve NPC sheets |
game_element/encyclopedia/album_12.encyclo_album, thema_12_19.encyclo_thema |
The encyclopedia album and theme |
translation/work/phrases/rites/missions_tryker_story4_wk.txt |
The mission phrases, written by the mission compiler |
translation/work/phrases/rites/tryker_story4_npcs_wk.txt |
The greetings and the actress's lines |
translation/translated/phrase_*.txt, clause_*.txt, bot_names.txt |
The translations and the display names |
The five primitives are registered in primitives/file_index.cfg with file numbers 818 to 822. The first four are listed under tryker_newbieland in primitives/primitives.cfg, the list the services load. The mission source is not listed: the services read the compiled missions from the urban file.
An alias in the game is the file number shifted left by 20 bits, plus the alias inside the file. The Sage is 818:4, 857735172, and the rite is 818:65, 857735233.
The album sheet names its title phrase, its themes and its number:
<ATOM Name="Title" Value="ENCY_ALB_12"/>
<ARRAY Name="Themas"> <ATOM Value="thema_12_19.encyclo_thema"/> </ARRAY>
<ATOM Name="AlbumNumber" Value="12"/>
The theme sheet names its title, its reward text, its tasks and its rite, each by phrase id or mission name:
<ATOM Name="Title" Value="ENCY_THM_12_19"/>
<ATOM Name="RewardText" Value="ENCY_THM_TXT_12_19"/>
<ARRAY Name="Tasks">
<ATOM Value="TRYKER_STORY4_TASK_FORAGE"/>
<ATOM Value="TRYKER_STORY4_TASK_LOOT"/>
<ATOM Value="TRYKER_STORY4_TASK_CRAFT"/>
</ARRAY>
<ATOM Name="Rite" Value="R_12_19"/>
<ATOM Name="ThemaNumber" Value="19"/>
A theme has up to seven tasks. When a mission named in Tasks succeeds, its task is marked done. When the mission named in Rite succeeds, the theme is complete and the encyclopedia shows the reward text. The ENCY_* phrases for album 12 are in translation/work/phrases/encyclopedia/phrase_ency_alb_12_wk.txt.
The services warn at startup when the album numbers have gaps ("Albums number not continuous"), which happens while other albums are missing. The warning is harmless.
| Bot name in the primitive | Shown as | Sheet | Where |
|---|---|---|---|
ejootle$fct_sage$ |
Mac'Rippsey Jidgen (Sage) | tryker_story4_sage |
North-east corner of the Barkdell deck |
story4_wardrobe |
Ba'Wiley Effer | tryker_story4_wardrobe |
In the lodging on the west side of the deck, beside the costume chest |
story4_beachcomber |
Be'Massey Lipsie | tryker_story4_beachcomber |
On the pond shore, beside the shell deposit |
story4_hunter |
Mac'Doyley Baxy | tryker_story4_hunter |
On the west shore at the edge of the village, facing the yubo meadow |
noeh |
Ba'Dardan Lixie | tryker_story4_narrator |
In front of the stage on the sand south-west of the village, facing the audience |
luria$fct_actress$ |
Be'Nary Lixie (Actress) | tryker_story4_actress |
On the stage, spawned for the play |
elder$fct_actor$, elder_2$fct_actor$ |
Be'Yle Lixie, O'Roley Lixie (Actor) | tryker_story4_elder_1, _2 |
On the stage, spawned for the play |
blo, ehct, hetk, jebo |
Four spectators | tryker_story4_spectator_1 to _4 |
Facing the stage |
The part of a bot name between $ signs is a function title from title_words, shown under the name. The display names come from bot_names.txt. Each bot's chat_parameters contains a menu: MENU_WHOAMI TRYKER_STORY4_GREET_<NAME> line, which adds a "Who are you?" option to its menu that answers with a greeting phrase.
The NPC sheets are generated. The story4 list in scripts/generate_r2_sheets/generate_creature_npc.py gives each sheet a look (a base .creature such as _trhc2old), a colour and an item in the right hand. A new sheet needs a sheet id and a run of the data pipeline before the client and the services know it (see Item and NPC sheets).
The troupe gets a small set of scenery, and so does each villager: the Sage has jars, the wardrobe mistress has the costume chest, a bag and crates, the beachcomber a bag and a jar, and the hunter a carcass, a cold campfire and a crate. The scenery is in its own primitive as bots with object sheets (object_chest, object_tent_tryker, object_ruin_wall_b and so on). Look at an object sheet in game before placing it: object_stump, for example, is a giant broken tree, not a stump.
The mission source is missions_tryker_story4.primitive, a missions_editor node with one mission_tree per mission. Each tree sets giver_primitive to urban_tryker_story4.primitive and mission_giver to the giver variable. The mission compiler turns the trees into mission nodes under the giver bots in that file, and writes their phrases to missions_tryker_story4_wk.txt. It comes as a front end with a window (ryzom_mission_compiler_fe) and as a command-line tool. The command-line tool runs in the folder of the source primitive, with the RYZOM_LEVELDESIGN environment variable pointing at the leveldesign folder:
ryzom_mission_compiler <path>/world_editor_classes.xml missions_tryker_story4.primitive
The phrase file is written to that folder. Move it into translation/work/phrases/rites and include it from phrase_rites_wk.txt.
The texts are written in the mission tree as literals with a suffix: "I'll go and watch." ACCEPT becomes the phrase R_12_19_ACCEPT with that English text, and the compiler works out its parameters from the variables used in it. $player$ is always available. {break} splits a bot chat into pages, and $shell.p$ gives the plural of an item's name.
Each mission opens with a linear_dyn_chat_fail: the giver's offer, in pages, with one answer. Choosing the answer accepts the mission. Closing the bubble fails it, so the giver offers it again later.
| Mission | Giver | Gives at the start | Objective | Reward |
|---|---|---|---|---|
TRYKER_STORY4_TASK_FORAGE |
The beachcomber | Refugee Foraging Tool, the extraction action abhfepa01 |
Forage 5 Fragments of Basic Horny Shell (m0053dxacb01) on the shore, then give them to her |
Keeps the tool, 30 dappers |
TRYKER_STORY4_TASK_LOOT |
The hunter | Refugee Dagger | Hunt Suckling Yubos and quarter them for 4 Basic Yubo Teeth (m0692chdca01), then give them to him |
Keeps the dagger, 30 dappers |
TRYKER_STORY4_TASK_CRAFT |
The wardrobe mistress | Refugee Crafting Tool for Armor, the Tryker armor craft action abctaca01 and the boots plan abctaea01_talb, yubo skin and teeth, pilan oil, redhot sap |
Craft Tissan Boots (ictalb), then give them to her |
Keeps the tool, the action and the plan, 30 dappers |
Each task has two steps: the work (forage, loot or craft), then give_item to the giver, whose post-actions say the thanks and pay the reward. The items are declared as var_item with a var_quantity and a var_quality. The deposit on the shore uses exact_mp_item with auto_spawn_sources and can_prospect = false, so sources appear by themselves and the player only needs the extraction action.
A craft action only offers the plans of its own civilisation, plus the common and refugee plans: its root brick lists the plan families. A Zorai crafter's armor action therefore does not show the Tryker boots. The craft task teaches the Tryker armor action along with the plan (one learn_action with both phrases), so a character of any civilisation can make the boots.
The rite tree is mono_instance and solo, with the prerequisite require_encyclo_thema = 12 19, which holds once every task of the theme is done. Missions are not replayable unless they are marked replayable, so each character can succeed at the rite once. Mono means one instance on the shard at a time: while one player is watching, the Sage lists the play in red for everyone else, and its details say "This mission cannot be taken for the moment, come back later." The first step's pre-actions start a timer of 6000 ticks (set_constrains, 10 minutes). If it runs out, the mission fails.
| Step | Objective | Post-actions |
|---|---|---|
arrival |
talk_to the storyteller: "I have come to see the performance." |
Scene 1 in say chat; ai_event 0 to the actress's group |
scene_1_wait |
wait_ai_msg story4_bowed |
|
scene_1 |
target the actress |
Scene 2; ai_event 1 to the actress |
scene_2_wait |
wait_ai_msg story4_at_cavern |
|
scene_2 |
target an elder |
Scene 3; ai_event 2 to the actress |
scene_3_wait |
wait_ai_msg story4_home |
|
scene_3 |
target the actress |
Scene 4; ai_event 3 to the actress |
scene_4_wait |
wait_ai_msg story4_flowers |
|
scene_4 |
target an elder |
Scene 5; ai_event 4 to the actress and 2 to the elders |
scene_5_wait |
wait_ai_msg story4_pothole |
|
scene_5 |
target the actress |
Scene 6; ai_event 5 to the actress and 3 to the elders |
scene_6_wait |
wait_ai_msg story4_sealed |
|
scene_6 |
target the storyteller |
The curtain; the actress and both elders bow (one bot_emote per bot); ai_event 0 to the spectators, who applaud |
pay_the_troupe |
give_money 50 to the storyteller |
Thanks; the storyteller bows; ai_event 9 to the actress and the elders; recv_money 200; recv_fame Tryker 300; the Sage's closing line |
The step_failure node comes right after the offer, before the first step. It sends ai_event 9 to the actress and the elders and has the storyteller say that the guest slipped away. Its place in the tree matters. The compiler writes a failure … /failure block where the node stands, and the failure line is itself an action: when the script reaches it, the mission records which block to run if it fails. So a failure block only covers the steps that come after it. Placed at the end of the tree, it would only be reached after the last step, and a timer failure during the play would leave the actors on the stage. Placed after the offer, it also stays out of the way when the player closes the Sage's bubble, which fails the mission before the block is reached.
Two more handlers follow the failure block, step_player_reconnect and step_crash, each containing a single fail. The first runs when the player logs back in while the rite is still in their journal. The second runs when the service that holds the stage crashes; its ai_instances is tryker_newbie, and it also runs when the EGS itself was restarted. A stage cannot pick up a scene halfway: the actors were left wherever they stood, and the messages of the next move would never reach the waiting step. So the rite fails, the failure block clears the stage, and the player can ask the Sage again.
The storyteller's lines use bot_chat with chat_type = say, so everyone near the stage hears them. The give_money step adds "Give Money" to the storyteller's menu. It opens the offer window, where the player sets the amount and clicks Give.
Each scene is a handshake between the mission and the AI service:
ai_event (group variable, event number).destination_reached handler sets the arrival state, plays an emote or a line, and sends send_message with the parameters EGS, R_12_19 and the message name.wait_ai_msg step for that message completes. The following target step lets the player look at the scene before the storyteller goes on.The wait_ai_msg step is already active when the AI moves, because the ai_event is in the post-actions of the step before it. A message that arrives while no step waits for it is dropped. See send_message.
The stage is an npc_folder in the urban primitive. The actress's group has autoSpawn = false. Its handlers are group handlers (npc_group_event_handler), so they work in whatever state she is in:
| Event | Action |
|---|---|
user_event_0 |
Clear the stage first (her home state, trigger_event_9 on the elders), then spawn and timer t0 at 40 ticks |
timer_t0_triggered |
bow emote, send_message story4_bowed |
user_event_1 |
Walk route story4_actress_to_cavern. On arrival in story4_actress_cavern: her first line, trigger_event_0 on the elders (they spawn at the temple), send_message story4_at_cavern |
user_event_2 |
Run route story4_actress_run_home. On arrival: home state, trigger_event_1 on the elders (they laugh), send_message story4_home |
user_event_3 |
unhappy emote, trigger_event_9 on the elders (night falls, they go off), run route story4_actress_flowers back to the temple. On arrival: trigger_event_0 on the elders, her second line, send_message story4_flowers |
user_event_4 |
Run route story4_actress_lead to the pothole, point emote |
user_event_5 |
Walk route story4_actress_walk_home. On arrival: sad emote, send_message story4_sealed |
user_event_9 |
despawn, home state |
The elders' group, also autoSpawn = false, spawns on user_event_0 and laughs on user_event_1. It walks to the pothole on user_event_2, where its arrival sends story4_pothole, walks back on user_event_3 and despawns on user_event_9.
A route is an npc_route with ai_movement = follow_route. Add ai_profile_params = running to make the bots run. A state's ai_movement also decides what the bots do once they are in it. stand_on_start_point walks each bot back to its position in the group, so the sample uses it only where that is where the bot should stand: the actress's home and the elders' temple. The states that a route ends in use wait, so the bots stay where the route left them.
The work phrases are missions_tryker_story4_wk.txt and tryker_story4_npcs_wk.txt, both included from phrase_rites_wk.txt. The translated phrases go in translation/translated/phrase_<lang>.txt, where each one carries the HASH_VALUE of its work phrase, and their texts in clause_<lang>.txt. Display names for new bots go in the work and translated bot_names.txt. The scripts in scripts/translation_tools compute the hashes and check them. See Localization System.
addMission <character eid> <giver alias> <mission alias> on the EGS gives a mission without its prerequisites, for example addMission <eid> 857735172 857735233 for the rite. removeMission <eid> <mission alias> takes it back.forceMissionProgress <eid> sends one debug event to the current step. It counts as one item, one kill or one target, so a step that needs five items needs five events. On an offer bubble it counts as closing it, which fails the mission.script <group name> ()setEvent(<n>); on the AI service raises a user event on a group, and displayVisionRadius <instance> <x> <y> <radius> lists the bots around a point with their positions./camera <heading> <pitch> [<distance>] turns the camera (heading 0 looks east, 90 north, and a negative pitch looks down).ENCY_* phrases, and write the album and theme sheets.encyclo_unlock, so the player sees it before the first task is done.require_encyclo_thema. Use mono_instance when the rite spawns or moves shared bots, and a timer so a player who walks away frees the stage.wait_ai_msg step after every ai_event that starts a move, and send the message from the end of the move, not from its start.failure block, and put the step_failure node before the steps it covers. Add step_player_reconnect and step_crash handlers that fail the rite, and have the first event of a performance clear the stage before anyone spawns.