set_url - ryzom/ryzomcore GitHub Wiki
title: Set URL description: Add a URL action to an NPC's contextual menu published: true date: 2026-11-12T00:00:00.000Z tags: editor: markdown dateCreated: 2023-03-16T22:29:29.437Z
The setUrl native AI script function sets a URL action on all spawned bots in the group. This adds an entry to the bot's right-click contextual menu that opens the specified URL in the in-game browser when clicked by a player.
()setUrl(actionName: s, url: s)- actionName (string): The text displayed in the contextual menu entry.
- url (string): The URL to open when the player clicks the menu entry.
- A
CCreatureSetUrlMsglisting every spawned bot of the group is sent to EGS - For each of these bots, EGS sets the
WebPageFlagin the creature's BotChat program and stores the URL and action name - On the client, when the player right-clicks the NPC, the action name appears as a menu entry (only if
WebPageFlagis set) - Clicking the entry opens the URL in the in-game web browser
// Add a web link to the NPC
()setUrl("Visit our website", "https://example.ryzom.dev/example.php");// Dynamic URL with player context
($playerEid)getCurrentPlayerEid();
()setUrl("Check your stats", "https://example.ryzom.dev/stats.php?eid=" + $playerEid);// Remove the menu entry again
()clearUrl();- The URL is applied to all bots of the group that are spawned when the function is called.
- The menu entry is removed with clearUrl.
- In a server built with the Ryzom Forge option (
WITH_RYZOM_FORGE), setting the URL to"*"removes the menu entry as well. In any other build"*"has no special meaning and is stored as the URL. - The in-game browser has limited capabilities compared to a full web browser. Test your URLs in-game.
- The URL can point to server-side scripts that interact with the game's web services (WebIG).
- clearUrl - Remove the URL action again
- addBotChat - Add other types of contextual menu entries
- npcSay - Make an NPC say something in chat
Source: ryzom/server/src/ai_service/nf_grp.cpp (setUrl_ss_), ryzom/server/src/entities_game_service/creature_manager/creature_manager.cpp (CCreatureSetUrlImp::callback)