set_oupost_mode - ryzom/ryzomcore GitHub Wiki
title: Set Oupost Mode description: Put an NPC group on one side of an outpost conflict published: true date: 2026-11-12T00:00:00.000Z tags: editor: markdown dateCreated: 2023-03-16T22:28:57.759Z
The setOupostMode native AI script function puts the current NPC group on one side of the conflict of an outpost: the group fights for the owner or for the attacker of that outpost.
The function
setOupostModereally does have the typo in it. There is nosetOutpostModefunction. {.is-danger}
()setOupostMode(alias: s, side: s); // setOupostMode_ss_-
alias (string): The alias of the outpost, written as an alias string:
"(A:<static part>:<dynamic part>)". This is the form in which aliases are displayed by the services and by the World Editor. -
side (string): The side the group fights for,
"owner"or"attacker".
()setOupostMode("(A:1040:25)", "owner");This puts the current NPC group on the side of the owner of the outpost whose alias is (A:1040:25).
- Every bot of the group stores the side. For each spawned bot, the side and the alias of the outpost are written to the mirror properties of the bot, where EGS reads them for the outpost PvP rules.
- The factions of the group get the properties of that side of the outpost:
-
owner: the group is in
outpost:<alias>:bot_defenderand is a friend of it; its enemies areoutpost:<alias>:bot_attacker(the bots of the other side) andoutpost:<alias>:attacker(the players who attack the outpost). -
attacker: the group is in
outpost:<alias>:bot_attackerand is a friend of it; its enemies areoutpost:<alias>:bot_defenderandoutpost:<alias>:defender(the players who defend the outpost).
-
owner: the group is in
- If the group is spawned, its information is sent to EGS again.
- This function can only be used with NPC groups.
- A side other than
"owner"or"attacker", or an alias that is not an alias string, is refused with a warning in the log of the AI service, and nothing is changed. - The alias reaches only the bots that are spawned when the function is called.
- The faction properties are added to those the group already has. Calling the function again with the other side does not remove the properties of the first side.
- The squads of an outpost get their side and factions from the outpost itself when they are created; this function is for other groups that take part in the conflict.
Source: ryzom/server/src/ai_service/nf_grp_npc.cpp (setOupostMode_ss_), ryzom/server/src/ai_service/ai_grp_npc.cpp (CGroupNpc::setOutpostFactions)